本文整理汇总了PHP中featurecode::isEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP featurecode::isEnabled方法的具体用法?PHP featurecode::isEnabled怎么用?PHP featurecode::isEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类featurecode
的用法示例。
在下文中一共展示了featurecode::isEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: varchar
}
}
$sql = "CREATE TABLE IF NOT EXISTS daynight \n (\n\t\t\t\text varchar(10) NOT NULL default '',\n\t\t\t\tdmode varchar(40) NOT NULL default '',\n\t\t\t dest varchar(255) NOT NULL default '',\n\t\t\t\tPRIMARY KEY (ext, dmode, dest)\n\t\t\t );\n\t\t\t ";
$check = $db->query($sql);
if (DB::IsError($check)) {
die_freepbx("Can not create daynight table");
}
// Get the old feature code if it existed to determine
// if it had been changed and if it was enabled
//
$delete_old = false;
$fcc = new featurecode('daynight', 'toggle-mode');
$code = $fcc->getCode();
if ($code != '') {
$delete_old = true;
$enabled = $fcc->isEnabled();
$fcc->delete();
}
unset($fcc);
// If we found the old one then we must create all the new ones
//
if ($delete_old) {
$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");
示例3: 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;
}