Пример #1
0
 /**
  * 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
0
 /**
  * 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);
 }