本文整理汇总了PHP中config::get_config_item_id方法的典型用法代码示例。如果您正苦于以下问题:PHP config::get_config_item_id方法的具体用法?PHP config::get_config_item_id怎么用?PHP config::get_config_item_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config
的用法示例。
在下文中一共展示了config::get_config_item_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serialize
} else {
if ($types[$name] == "array") {
$c->set_value("value", serialize($_POST[$name]));
$TPL[$name] = $_POST[$name];
}
}
$c->save();
$TPL["message_good"] = "Saved configuration.";
}
}
// Handle the only checkbox specially. If more checkboxes are added this
// should be rewritten.
#echo var_dump($_POST);
if ($_POST['sbs_link'] == "rss" && !$_POST['rssShowProject']) {
$c = new config();
$c->set_id(config::get_config_item_id('rssShowProject'));
$c->select();
$c->set_value("value", '0');
$c->save();
}
$TPL["message"] or $TPL["message_good"] = "Saved configuration.";
} else {
if ($_POST["delete_logo"]) {
foreach (array(ALLOC_LOGO, ALLOC_LOGO_SMALL) as $logo) {
if (file_exists($logo)) {
if (unlink($logo)) {
$TPL["message_good"][] = "Deleted " . $logo;
}
}
if (file_exists($logo)) {
alloc_error("Unable to delete " . $logo);
示例2: config
<?php
// Add new Estimate options to the types of printable time sheets.
$ops = config::get_config_item("timeSheetPrintOptions");
$ops["timeSheetPrintMode=estimate"] = "Estimate";
$ops["timeSheetPrintMode=estimate&printDesc=1"] = "Estimate+";
$id = config::get_config_item_id("timeSheetPrintOptions");
$c = new config();
$c->set_id($id);
$c->select();
$c->set_value("value", serialize($ops));
$c->save();
示例3: preg_replace
<?php
// Change email default From email addresses from Alex Lance <alla@cyber.com.dsa> to alla@cyber.com.dsa
$email = config::get_config_item("AllocFromEmailAddress");
$email = preg_replace("/^.*</", "", $email);
$email = str_replace(">", "", $email);
$configID = config::get_config_item_id("AllocFromEmailAddress");
$c = new config();
$c->set_id($configID);
$c->select();
$c->set_value("value", $email);
$c->save();
示例4: alloc_error
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with allocPSA. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "../alloc.php";
if (!have_entity_perm("config", PERM_UPDATE, $current_user, true)) {
alloc_error("Permission denied.", true);
}
$configName = $_POST["configName"] or $configName = $_GET["configName"];
$TPL["configName"] = $configName;
$configType = $_POST["configType"] or $configType = $_GET["configType"] or $configType = "array";
$TPL["configType"] = $configType;
if ($configName) {
$config = new config();
$id = config::get_config_item_id($configName);
$config->set_id($id);
$config->select();
}
if ($_POST["save"]) {
if ($configType == "people") {
$arr = config::get_config_item($configName);
if (!in_array($_POST['value'], $arr)) {
$arr[] = $_POST["value"];
$config->set_value("value", serialize($arr));
$config->save();
}
} else {
$arr = config::get_config_item($configName);
$arr[$_POST["key"]] = $_POST["value"];
$config->set_value("value", serialize($arr));