本文整理汇总了PHP中getCustomFields函数的典型用法代码示例。如果您正苦于以下问题:PHP getCustomFields函数的具体用法?PHP getCustomFields怎么用?PHP getCustomFields使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCustomFields函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: install_gmaps
function install_gmaps()
{
require_once 'ModuleInstall/ModuleInstaller.php';
$ModuleInstaller = new ModuleInstaller();
$ModuleInstaller->install_custom_fields(getCustomFields());
installJJWHooks();
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:7,代码来源:GoogleMaps.php
示例2: updateClient
public function updateClient()
{
global $whmcs;
$exinfo = getClientsDetails($this->getID());
if (defined("ADMINAREA")) {
$updatefieldsarray = array();
} else {
$updatefieldsarray = array("firstname" => "First Name", "lastname" => "Last Name", "companyname" => "Company Name", "email" => "Email Address", "address1" => "Address 1", "address2" => "Address 2", "city" => "City", "state" => "State", "postcode" => "Postcode", "country" => "Country", "phonenumber" => "Phone Number", "billingcid" => "Billing Contact");
if ($whmcs->get_config("AllowClientsEmailOptOut")) {
$updatefieldsarray['emailoptout'] = "Newsletter Email Opt Out";
}
}
$changelist = array();
$updateqry = array();
foreach ($updatefieldsarray as $field => $displayname) {
if ($this->isEditableField($field)) {
$value = $whmcs->get_req_var($field);
if ($field == "emailoptout" && !$value) {
$value = "0";
}
$updateqry[$field] = $value;
if ($value != $exinfo[$field]) {
$changelist[] = "" . $displayname . ": '" . $exinfo[$field] . "' to '" . $value . "'";
continue;
}
continue;
}
}
update_query("tblclients", $updateqry, array("id" => $this->getID()));
$old_customfieldsarray = getCustomFields("client", "", $this->getID(), "", "");
$customfields = getCustomFields("client", "", $this->getID(), "", "");
foreach ($customfields as $v) {
$k = $v['id'];
$customfieldsarray[$k] = $_POST['customfield'][$k];
}
saveCustomFields($this->getID(), $customfieldsarray);
$paymentmethod = $whmcs->get_req_var("paymentmethod");
clientChangeDefaultGateway($this->getID(), $paymentmethod);
if ($paymentmethod != $exinfo['defaultgateway']) {
$changelist[] = "Default Payment Method: '" . getGatewayName($exinfo['defaultgateway']) . "' to '" . getGatewayName($paymentmethod) . "'<br>\n";
}
run_hook("ClientEdit", array_merge(array("userid" => $this->getID(), "olddata" => $exinfo), $updateqry));
if (!defined("ADMINAREA") && $whmcs->get_config("SendEmailNotificationonUserDetailsChange")) {
foreach ($old_customfieldsarray as $values) {
if ($values['value'] != $_POST['customfield'][$values['id']]) {
$changelist[] = $values['name'] . ": '" . $values['value'] . "' to '" . $_POST['customfield'][$values['id']] . "'";
continue;
}
}
if (0 < count($changelist)) {
$adminurl = $whmcs->get_config("SystemSSLURL") ? $whmcs->get_config("SystemSSLURL") : $whmcs->get_config("SystemURL");
$adminurl .= "/" . $whmcs->get_admin_folder_name() . "/clientssummary.php?userid=" . $this->getID();
sendAdminNotification("account", "WHMCS User Details Change", "<p>Client ID: <a href=\"" . $adminurl . "\">" . $this->getID() . " - " . $exinfo['firstname'] . " " . $exinfo['lastname'] . "</a> has requested to change his/her details as indicated below:<br><br>" . implode("<br />\n", $changelist) . "<br>If you are unhappy with any of the changes, you need to login and revert them - this is the only record of the old details.</p>");
logActivity("Client Profile Modified - " . implode(", ", $changelist) . " - User ID: " . $this->getID());
}
}
return true;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:58,代码来源:class.client.php
示例3: SetInsertQuery
/**
* set insert / update / delete query for adding IP address
* based on provided array
*/
function SetInsertQuery($ip)
{
/* First we need to get custom fields! */
$myFields = getCustomFields('ipaddresses');
$myFieldsInsert['query'] = '';
$myFieldsInsert['values'] = '';
if (sizeof($myFields) > 0) {
/* set inserts for custom */
foreach ($myFields as $myField) {
# empty?
if (strlen($ip[$myField['name']]) == 0) {
$myFieldsInsert['query'] .= ', `' . $myField['name'] . '`';
$myFieldsInsert['values'] .= ", NULL";
} else {
$myFieldsInsert['query'] .= ', `' . $myField['name'] . '`';
$myFieldsInsert['values'] .= ", '" . $ip[$myField['name']] . "'";
}
}
}
/* insert */
if ($ip['action'] == "add") {
$query = "insert into `ipaddresses` ";
$query .= "(`subnetId`,`description`,`ip_addr`, `dns_name`,`mac`, `owner`, `state`, `switch`, `port`, `note`, `excludePing` " . $myFieldsInsert['query'] . ") ";
$query .= "values ";
$query .= "('{$ip['subnetId']}', '{$ip['description']}', '" . Transform2decimal($ip['ip_addr']) . "', " . "\n";
$query .= " '{$ip['dns_name']}', '{$ip['mac']}', '{$ip['owner']}', '{$ip['state']}', " . "\n";
$query .= " '{$ip['switch']}', '{$ip['port']}', '{$ip['note']}', '" . @$ip['excludePing'] . "' " . $myFieldsInsert['values'] . ");";
} elseif ($ip['action'] == "edit" && $ip['type'] == "series") {
$query = "update `ipaddresses` ";
$query .= "set `ip_addr` = '" . Transform2decimal($ip['ip_addr']) . "', ";
$query .= "`description` = '" . $ip['description'] . "', ";
$query .= "`dns_name` = '" . $ip['dns_name'] . "' ,";
$query .= "`mac` = '" . $ip['mac'] . "' ,";
$query .= "`owner` = '" . $ip['owner'] . "' ,";
$query .= "`state` = '" . $ip['state'] . "',";
$query .= "`switch` = '" . $ip['switch'] . "',";
$query .= "`port` = '" . $ip['port'] . "',";
$query .= "`excludePing` = '" . @$ip['excludePing'] . "',";
# custom!
foreach ($myFields as $myField) {
if (strlen($ip[$myField['name']]) == 0) {
$query .= "`" . $myField['name'] . "` = NULL,";
} else {
$query .= "`" . $myField['name'] . "` = '" . $ip[$myField['name']] . "',";
}
}
$query .= "`note` = '" . $ip['note'] . "' ";
$query .= "where `subnetId` = '" . $ip['subnetId'] . "' and `ip_addr` = '" . Transform2decimal($ip['ip_addr']) . "';";
} elseif ($ip['action'] == "edit") {
$query = "update ipaddresses ";
$query .= "set `ip_addr` = '" . Transform2decimal($ip['ip_addr']) . "', `description` = '" . $ip['description'] . "', `dns_name` = '" . $ip['dns_name'] . "' , `mac` = '" . $ip['mac'] . "', " . "\n";
#custom!
foreach ($myFields as $myField) {
if (strlen($ip[$myField['name']]) == 0) {
$query .= "`" . $myField['name'] . "` = NULL,";
} else {
$query .= "`" . $myField['name'] . "` = '" . $ip[$myField['name']] . "',";
}
}
$query .= "`owner` = '" . $ip['owner'] . "' , `state` = '" . $ip['state'] . "', `switch` = '" . $ip['switch'] . "', " . "\n";
$query .= "`port` = '" . $ip['port'] . "', `note` = '" . $ip['note'] . "', `excludePing` = '" . @$ip['excludePing'] . "' ";
$query .= "where `id` = '" . $ip['id'] . "';";
} elseif ($ip['action'] == "delete" && $ip['type'] == "series") {
$query = "delete from ipaddresses where `subnetId` = '" . $ip['subnetId'] . "' and `ip_addr` = '" . Transform2decimal($ip['ip_addr']) . "';";
} elseif ($ip['action'] == "delete") {
$query = "delete from ipaddresses where `id` = '" . $ip['id'] . "';";
} elseif ($ip['action'] == "move") {
$query = "update `ipaddresses` set `subnetId` = '{$ip['newSubnet']}' where `id` = '{$ip['id']}';";
}
/* return query */
return $query;
}
开发者ID:retexica,项目名称:phpipam,代码行数:76,代码来源:functions-network.php
示例4: acceptIPrequest
/**
* accept IP request
*/
function acceptIPrequest($request)
{
global $database;
/* first update request */
$query = 'update requests set `processed` = "1", `accepted` = "1", `adminComment` = "' . $request['adminComment'] . '" where `id` = "' . $request['requestId'] . '";' . "\n";
/* We need to get custom fields! */
$myFields = getCustomFields('ipaddresses');
$myFieldsInsert['query'] = '';
$myFieldsInsert['values'] = '';
if (sizeof($myFields) > 0) {
/* set inserts for custom */
foreach ($myFields as $myField) {
$myFieldsInsert['query'] .= ', `' . $myField['name'] . '`';
$myFieldsInsert['values'] .= ", '" . $request[$myField['name']] . "'";
}
}
/* insert */
$query .= "insert into `ipaddresses` ";
$query .= "(`subnetId`,`description`,`ip_addr`, `dns_name`,`mac`, `owner`, `state`, `switch`, `port`, `note` " . $myFieldsInsert['query'] . ") ";
$query .= "values ";
$query .= "('" . $request['subnetId'] . "', '" . $request['description'] . "', '" . $request['ip_addr'] . "', " . "\n";
$query .= " '" . $request['dns_name'] . "', '" . $request['mac'] . "', '" . $request['owner'] . "', '" . $request['state'] . "', " . "\n";
$query .= " '" . $request['switch'] . "', '" . $request['port'] . "', '" . $request['note'] . "'" . $myFieldsInsert['values'] . ");";
/* set log file */
foreach ($request as $key => $req) {
$log .= " " . $key . ": " . $req . "<br>";
}
/* execute */
try {
$database->executeMultipleQuerries($query);
} catch (Exception $e) {
$error = $e->getMessage();
print "<div class='alert alert-danger'>" . _('Error') . ": {$error}</div>";
updateLogTable('Failed to accept IP request', $log . "\n" . $error, 2);
return false;
}
/* return success */
updateLogTable('IP request accepted', $log, 1);
return true;
}
开发者ID:retexica,项目名称:phpipam,代码行数:43,代码来源:functions-tools.php
示例5: select_query
echo $aInt->lang("global", "none");
echo "</option>\n";
$result = select_query("tblclientgroups", "", "", "groupname", "ASC");
while ($data = mysql_fetch_assoc($result)) {
$group_id = $data['id'];
$group_name = $data['groupname'];
$group_colour = $data['groupcolour'];
echo "<option style=\"background-color:" . $group_colour . "\" value=" . $group_id . "";
if ($group_id == $groupid) {
echo " selected";
}
echo ">" . $group_name . "</option>";
}
echo "</select></td></tr>\n<tr>";
$taxindex = 27;
$customfields = getCustomFields("client", "", $userid, "on", "");
$x = 0;
foreach ($customfields as $customfield) {
++$x;
echo "<td class=\"fieldlabel\">" . $customfield['name'] . "</td><td class=\"fieldarea\">" . str_replace(array("<input", "<select", "<textarea"), array("<input tabindex=\"" . $taxindex . "\"", "<select tabindex=\"" . $taxindex . "\"", "<textarea tabindex=\"" . $taxindex . "\""), $customfield['input']) . "</td>";
if ($x % 2 == 0 || $x == count($customfields)) {
echo "</tr><tr>";
}
++$taxindex;
}
echo "<td class=\"fieldlabel\">";
echo $aInt->lang("fields", "adminnotes");
echo "</td><td class=\"fieldarea\" colspan=\"3\"><textarea name=\"notes\" rows=4 style=\"width:100%;\" tabindex=\"";
echo $taxindex++;
echo "\">";
echo $notes;
开发者ID:billyprice1,项目名称:whmcs,代码行数:31,代码来源:clientsadd.php
示例6: checkAdmin
<?php
/**
* Print all available VRFs and configurations
************************************************/
/* required functions */
require_once '../../functions/functions.php';
/* verify that user is admin */
checkAdmin();
/* get post */
$vlanPost = $_POST;
/* get all available VRFs */
$vlan = subnetGetVLANdetailsById($_POST['vlanId']);
/* get custom fields */
$custom = getCustomFields('vlans');
if ($_POST['action'] == "delete") {
$readonly = "readonly";
} else {
$readonly = "";
}
/* set form name! */
if (isset($_POST['fromSubnet'])) {
$formId = "vlanManagementEditFromSubnet";
} else {
$formId = "vlanManagementEdit";
}
?>
<script type="text/javascript">
$(document).ready(function(){
if ($("[rel=tooltip]").length) { $("[rel=tooltip]").tooltip(); }
开发者ID:btorresgil,项目名称:phpipam,代码行数:31,代码来源:manageVLANEdit.php
示例7: doArticles
function doArticles($atts, $iscustom, $thing = null)
{
global $pretext, $prefs;
extract($pretext);
extract($prefs);
$customFields = getCustomFields();
$customlAtts = array_null(array_flip($customFields));
if ($iscustom) {
$extralAtts = array('category' => '', 'section' => '', 'excerpted' => '', 'author' => '', 'month' => '', 'expired' => $publish_expired_articles, 'id' => '', 'exclude' => '');
} else {
$extralAtts = array('listform' => '', 'searchform' => '', 'searchall' => 1, 'searchsticky' => 0, 'pageby' => '', 'pgonly' => 0);
}
// Getting attributes.
$theAtts = lAtts(array('form' => 'default', 'limit' => 10, 'sort' => '', 'sortby' => '', 'sortdir' => '', 'keywords' => '', 'time' => 'past', 'status' => STATUS_LIVE, 'allowoverride' => !$q and !$iscustom, 'offset' => 0, 'wraptag' => '', 'break' => '', 'label' => '', 'labeltag' => '', 'class' => '') + $customlAtts + $extralAtts, $atts);
// For the txp:article tag, some attributes are taken from globals;
// override them, then stash all filter attributes.
if (!$iscustom) {
$theAtts['category'] = $c ? $c : '';
$theAtts['section'] = $s && $s != 'default' ? $s : '';
$theAtts['author'] = !empty($author) ? $author : '';
$theAtts['month'] = !empty($month) ? $month : '';
$theAtts['frontpage'] = $s && $s == 'default' ? true : false;
$theAtts['excerpted'] = 0;
$theAtts['exclude'] = 0;
$theAtts['expired'] = $publish_expired_articles;
filterAtts($theAtts);
} else {
$theAtts['frontpage'] = false;
}
extract($theAtts);
// If a listform is specified, $thing is for doArticle() - hence ignore here.
if (!empty($listform)) {
$thing = '';
}
$pageby = empty($pageby) ? $limit : $pageby;
// Treat sticky articles differently wrt search filtering, etc.
$status = in_array(strtolower($status), array('sticky', STATUS_STICKY)) ? STATUS_STICKY : STATUS_LIVE;
$issticky = $status == STATUS_STICKY;
// Give control to search, if necessary.
if ($q && !$iscustom && !$issticky) {
include_once txpath . '/publish/search.php';
$s_filter = $searchall ? filterSearch() : '';
$q = trim($q);
$quoted = $q[0] === '"' && $q[strlen($q) - 1] === '"';
$q = doSlash($quoted ? trim(trim($q, '"')) : $q);
// Searchable article fields are limited to the columns of the
// textpattern table and a matching fulltext index must exist.
$cols = do_list_unique($searchable_article_fields);
if (empty($cols) or $cols[0] == '') {
$cols = array('Title', 'Body');
}
$match = ", MATCH (`" . join("`, `", $cols) . "`) AGAINST ('{$q}') AS score";
$search_terms = preg_replace('/\\s+/', ' ', str_replace(array('\\', '%', '_', '\''), array('\\\\', '\\%', '\\_', '\\\''), $q));
if ($quoted || empty($m) || $m === 'exact') {
for ($i = 0; $i < count($cols); $i++) {
$cols[$i] = "`{$cols[$i]}` LIKE '%{$search_terms}%'";
}
} else {
$colJoin = $m === 'any' ? "OR" : "AND";
$search_terms = explode(' ', $search_terms);
for ($i = 0; $i < count($cols); $i++) {
$like = array();
foreach ($search_terms as $search_term) {
$like[] = "`{$cols[$i]}` LIKE '%{$search_term}%'";
}
$cols[$i] = "(" . join(" {$colJoin} ", $like) . ")";
}
}
$cols = join(" OR ", $cols);
$search = " AND ({$cols}) {$s_filter}";
// searchall=0 can be used to show search results for the current
// section only.
if ($searchall) {
$section = '';
}
if (!$sort) {
$sort = "score DESC";
}
} else {
$match = $search = '';
if (!$sort) {
$sort = "Posted DESC";
}
}
// For backwards compatibility. sortby and sortdir are deprecated.
if ($sortby) {
trigger_error(gTxt('deprecated_attribute', array('{name}' => 'sortby')), E_USER_NOTICE);
if (!$sortdir) {
$sortdir = "DESC";
} else {
trigger_error(gTxt('deprecated_attribute', array('{name}' => 'sortdir')), E_USER_NOTICE);
}
$sort = "{$sortby} {$sortdir}";
} elseif ($sortdir) {
trigger_error(gTxt('deprecated_attribute', array('{name}' => 'sortdir')), E_USER_NOTICE);
$sort = "Posted {$sortdir}";
}
// Building query parts.
$frontpage = ($frontpage and (!$q or $issticky)) ? filterFrontPage() : '';
$category = join("','", doSlash(do_list_unique($category)));
//.........这里部分代码省略.........
开发者ID:ClaireBrione,项目名称:textpattern,代码行数:101,代码来源:publish.php
示例8: populateArticleData
function populateArticleData($rs)
{
global $thisarticle;
extract($rs);
trace_add("[" . gTxt('Article') . " {$ID}]");
$thisarticle['thisid'] = $ID;
$thisarticle['posted'] = $uPosted;
$thisarticle['expires'] = $uExpires;
$thisarticle['modified'] = $uLastMod;
$thisarticle['annotate'] = $Annotate;
$thisarticle['comments_invite'] = $AnnotateInvite;
$thisarticle['authorid'] = $AuthorID;
$thisarticle['title'] = $Title;
$thisarticle['url_title'] = $url_title;
$thisarticle['category1'] = $Category1;
$thisarticle['category2'] = $Category2;
$thisarticle['section'] = $Section;
$thisarticle['keywords'] = $Keywords;
$thisarticle['article_image'] = $Image;
$thisarticle['comments_count'] = $comments_count;
$thisarticle['body'] = $Body_html;
$thisarticle['excerpt'] = $Excerpt_html;
$thisarticle['override_form'] = $override_form;
$thisarticle['status'] = $Status;
$custom = getCustomFields();
if ($custom) {
foreach ($custom as $i => $name) {
$thisarticle[$name] = $rs['custom_' . $i];
}
}
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:31,代码来源:publish.php
示例9: article_save
/**
* Processes sent forms and updates existing articles.
*/
function article_save()
{
global $txp_user, $vars, $prefs;
extract($prefs);
$incoming = array_map('assert_string', psa($vars));
$oldArticle = safe_row("Status, url_title, Title, textile_body, textile_excerpt,\n UNIX_TIMESTAMP(LastMod) AS sLastMod, LastModID,\n UNIX_TIMESTAMP(Posted) AS sPosted,\n UNIX_TIMESTAMP(Expires) AS sExpires", 'textpattern', "ID = " . (int) $incoming['ID']);
if (!($oldArticle['Status'] >= STATUS_LIVE and has_privs('article.edit.published') or $oldArticle['Status'] >= STATUS_LIVE and $incoming['AuthorID'] === $txp_user and has_privs('article.edit.own.published') or $oldArticle['Status'] < STATUS_LIVE and has_privs('article.edit') or $oldArticle['Status'] < STATUS_LIVE and $incoming['AuthorID'] === $txp_user and has_privs('article.edit.own'))) {
// Not allowed, you silly rabbit, you shouldn't even be here.
// Show default editing screen.
article_edit();
return;
}
if ($oldArticle['sLastMod'] != $incoming['sLastMod']) {
article_edit(array(gTxt('concurrent_edit_by', array('{author}' => txpspecialchars($oldArticle['LastModID']))), E_ERROR), true, true);
return;
}
if (!has_privs('article.set_markup')) {
$incoming['textile_body'] = $oldArticle['textile_body'];
$incoming['textile_excerpt'] = $oldArticle['textile_excerpt'];
}
$incoming = textile_main_fields($incoming);
extract(doSlash($incoming));
extract(array_map('assert_int', psa(array('ID', 'Status'))));
// Comments may be on, off, or disabled.
$Annotate = (int) $Annotate;
if (!has_privs('article.publish') && $Status >= STATUS_LIVE) {
$Status = STATUS_PENDING;
}
// Set and validate article timestamp.
if ($reset_time) {
$whenposted = "Posted = NOW()";
$when_ts = time();
} else {
if (!is_numeric($year) || !is_numeric($month) || !is_numeric($day) || !is_numeric($hour) || !is_numeric($minute) || !is_numeric($second)) {
$ts = false;
} else {
$ts = strtotime($year . '-' . $month . '-' . $day . ' ' . $hour . ':' . $minute . ':' . $second);
}
if ($ts === false || $ts < 0) {
$when = $when_ts = $oldArticle['sPosted'];
$msg = array(gTxt('invalid_postdate'), E_ERROR);
} else {
$when = $when_ts = $ts - tz_offset($ts);
}
$whenposted = "Posted = FROM_UNIXTIME({$when})";
}
// Set and validate expiry timestamp.
if (empty($exp_year)) {
$expires = 0;
} else {
if (empty($exp_month)) {
$exp_month = 1;
}
if (empty($exp_day)) {
$exp_day = 1;
}
if (empty($exp_hour)) {
$exp_hour = 0;
}
if (empty($exp_minute)) {
$exp_minute = 0;
}
if (empty($exp_second)) {
$exp_second = 0;
}
$ts = strtotime($exp_year . '-' . $exp_month . '-' . $exp_day . ' ' . $exp_hour . ':' . $exp_minute . ':' . $exp_second);
if ($ts === false || $ts < 0) {
$expires = $oldArticle['sExpires'];
$msg = array(gTxt('invalid_expirydate'), E_ERROR);
} else {
$expires = $ts - tz_offset($ts);
}
}
if ($expires && $expires <= $when_ts) {
$expires = $oldArticle['sExpires'];
$msg = array(gTxt('article_expires_before_postdate'), E_ERROR);
}
if ($expires) {
$whenexpires = "Expires = FROM_UNIXTIME({$expires})";
} else {
$whenexpires = "Expires = " . NULLDATETIME;
}
// Auto-update custom-titles according to Title, as long as unpublished and
// NOT customised.
if (empty($url_title) || $oldArticle['Status'] < STATUS_LIVE && $oldArticle['url_title'] === $url_title && $oldArticle['url_title'] === stripSpace($oldArticle['Title'], 1) && $oldArticle['Title'] !== $Title) {
$url_title = stripSpace($Title_plain, 1);
}
$Keywords = doSlash(trim(preg_replace('/( ?[\\r\\n\\t,])+ ?/s', ',', preg_replace('/ +/', ' ', ps('Keywords'))), ', '));
$user = doSlash($txp_user);
$description = doSlash($description);
$cfq = array();
$cfs = getCustomFields();
foreach ($cfs as $i => $cf_name) {
$custom_x = "custom_{$i}";
$cfq[] = "custom_{$i} = '" . ${$custom_x} . "'";
}
$cfq = join(', ', $cfq);
//.........这里部分代码省略.........
开发者ID:ClaireBrione,项目名称:textpattern,代码行数:101,代码来源:txp_article.php
示例10: die
<?php
/**
* Script to print devices
***************************/
/* verify that user is admin */
if (!checkAdmin()) {
die('');
}
/* get current devices */
$devices = getAllUniqueDevices();
/* get custom fields */
$custom = getCustomFields('devices');
/* get hidden fields */
if (!isset($settings)) {
$settings = getAllSettings();
}
$ffields = json_decode($settings['hiddenCustomFields'], true);
if (is_array($ffields['devices'])) {
$ffields = $ffields['devices'];
} else {
$ffields = array();
}
?>
<h4><?php
print _('Device management');
?>
</h4>
<hr>
<div class="btn-group">
开发者ID:kinhvan017,项目名称:phpipam,代码行数:31,代码来源:manageDevices.php
示例11: checkAdmin
<?php
/**
* Script to print add / edit / delete users
*************************************************/
/* required functions */
require_once '../../functions/functions.php';
/* verify that user is admin */
checkAdmin();
/* get all settings */
$settings = getAllSettings();
/* get custom fields */
$custom = getCustomFields('users');
/* get languages */
$langs = getLanguages();
?>
<script type="text/javascript">
$(document).ready(function(){
if ($("[rel=tooltip]").length) { $("[rel=tooltip]").tooltip(); }
});
</script>
<!-- header -->
<div class="pHeader">
<?php
/**
* If action is not set get it form post variable!
*/
开发者ID:btorresgil,项目名称:phpipam,代码行数:31,代码来源:usersEditPrint.php
示例12: article_edit
function article_edit($message = '', $concurrent = FALSE)
{
global $vars, $txp_user, $comments_disabled_after, $txpcfg, $prefs, $event;
extract($prefs);
extract(gpsa(array('view', 'from_view', 'step')));
if (!empty($GLOBALS['ID'])) {
// newly-saved article
$ID = $GLOBALS['ID'];
$step = 'edit';
} else {
$ID = gps('ID');
}
include_once txpath . '/lib/classTextile.php';
$textile = new Textile();
// switch to 'text' view upon page load and after article post
if (!$view || gps('save') || gps('publish')) {
$view = 'text';
}
if (!$step) {
$step = "create";
}
if ($step == "edit" && $view == "text" && !empty($ID) && $from_view != 'preview' && $from_view != 'html' && !$concurrent) {
$pull = true;
//-- it's an existing article - off we go to the db
$ID = assert_int($ID);
$rs = safe_row("*, unix_timestamp(Posted) as sPosted,\n\t\t\t\tunix_timestamp(Expires) as sExpires,\n\t\t\t\tunix_timestamp(LastMod) as sLastMod", "textpattern", "ID={$ID}");
extract($rs);
$reset_time = $publish_now = $Status < 4 && $sPosted <= time();
} else {
$pull = false;
//-- assume they came from post
if ($from_view == 'preview' or $from_view == 'html') {
$store_out = array();
$store = unserialize(base64_decode(ps('store')));
foreach ($vars as $var) {
if (isset($store[$var])) {
$store_out[$var] = $store[$var];
}
}
} else {
$store_out = gpsa($vars);
if ($concurrent) {
$store_out['sLastMod'] = safe_field('unix_timestamp(LastMod) as sLastMod', 'textpattern', 'ID=' . $ID);
}
}
$rs = $store_out;
extract($store_out);
}
$GLOBALS['step'] = $step;
if ($step == 'create') {
$textile_body = $use_textile;
$textile_excerpt = $use_textile;
}
if ($step != 'create' && $sPosted) {
// Previous record?
$prev_id = checkIfNeighbour('prev', $sPosted);
// Next record?
$next_id = checkIfNeighbour('next', $sPosted);
} else {
$prev_id = $next_id = 0;
}
$page_title = $Title ? $Title : gTxt('write');
pagetop($page_title, $message);
echo n . '<div id="' . $event . '_container" class="txp-container txp-edit">';
echo n . n . '<form id="article_form" name="article_form" method="post" action="index.php">';
if (!empty($store_out)) {
echo hInput('store', base64_encode(serialize($store_out)));
}
echo hInput('ID', $ID) . eInput('article') . sInput($step) . '<input type="hidden" name="view" />' . startTable('edit') . '<tr>' . n . '<td id="article-col-1"><div id="configuration_content">';
if ($view == 'text') {
//-- markup help --------------
echo pluggable_ui('article_ui', 'sidehelp', side_help($textile_body, $textile_excerpt), $rs);
//-- custom menu entries --------------
echo pluggable_ui('article_ui', 'extend_col_1', '', $rs);
//-- advanced --------------
echo '<div id="advanced_group"><h3 class="plain lever' . (get_pref('pane_article_advanced_visible') ? ' expanded' : '') . '"><a href="#advanced">' . gTxt('advanced_options') . '</a></h3>' . '<div id="advanced" class="toggle" style="display:' . (get_pref('pane_article_advanced_visible') ? 'block' : 'none') . '">';
// markup selection
echo pluggable_ui('article_ui', 'markup', n . graf('<label for="markup-body">' . gTxt('article_markup') . '</label>' . br . pref_text('textile_body', $textile_body, 'markup-body'), ' class="markup markup-body"') . n . graf('<label for="markup-excerpt">' . gTxt('excerpt_markup') . '</label>' . br . pref_text('textile_excerpt', $textile_excerpt, 'markup-excerpt'), ' class="markup markup-excerpt"'), $rs);
// form override
echo $allow_form_override ? pluggable_ui('article_ui', 'override', graf('<label for="override-form">' . gTxt('override_default_form') . '</label>' . sp . popHelp('override_form') . br . form_pop($override_form, 'override-form'), ' class="override-form"'), $rs) : '';
echo '</div></div>' . n;
//-- custom fields --------------
$cf = '';
$cfs = getCustomFields();
echo '<div id="custom_field_group"' . ($cfs ? '' : ' class="empty"') . '><h3 class="plain lever' . (get_pref('pane_article_custom_field_visible') ? ' expanded' : '') . '"><a href="#custom_field">' . gTxt('custom') . '</a></h3>' . '<div id="custom_field" class="toggle" style="display:' . (get_pref('pane_article_custom_field_visible') ? 'block' : 'none') . '">';
foreach ($cfs as $i => $cf_name) {
$custom_x_set = "custom_{$i}_set";
$custom_x = "custom_{$i}";
$cf .= ${$custom_x_set} !== '' ? custField($i, ${$custom_x_set}, ${$custom_x}) : '';
}
echo pluggable_ui('article_ui', 'custom_fields', $cf, $rs);
echo '</div></div>' . n;
//-- article image --------------
echo '<div id="image_group"><h3 class="plain lever' . (get_pref('pane_article_image_visible') ? ' expanded' : '') . '"><a href="#image">' . gTxt('article_image') . '</a></h3>' . '<div id="image" class="toggle" style="display:' . (get_pref('pane_article_image_visible') ? 'block' : 'none') . '">';
echo pluggable_ui('article_ui', 'article_image', n . graf('<label for="article-image">' . gTxt('article_image') . '</label>' . sp . popHelp('article_image') . br . fInput('text', 'Image', $Image, 'edit', '', '', 22, '', 'article-image'), ' class="article-image"'), $rs);
echo '</div></div>' . n;
//-- meta info --------------
echo '<div id="meta_group"><h3 class="plain lever' . (get_pref('pane_article_meta_visible') ? ' expanded' : '') . '"><a href="#meta">' . gTxt('meta') . '</a></h3>' . '<div id="meta" class="toggle" style="display:' . (get_pref('pane_article_meta_visible') ? 'block' : 'none') . '">';
// keywords
echo pluggable_ui('article_ui', 'keywords', n . graf('<label for="keywords">' . gTxt('keywords') . '</label>' . sp . popHelp('keywords') . br . n . '<textarea id="keywords" name="Keywords" cols="18" rows="5">' . htmlspecialchars(str_replace(',', ', ', $Keywords)) . '</textarea>', ' class="keywords"'), $rs);
//.........这里部分代码省略.........
开发者ID:bgarrels,项目名称:textpattern,代码行数:101,代码来源:txp_article.php
示例13: _
/* for nesting - MasterId cannot be the same as subnetId! */
if ($_POST['masterSubnetId'] == $_POST['subnetId']) {
$errors[] = _('Subnet cannot nest behind itself!');
}
} else {
}
}
}
}
/* but always verify vlan! */
$vlancheck = validateVlan($_POST['VLAN']);
if ($vlancheck != 'ok') {
$errors[] = $vlancheck;
}
//custom
$myFields = getCustomFields('subnets');
if (sizeof($myFields) > 0) {
foreach ($myFields as $myField) {
# replace possible ___ back to spaces!
$myField['nameTest'] = str_replace(" ", "___", $myField['name']);
if (isset($_POST[$myField['nameTest']])) {
$_POST[$myField['name']] = $_POST[$myField['nameTest']];
}
//booleans can be only 0 and 1!
if ($myField['type'] == "tinyint(1)") {
if ($_POST[$myField['name']] > 1) {
$_POST[$myField['name']] = "";
}
}
//not empty
if ($myField['Null'] == "NO" && strlen($_POST[$myField['name']]) == 0 && !checkAdmin(false)) {
开发者ID:btorresgil,项目名称:phpipam,代码行数:31,代码来源:manageSubnetEditResult.php
示例14: die
/* Hostname must be present! */
if ($device['hostname'] == "") {
die('<div class="alert alert alert-danger">' . _('Hostname is mandatory') . '!</div>');
}
# we need old hostname
if ($device['action'] == "edit" || $device['action'] == "delete") {
# get old switch name
$oldHostname = getDeviceDetailsById($device['switchId']);
$oldHostname = $oldHostname['hostname'];
# if delete new hostname = ""
if ($device['action'] == "delete") {
$device['hostname'] = "";
}
}
//custom
$myFields = getCustomFields('devices');
if (sizeof($myFields) > 0) {
foreach ($myFields as $myField) {
# replace possible ___ back to spaces!
$myField['nameTest'] = str_replace(" ", "___", $myField['name']);
if (isset($_POST[$myField['nameTest']])) {
$device[$myField['name']] = $device[$myField['nameTest']];
}
//booleans can be only 0 and 1!
if ($myField['type'] == "tinyint(1)") {
if ($device[$myField['name']] > 1) {
$device[$myField['name']] = "";
}
}
//not null!
if ($myField['Null'] == "NO" && strlen($device[$myField['name']]) == 0 && !checkAdmin(false, false)) {
开发者ID:btorresgil,项目名称:phpipam,代码行数:31,代码来源:manageDevicesEditResult.php
示例15: doHomeArticles
function doHomeArticles($atts, $thing = NULL)
{
global $pretext, $prefs;
extract($pretext);
extract($prefs);
$customFields = getCustomFields();
$customlAtts = array_null(array_flip($customFields));
//getting attributes
$theAtts = lAtts(array('form' => 'default', 'listform' => '', 'searchform' => '', 'limit' => 10, 'category' => '', 'section' => '', 'excerpted' => '', 'author' => '', 'sort' => '', 'month' => '', 'keywords' => '', 'frontpage' => '', 'time' => 'past', 'pgonly' => 0, 'searchall' => 1, 'allowoverride' => true, 'offset' => 0, 'wraptag' => '', 'break' => '', 'label' => '', 'labeltag' => '', 'class' => '') + $customlAtts, $atts);
$theAtts['category'] = $c ? $c : '';
$theAtts['section'] = $s && $s != 'default' && $s != 'home' ? $s : '';
$theAtts['author'] = !empty($author) ? $author : '';
$theAtts['month'] = !empty($month) ? $month : '';
$theAtts['frontpage'] = $s && $s == 'home' ? true : false;
$theAtts['excerpted'] = '';
extract($theAtts);
// if a listform is specified, $thing is for doArticle() - hence ignore here.
if (!empty($listform)) {
$thing = '';
}
$pageby = empty($pageby) ? $limit : $pageby;
$match = $search = '';
if (!$sort) {
$sort = 'Posted desc';
}
//Building query parts
$frontpage = filterFrontPage();
$category = join("','", doSlash(do_list($category)));
$category = !$category ? '' : " and (Category1 IN ('" . $category . "') or Category2 IN ('" . $category . "'))";
$section = !$section ? '' : " and Section IN ('" . join("','", doSlash(do_list($section))) . "')";
$excerpted = $excerpted == 'y' ? " and Excerpt !=''" : '';
$author = !$author ? '' : " and AuthorID IN ('" . join("','", doSlash(do_list($author))) . "')";
$month = !$month ? '' : " and Posted like '" . doSlash($month) . "%'";
$id = !$id ? '' : " and ID IN (" . join(',', array_map('intval', do_list($id))) . ")";
switch ($time) {
case 'any':
$time = "";
break;
case 'future':
$time = " and Posted > now()";
break;
default:
$time = " and Posted <= now()";
}
if (!$publish_expired_articles) {
$time .= " and (now() <= Expires or Expires = " . NULLDATETIME . ")";
}
$custom = '';
if ($customFields) {
foreach ($customFields as $cField) {
if (isset($atts[$cField])) {
$customPairs[$cField] = $atts[$cField];
}
}
if (!empty($customPairs)) {
$custom = buildCustomSql($customFields, $customPairs);
}
}
$statusq = ' and Status = 5';
$where = "1=1" . $statusq . $time . $search . $category . $section . $excerpted . $month . $author . $keywords . $custom . $frontpage;
$rs = safe_rows_start("*, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod" . $match, 'textpattern', $where . ' order by ' . doSlash($sort) . ' limit 0' . intval($limit));
// get the form name
$fname = $listform ? $listform : $form;
if ($rs) {
$count = 0;
$last = numRows($rs);
$articles = array();
while ($a = nextRow($rs)) {
++$count;
populateArticleData($a);
global $thisarticle, $uPosted, $limit;
$thisarticle['is_first'] = $count == 1;
$thisarticle['is_last'] = $count == $last;
if (@constant('txpinterface') === 'admin' and gps('Form')) {
$articles[] = parse(gps('Form'));
} elseif ($allowoverride and $a['override_form']) {
$articles[] = parse_form($a['override_form']);
} else {
$articles[] = $thing ? parse($thing) : parse_form($fname);
}
// sending these to paging_link(); Required?
$uPosted = $a['uPosted'];
unset($GLOBALS['thisarticle']);
}
return doLabel($label, $labeltag) . doWrap($articles, $wraptag, $break, $class);
}
}
开发者ID:nope,项目名称:textpattern,代码行数:87,代码来源:publish.php
示例16: htmlPrep
if (trim($agreement) == trim($agreementCheck)) {
$checked = "checked";
}
}
print $agreement . " <input {$checked} type='checkbox' name='studentAgreements[]' value='" . htmlPrep(trim($agreement)) . "'/><br/>";
}
?>
</td>
</tr>
<?php
}
}
//CUSTOM FIELDS
$fields = unserialize($row["fields"]);
$resultFields = getCustomFields($connection2, $guid, $student, $staff, $parent, $other);
if ($resultFields->rowCount() > 0) {
?>
<tr class='break'>
<td colspan=2>
<h3><?php
print _('Custom Fields');
?>
</h
|
请发表评论