當前位置: 首頁>>代碼示例>>PHP>>正文


PHP config::get_config_item_id方法代碼示例

本文整理匯總了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);
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:31,代碼來源:config.php

示例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();
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:12,代碼來源:patch-00100-alla.php

示例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();
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:12,代碼來源:patch-00069-alla.php

示例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));
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:31,代碼來源:configEdit.php


注:本文中的config::get_config_item_id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。