本文整理汇总了PHP中cms_utils::module_available方法的典型用法代码示例。如果您正苦于以下问题:PHP cms_utils::module_available方法的具体用法?PHP cms_utils::module_available怎么用?PHP cms_utils::module_available使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cms_utils
的用法示例。
在下文中一共展示了cms_utils::module_available方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_cms_function_module_available
function smarty_cms_function_module_available($params, &$template)
{
$smarty = $template->smarty;
$name = '';
if (isset($params['name'])) {
$name = trim($params['name']);
}
if (isset($params['m'])) {
$name = trim($params['m']);
}
if (isset($params['module'])) {
$name = trim($params['module']);
}
$out = FALSE;
if ($name) {
$out = cms_utils::module_available($name);
}
if (isset($params['assign'])) {
$smarty->assign(trim($params['assign']), $out);
return;
}
return $out;
}
示例2: ListEvents
/**
* Get a list of all of the known events
*
* @return mixed If successful, a list of all the known events. If it fails, false
*/
public static function ListEvents()
{
$gCms = cmsms();
$db = $gCms->GetDb();
//$q = "SELECT * FROM ".cms_db_prefix()."events ORDER BY originator,event_name";
$q = 'SELECT e.*, count(eh.event_id) as usage_count FROM ' . cms_db_prefix() . 'events e left outer join ' . cms_db_prefix() . 'event_handlers eh on e.event_id=eh.event_id GROUP BY e.event_id ORDER BY originator,event_name';
$dbresult = $db->Execute($q);
if ($dbresult == false) {
return false;
}
$result = array();
while ($row = $dbresult->FetchRow()) {
if (!cms_utils::module_available($row['originator']) && $row['originator'] !== 'Core') {
continue;
}
$result[] = $row;
}
return $result;
}