当前位置: 首页>>代码示例>>PHP>>正文


PHP featurecode::getDefault方法代码示例

本文整理汇总了PHP中featurecode::getDefault方法的典型用法代码示例。如果您正苦于以下问题:PHP featurecode::getDefault方法的具体用法?PHP featurecode::getDefault怎么用?PHP featurecode::getDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在featurecode的用法示例。


在下文中一共展示了featurecode::getDefault方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: miscapps_get

function miscapps_get($miscapps_id)
{
    global $db;
    $sql = "SELECT miscapps_id, description, ext, dest FROM miscapps WHERE miscapps_id = " . $db->escapeSimple($miscapps_id);
    $row = $db->getRow($sql, DB_FETCHMODE_ASSOC);
    if (DB::IsError($row)) {
        die_freepbx($row->getMessage() . "<br><br>Error selecting row from miscapps");
    }
    // we want to get the ext from featurecodes
    $fc = new featurecode('miscapps', 'miscapp_' . $row['miscapps_id']);
    $row['ext'] = $fc->getDefault();
    $row['enabled'] = $fc->isEnabled();
    return $row;
}
开发者ID:hardikk,项目名称:HNH,代码行数:14,代码来源:functions.inc.php

示例2: 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

示例3: 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

示例4: get

 public function get($miscapps_id)
 {
     $db = $this->db;
     $sql = "SELECT miscapps_id, description, ext, dest FROM miscapps WHERE miscapps_id = ?";
     $q = $db->prepare($sql);
     $q->execute(array($miscapps_id));
     if ($q) {
         $row = $q->getRow();
     }
     // we want to get the ext from featurecodes
     $fc = new featurecode('miscapps', 'miscapp_' . $row['miscapps_id']);
     $row['ext'] = $fc->getDefault();
     $row['enabled'] = $fc->isEnabled();
     return $row;
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:15,代码来源:Miscapps.class.php

示例5: needreload

     } else {
         miscapps_add($description, $ext, $dest);
         needreload();
         redirect_standard();
     }
     break;
     // TODO: need to lookup the current extension based on the id and if it is changing
     //       do a check to make sure it doesn't conflict. If not changing, np.
     //
 // TODO: need to lookup the current extension based on the id and if it is changing
 //       do a check to make sure it doesn't conflict. If not changing, np.
 //
 case 'edit':
     $fc = new featurecode('miscapps', 'miscapp_' . $miscapp_id);
     $conflict_url = array();
     if ($fc->getDefault() != $ext) {
         $usage_arr = framework_check_extension_usage($ext);
         if (!empty($usage_arr)) {
             $conflict_url = framework_display_extension_usage_alert($usage_arr);
         }
     }
     if (empty($conflict_url)) {
         miscapps_edit($miscapp_id, $description, $ext, $dest, $enabled);
         needreload();
         redirect_standard('extdisplay');
     }
     break;
 case 'delete':
     miscapps_delete($miscapp_id);
     needreload();
     redirect_standard();
开发者ID:hardikk,项目名称:HNH,代码行数:31,代码来源:page.miscapps.php


注:本文中的featurecode::getDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。