本文整理汇总了PHP中ModUtil::getModulesByState方法的典型用法代码示例。如果您正苦于以下问题:PHP ModUtil::getModulesByState方法的具体用法?PHP ModUtil::getModulesByState怎么用?PHP ModUtil::getModulesByState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModUtil
的用法示例。
在下文中一共展示了ModUtil::getModulesByState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSelector_Module
/**
* Return the html for the PNModule selector.
*
* @param string $name The selector name.
* @param integer $selectedValue The currently selected value of the selector (optional) (default=0).
* @param integer $defaultValue The default value of the selector (optional) (default=0).
* @param string $defaultText The text of the default value (optional) (default='').
* @param integer $allValue The value to assign the "All" choice (optional) (default=0).
* @param string $allText The text to display for the "All" choice (optional) (default='').
* @param boolean $submit Whether or not to auto-submit the selector.
* @param boolean $disabled Whether or not to disable selector (optional) (default=false).
* @param integer $multipleSize The size to use for a multiple selector, 1 produces a normal/single selector (optional (default=1).
* @param string $field The field to use for value.
*
* @return The string for the user group selector.
*/
public static function getSelector_Module($name = 'moduleName', $selectedValue = 0, $defaultValue = 0, $defaultText = '', $allValue = 0, $allText = '', $submit = false, $disabled = false, $multipleSize = 1, $field = 'name')
{
$data = array();
$modules = ModUtil::getModulesByState(3, 'displayname');
foreach ($modules as $module) {
$value = $module[$field];
$displayname = $module['displayname'];
$data[$value] = $displayname;
}
return self::getSelector_Generic($name, $data, $selectedValue, $defaultValue, $defaultText, $allValue, $allText, $submit, $disabled, $multipleSize);
}
示例2: getModulesByState
/**
* Return an array of modules in the specified state, only modules in
* the module table are returned which means that new/unscanned modules
* will not be returned
*
* @deprecated
* @see ModUtil::getModulesByState()
*
* @param state The module state (optional) (defaults = active state)
* @param sort The sort to use
*
* @return The resulting module object array
*/
public static function getModulesByState($state=3, $sort='displayname')
{
LogUtil::log(__f('Warning! Function %1$s is deprecated. Please use %2$s instead.', array(__CLASS__ . '#' . __FUNCTION__, 'ModUtil::getModulesByState()')), E_USER_DEPRECATED);
return ModUtil::getModulesByState($state, $sort);
}