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


PHP featurecode::setEnabled方法代碼示例

本文整理匯總了PHP中featurecode::setEnabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP featurecode::setEnabled方法的具體用法?PHP featurecode::setEnabled怎麽用?PHP featurecode::setEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在featurecode的用法示例。


在下文中一共展示了featurecode::setEnabled方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: featurecodeadmin_update

function featurecodeadmin_update($req)
{
    foreach ($req as $key => $item) {
        // Split up...
        // 0 - action
        // 1 - modulename
        // 2 - featurename
        $arr = explode("#", $key);
        if (count($arr) == 3) {
            $action = $arr[0];
            $modulename = $arr[1];
            $featurename = $arr[2];
            $fieldvalue = $item;
            // Is there a more efficient way of doing this?
            switch ($action) {
                case "ena":
                    $fcc = new featurecode($modulename, $featurename);
                    if ($fieldvalue == 1) {
                        $fcc->setEnabled(true);
                    } else {
                        $fcc->setEnabled(false);
                    }
                    $fcc->update();
                    break;
                case "custom":
                    $fcc = new featurecode($modulename, $featurename);
                    if ($fieldvalue == $fcc->getDefault()) {
                        $fcc->setCode('');
                        // using default
                    } else {
                        $fcc->setCode($fieldvalue);
                    }
                    $fcc->update();
                    break;
            }
        }
    }
    needreload();
}
開發者ID:umjinsun12,項目名稱:dngshin,代碼行數:39,代碼來源:functions.inc.php

示例2: update

 public function update($codes = array())
 {
     if (!empty($codes)) {
         foreach ($codes as $module => $features) {
             foreach ($features as $name => $data) {
                 $fcc = new \featurecode($module, $name);
                 if (!empty($data['enable'])) {
                     $fcc->setEnabled(true);
                 } else {
                     $fcc->setEnabled(false);
                 }
                 if (empty($data['customize']) || $data['code'] == $fcc->getDefault()) {
                     $fcc->setCode('');
                 } else {
                     $fcc->setCode($data['code']);
                 }
                 $fcc->update();
             }
         }
         needreload();
     }
 }
開發者ID:ringfreejohn,項目名稱:pbxframework,代碼行數:22,代碼來源:Featurecodeadmin.class.php

示例3: miscapps_edit

function miscapps_edit($miscapps_id, $description, $ext, $dest, $enabled = true)
{
    global $db;
    $sql = "UPDATE miscapps SET " . "description = '" . $db->escapeSimple($description) . "', " . "ext = '" . $db->escapeSimple($ext) . "', " . "dest = '" . $db->escapeSimple($dest) . "' " . "WHERE miscapps_id = " . $db->escapeSimple($miscapps_id);
    $result = $db->query($sql);
    if (DB::IsError($result)) {
        die_freepbx($result->getMessage() . $sql);
    }
    $fc = new featurecode('miscapps', 'miscapp_' . $miscapps_id);
    $fc->setDescription($description);
    $fc->setDefault($ext, true);
    $fc->setEnabled($enabled);
    $fc->update();
}
開發者ID:hardikk,項目名稱:HNH,代碼行數:14,代碼來源:functions.inc.php

示例4: foreach

    $list = daynight_list();
    foreach ($list as $item) {
        $id = $item['ext'];
        $fc_description = $item['dest'];
        $fcc = new featurecode('daynight', 'toggle-mode-' . $id);
        if ($fc_description) {
            $fcc->setDescription("{$id}: {$fc_description}");
        } else {
            $fcc->setDescription("{$id}: Day Night Control");
        }
        $fcc->setDefault('*28' . $id);
        if ($code != '*28' && $code != '') {
            $fcc->setCode($code . $id);
        }
        if (!$enabled) {
            $fcc->setEnabled(false);
        }
        $fcc->update();
        unset($fcc);
    }
}
// Sqlite3 does not like this syntax, but no migration needed since it started in 2.5
//
if ($amp_conf["AMPDBENGINE"] != "sqlite3") {
    outn(_("changing primary keys to all fields.."));
    $sql = 'ALTER TABLE `daynight` DROP PRIMARY KEY , ADD PRIMARY KEY ( `ext` , `dmode` , `dest` )';
    $results = $db->query($sql);
    if (DB::IsError($results)) {
        out(_("ERROR: failed to alter primary keys ") . $results->getMessage());
    } else {
        out(_("OK"));
開發者ID:hardikk,項目名稱:HNH,代碼行數:31,代碼來源:install.php

示例5: edit

 public function edit($miscapps_id, $description, $ext, $dest, $enabled = true)
 {
     $db = $this->db;
     $sql = 'UPDATE miscapps SET description = ?, ext = ?, dest = ? WHERE miscapps_id = ?';
     $q = $db->prepare($sql);
     $q->execute(array($description, $ext, $dest, $miscapps_id));
     if ($q) {
         $fc = new \featurecode('miscapps', 'miscapp_' . $miscapps_id);
         $fc->setDescription($description);
         $fc->setDefault($ext, true);
         $fc->setEnabled($enabled);
         $fc->update();
     }
 }
開發者ID:ringfreejohn,項目名稱:pbxframework,代碼行數:14,代碼來源:Miscapps.class.php


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