Exemplo n.º 1
0
 function _before_add()
 {
     $html = new Html();
     $fields_type = $this->_mod->site_model_fields();
     $this->assign('fields_type', $html->select($fields_type, 'formtype'));
     $regexp = $this->_mod->regexp();
     $this->assign('verification_select', $html->select($regexp, 'verification_select', '', 'id="J_verification_select" style="width:100px"'));
 }
Exemplo n.º 2
0
 /**
  * Display the view
  *
  * @return	void
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->authors = $this->get('Authors');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new Exception(implode("\n", $errors), 500);
     }
     // Levels filter.
     $options = array();
     $options[] = Html::select('option', '1', Lang::txt('J1'));
     $options[] = Html::select('option', '2', Lang::txt('J2'));
     $options[] = Html::select('option', '3', Lang::txt('J3'));
     $options[] = Html::select('option', '4', Lang::txt('J4'));
     $options[] = Html::select('option', '5', Lang::txt('J5'));
     $options[] = Html::select('option', '6', Lang::txt('J6'));
     $options[] = Html::select('option', '7', Lang::txt('J7'));
     $options[] = Html::select('option', '8', Lang::txt('J8'));
     $options[] = Html::select('option', '9', Lang::txt('J9'));
     $options[] = Html::select('option', '10', Lang::txt('J10'));
     $this->f_levels = $options;
     // We don't need toolbar in the modal window.
     if ($this->getLayout() !== 'modal') {
         $this->addToolbar();
     }
     parent::display($tpl);
 }
function reportAjaxCategorytoType_ALL(Web $w)
{
    $type = array();
    list($category, $module) = preg_split('/_/', $w->request('id'));
    // organise criteria
    $who = $w->session('user_id');
    $where = array();
    if (!empty($module)) {
        $where['report.module'] = $module;
    }
    if (!empty($category)) {
        $where['report.category'] = $category;
    }
    // get report categories from available report list
    $reports = $w->Report->getReportsbyUserWhere($who, $where);
    if ($reports) {
        foreach ($reports as $report) {
            $arrtype = preg_split("/,/", $report->sqltype);
            foreach ($arrtype as $rtype) {
                $rtype = trim($rtype);
                if (!array_key_exists(strtolower($rtype), $type)) {
                    $type[strtolower($rtype)] = array(strtolower($rtype), strtolower($rtype));
                }
            }
        }
    }
    if (empty($type)) {
        $type = array(array("No Reports", ""));
    }
    $w->setLayout(null);
    $w->out(json_encode(Html::select("type", $type)));
}
Exemplo n.º 4
0
function lookup_ALL(Web &$w)
{
    $w->Admin->navigation($w, "Lookup");
    $types = $w->Admin->getLookupTypes();
    $typelist = Html::select("type", $types, $w->request('type'));
    $w->ctx("typelist", $typelist);
    // tab: Lookup List
    $where = array();
    if (NULL == $w->request('reset')) {
        if ($w->request('type') != "") {
            $where['type'] = $w->request('type');
        }
    } else {
        // Reset called, unset vars
        if ($w->request("type") !== null) {
            unset($_REQUEST["type"]);
        }
        var_dump($_REQUEST);
    }
    $lookup = $w->Admin->getAllLookup($where);
    $line[] = array("Type", "Code", "Title", "Actions");
    if ($lookup) {
        foreach ($lookup as $look) {
            $line[] = array($look->type, $look->code, $look->title, Html::box($w->localUrl("/admin/editlookup/" . $look->id . "/" . urlencode($w->request('type'))), " Edit ", true) . "   " . Html::b($w->webroot() . "/admin/deletelookup/" . $look->id . "/" . urlencode($w->request('type')), " Delete ", "Are you sure you wish to DELETE this Lookup item?"));
        }
    } else {
        $line[] = array("No Lookup items to list", null, null, null);
    }
    // display list of items, if any
    $w->ctx("listitem", Html::table($line, null, "tablesorter", true));
    // tab: new lookup item
    $types = $w->Admin->getLookupTypes();
    $f = Html::form(array(array("Create a New Entry", "section"), array("Type", "select", "type", null, $types), array("or Add New Type", "text", "ntype"), array("Key", "text", "code"), array("Value", "text", "title")), $w->localUrl("/admin/newlookup/"), "POST", " Save ");
    $w->ctx("newitem", $f);
}
Exemplo n.º 5
0
 public function fetchElement($name, $value, &$node, $control_name)
 {
     require_once dirname(__DIR__) . DS . 'models' . DS . 'poll.php';
     $options = \Components\Poll\Models\Poll::all()->whereEquals('published', 1)->rows()->raw();
     array_unshift($options, \Html::select('option', '0', '- ' . \Lang::txt('Select Poll') . ' -', 'id', 'title'));
     return \Html::select('genericlist', $options, $control_name . '[' . $name . ']', 'class="inputbox"', 'id', 'title', $value, $control_name . $name);
 }
function taskAjaxSelectbyTaskGroup_ALL(Web $w)
{
    $p = $w->pathMatch("taskgroup_id");
    $taskgroup = $w->Task->getTaskGroup($p['taskgroup_id']);
    if (empty($taskgroup->id)) {
        return;
    }
    $tasktypes = $taskgroup != "" ? $w->Task->getTaskTypes($taskgroup->task_group_type) : array();
    $priority = $taskgroup != "" ? $w->Task->getTaskPriority($taskgroup->task_group_type) : array();
    $members = $taskgroup != "" ? $w->Task->getMembersBeAssigned($taskgroup->id) : array();
    sort($members);
    $typetitle = $taskgroup != "" ? $taskgroup->getTypeTitle() : "";
    $typedesc = $taskgroup != "" ? $taskgroup->getTypeDescription() : "";
    // if user cannot assign tasks in this group, leave 'first_assignee' blank for owner/member to delegate
    $members = $taskgroup->getCanIAssign() ? $members : array(array("Default", ""));
    // create dropdowns loaded with respective data
    $ttype = Html::select("task_type", $tasktypes, null);
    $prior = Html::select("priority", $priority, null);
    $mem = Html::select("assignee_id", $members, null);
    // first_
    $taskgroup_link = $taskgroup->isOwner($w->Auth->user()) ? "<a href=\"" . $w->localUrl("task-group/viewmembergroup/" . $taskgroup->id) . "\">" . $taskgroup->title . "</a>" : $taskgroup->title;
    $tasktext = "<table style='width: 100%;'>" . "<tr><td class=section colspan=2>Task Group Description</td></tr>" . "<tr><td><b>Task Group</td><td>" . $taskgroup_link . "</td></tr>" . "<tr><td><b>Task Type</b></td><td>" . $typetitle . "</td></tr>" . "<tr valign=top><td><b>Description</b></td><td>" . $typedesc . "</td></tr>" . "</table>";
    // return as array of arrays
    $result = array($ttype, $prior, $mem, $tasktext, Html::select("status", $taskgroup->getTypeStatus(), null, null, null, null));
    $w->setLayout(null);
    $w->out(json_encode($result));
}
Exemplo n.º 7
0
function taskAjaxGrouptoType_ALL(Web &$w)
{
    $types = array();
    // split query string into group and assignee
    list($group, $assignee) = preg_split('/_/', $w->request('id'));
    // organise criteria
    $who = $assignee != "" ? $assignee : null;
    $where = "";
    if ($group != "") {
        $where .= "task_group_id = " . $group . " and ";
    }
    $where .= "is_closed = 0";
    // get task types from available task list
    $tasks = $w->Task->getTasks($who, $where);
    if ($tasks) {
        foreach ($tasks as $task) {
            if (!array_key_exists($task->task_type, $types)) {
                $types[$task->task_type] = array($task->getTypeTitle(), $task->task_type);
            }
        }
    }
    if (!$types) {
        $types = array(array("No assigned Tasks", ""));
    }
    // load type dropdown and return
    $tasktypes = Html::select("tasktypes", $types, null);
    $w->setLayout(null);
    $w->out(json_encode($tasktypes));
}
Exemplo n.º 8
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $state = $this->get('State');
     $items = $this->get('Items');
     $pagination = $this->get('Pagination');
     // Get the page/component configuration
     $params =& $state->params;
     foreach ($items as $item) {
         $item->catslug = $item->category_alias ? $item->catid . ':' . $item->category_alias : $item->catid;
         $item->parent_slug = $item->parent_alias ? $item->parent_id . ':' . $item->parent_alias : $item->parent_id;
     }
     $form = new stdClass();
     // Month Field
     $months = array('' => Lang::txt('COM_CONTENT_MONTH'), '01' => Lang::txt('JANUARY_SHORT'), '02' => Lang::txt('FEBRUARY_SHORT'), '03' => Lang::txt('MARCH_SHORT'), '04' => Lang::txt('APRIL_SHORT'), '05' => Lang::txt('MAY_SHORT'), '06' => Lang::txt('JUNE_SHORT'), '07' => Lang::txt('JULY_SHORT'), '08' => Lang::txt('AUGUST_SHORT'), '09' => Lang::txt('SEPTEMBER_SHORT'), '10' => Lang::txt('OCTOBER_SHORT'), '11' => Lang::txt('NOVEMBER_SHORT'), '12' => Lang::txt('DECEMBER_SHORT'));
     $form->monthField = Html::select('genericlist', $months, 'month', array('list.attr' => 'size="1" class="inputbox"', 'list.select' => $state->get('filter.month'), 'option.key' => null));
     // Year Field
     $years = array();
     $years[] = Html::select('option', null, Lang::txt('JYEAR'));
     for ($i = 2000; $i <= 2020; $i++) {
         $years[] = Html::select('option', $i, $i);
     }
     $form->yearField = Html::select('genericlist', $years, 'year', array('list.attr' => 'size="1" class="inputbox"', 'list.select' => $state->get('filter.year')));
     $form->limitField = $pagination->getLimitBox();
     //Escape strings for HTML output
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     $this->filter = $state->get('list.filter');
     $this->assignRef('form', $form);
     $this->assignRef('items', $items);
     $this->assignRef('params', $params);
     $this->assignRef('user', User::getInstance());
     $this->assignRef('pagination', $pagination);
     $this->_prepareDocument();
     parent::display($tpl);
 }
Exemplo n.º 9
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $access = JFactory::getACL();
     // Include user in groups that have access to edit their articles, other articles, or manage content.
     $action = array('com_content.article.edit_own', 'com_content.article.edit_article', 'com_content.manage');
     $groups = $access->getAuthorisedUsergroups($action, true);
     // Check the results of the access check.
     if (!$groups) {
         return false;
     }
     // Clean up and serialize.
     \Hubzero\Utility\Arr::toInteger($groups);
     $groups = implode(',', $groups);
     // Build the query to get the users.
     $db = App::get('db');
     $query = $db->getQuery(true);
     $query->select('u.id AS value');
     $query->select('u.name AS text');
     $query->from('#__users AS u');
     $query->join('INNER', '#__user_usergroup_map AS m ON m.user_id = u.id');
     $query->where('u.block = 0');
     $query->where('m.group_id IN (' . $groups . ')');
     // Get the users.
     $db->setQuery((string) $query);
     $users = $db->loadObjectList();
     // Check for a database error.
     if ($db->getErrorNum()) {
         throw new Exception($db->getErrorMsg(), 500);
         return false;
     }
     return Html::select('genericlist', $users, $name, 'class="inputbox" size="1"', 'value', 'text', $value);
 }
function reportAjaxModuletoCategory_ALL(Web $w)
{
    $category = array();
    $module = $w->request('id');
    // organise criteria
    $who = $w->session('user_id');
    $where = array();
    if ($module != "") {
        $where['report.module'] = $module;
    }
    // get report categories from available report list
    $reports = $w->Report->getReportsbyUserWhere($who, $where);
    if ($reports) {
        foreach ($reports as $report) {
            if (!array_key_exists($report->category, $category)) {
                $category[$report->category] = array($report->getCategoryTitle(), $report->category);
            }
        }
    }
    if (!$category) {
        $category = array(array("No Reports", ""));
    }
    // load Category dropdown and return
    $category = Html::select("category", $category);
    $w->setLayout(null);
    $w->out(json_encode($category));
}
Exemplo n.º 11
0
 /**
  * Image Manager Popup
  *
  * @param string $listFolder The image directory to display
  * @since 1.5
  */
 function getFolderList($base = null)
 {
     // Get some paths from the request
     if (empty($base)) {
         $base = COM_MEDIA_BASE;
     }
     //corrections for windows paths
     $base = str_replace(DIRECTORY_SEPARATOR, '/', $base);
     $com_media_base_uni = str_replace(DIRECTORY_SEPARATOR, '/', COM_MEDIA_BASE);
     // Get the list of folders
     $folders = Filesystem::directories($base, '.', true, true);
     Document::setTitle(Lang::txt('COM_MEDIA_INSERT_IMAGE'));
     // Build the array of select options for the folder list
     $options[] = Html::select('option', "", "/");
     foreach ($folders as $folder) {
         $folder = str_replace($com_media_base_uni, "", str_replace(DIRECTORY_SEPARATOR, '/', $folder));
         $value = substr($folder, 1);
         $text = str_replace(DIRECTORY_SEPARATOR, "/", $folder);
         $options[] = Html::select('option', $value, $text);
     }
     // Sort the folder list array
     if (is_array($options)) {
         sort($options);
     }
     // Get asset and author id (use integer filter)
     $asset = Request::getInt('asset', 0);
     $author = Request::get('author', 0);
     // Create the drop-down folder select list
     $list = Html::select('genericlist', $options, 'folderlist', 'class="inputbox" size="1" onchange="ImageManager.setFolder(this.options[this.selectedIndex].value, ' . $asset . ', ' . $author . ')" ', 'value', 'text', $base);
     return $list;
 }
Exemplo n.º 12
0
function taskAjaxPrioritytoStatus_ALL(Web &$w)
{
    $status = array();
    // split query string into proirity, type, group and assignee
    list($priority, $type, $group, $assignee) = preg_split('/_/', $w->request('id'));
    // organise criteria
    $who = $assignee != "" ? $assignee : null;
    $where = "";
    if ($group != "") {
        $where .= "task_group_id = " . $group . " and ";
    }
    if ($type != "") {
        $where .= "task_type = '" . $type . "' and ";
    }
    if ($priority != "") {
        $where .= "priority = '" . $priority . "' and ";
    }
    $where .= "is_closed = 0";
    // get statuses from available tasks
    $tasks = $w->Task->getTasks($who, $where);
    if ($tasks) {
        foreach ($tasks as $task) {
            if (!array_key_exists($task->status, $status)) {
                $status[$task->status] = array($task->status, $task->status);
            }
        }
    }
    if (!$status) {
        $status = array(array("No assigned Tasks", ""));
    }
    // load status dropdown and return
    $status = Html::select("status", $status, null);
    $w->setLayout(null);
    $w->out(json_encode($status));
}
Exemplo n.º 13
0
function taskAjaxTypetoPriority_ALL(Web &$w)
{
    $priority = array();
    // split the query string into type, group and assignee
    list($type, $group, $assignee) = preg_split('/_/', $w->request('id'));
    // organise criteria
    $who = $assignee != "" ? $assignee : null;
    $where = "";
    if ($group != "") {
        $where .= "task_group_id = " . $group . " and ";
    }
    if ($type != "") {
        $where .= "task_type = '" . $type . "' and ";
    }
    $where .= "is_closed = 0";
    // get priorities from available task list
    $tasks = $w->Task->getTasks($who, $where);
    if ($tasks) {
        foreach ($tasks as $task) {
            if (!array_key_exists($task->priority, $priority)) {
                $priority[$task->priority] = array($task->priority, $task->priority);
            }
        }
    }
    if (!$priority) {
        $priority = array(array("No assigned Tasks", ""));
    }
    // load priority dropdown and return
    $priority = Html::select("tpriority", $priority, null);
    $w->setLayout(null);
    $w->out(json_encode($priority));
}
Exemplo n.º 14
0
 /**
  * Display a batch widget for the module position selector.
  *
  * @param   integer  $clientId  The client ID
  *
  * @return  string  The necessary HTML for the widget.
  *
  * @since   2.5
  */
 public static function positions($clientId)
 {
     // Create the copy/move options.
     $options = array(Html::select('option', 'c', Lang::txt('JLIB_HTML_BATCH_COPY')), Html::select('option', 'm', Lang::txt('JLIB_HTML_BATCH_MOVE')));
     // Create the batch selector to change select the category by which to move or copy.
     $lines = array('<label id="batch-choose-action-lbl" for="batch-choose-action">', Lang::txt('COM_MODULES_BATCH_POSITION_LABEL'), '</label>', '<fieldset id="batch-choose-action" class="combo">', '<select name="batch[position_id]" class="inputbox" id="batch-position-id">', '<option value="">' . Lang::txt('JSELECT') . '</option>', '<option value="nochange">' . Lang::txt('COM_MODULES_BATCH_POSITION_NOCHANGE') . '</option>', '<option value="noposition">' . Lang::txt('COM_MODULES_BATCH_POSITION_NOPOSITION') . '</option>', Html::select('options', self::positionList($clientId)), '</select>', Html::select('radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm'), '</fieldset>');
     return implode("\n", $lines);
 }
Exemplo n.º 15
0
 /**
  * Get a list of filter options for the application clients.
  *
  * @return	array	An array of JHtmlOption elements.
  */
 public static function getClientOptions()
 {
     // Build the filter options.
     $options = array();
     $options[] = Html::select('option', '0', Lang::txt('JSITE'));
     $options[] = Html::select('option', '1', Lang::txt('JADMINISTRATOR'));
     return $options;
 }
Exemplo n.º 16
0
 /**
  * Method to get the field options for category
  *
  * @return  array
  */
 protected function getOptions()
 {
     $options = [];
     $options[] = Html::select('option', '', Lang::txt('Site default'));
     foreach (Plugin::byType('mail') as $plugin) {
         $options[] = Html::select('option', $plugin->name, ucfirst($plugin->name));
     }
     return $options;
 }
Exemplo n.º 17
0
 /**
  * Display an HTML select list of state filters
  *
  * @param	int $selected	The selected value of the list
  * @return	string			The HTML code for the select tag
  * @since	1.6
  */
 public static function filterstate($selected)
 {
     // Build the active state filter options.
     $options = array();
     $options[] = Html::select('option', '*', Lang::txt('JOPTION_ANY'));
     $options[] = Html::select('option', '1', Lang::txt('JPUBLISHED'));
     $options[] = Html::select('option', '0', Lang::txt('JUNPUBLISHED'));
     return Html::select('genericlist', $options, 'filter_published', array('list.attr' => 'class="inputbox" onchange="this.form.submit();"', 'list.select' => $selected));
 }
Exemplo n.º 18
0
 public function fetchElement($name, $value, &$node, $control_name)
 {
     $db = \App::get('db');
     $query = 'SELECT a.id, a.title' . ' FROM #__polls AS a' . ' WHERE a.published = 1' . ' ORDER BY a.title';
     $db->setQuery($query);
     $options = $db->loadObjectList();
     array_unshift($options, \Html::select('option', '0', '- ' . \Lang::txt('Select Poll') . ' -', 'id', 'title'));
     return \Html::select('genericlist', $options, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'id', 'title', $value, $control_name . $name);
 }
Exemplo n.º 19
0
 /**
  * Get a list of filter options for the state of a module.
  *
  * @return	array	An array of JHtmlOption elements.
  */
 static function getStateOptions()
 {
     // Build the filter options.
     $options = array();
     $options[] = Html::select('option', '1', Lang::txt('COM_MESSAGES_OPTION_READ'));
     $options[] = Html::select('option', '0', Lang::txt('COM_MESSAGES_OPTION_UNREAD'));
     $options[] = Html::select('option', '-2', Lang::txt('JTRASHED'));
     return $options;
 }
Exemplo n.º 20
0
 /**
  * Returns an array of published state filter options.
  *
  * @return	string			The HTML code for the select tag
  * @since	1.6
  */
 public static function publishedOptions()
 {
     // Build the active state filter options.
     $options = array();
     $options[] = Html::select('option', '1', 'JPUBLISHED');
     $options[] = Html::select('option', '0', 'JUNPUBLISHED');
     $options[] = Html::select('option', '-2', 'JTRASHED');
     $options[] = Html::select('option', '*', 'JALL');
     return $options;
 }
Exemplo n.º 21
0
 /**
  * Returns an array of standard published state filter options.
  *
  * @return  string  The HTML code for the select tag
  */
 public static function publishedOptions()
 {
     // Build the active state filter options.
     $options = array();
     $options[] = \Html::select('option', '*', 'JALL');
     $options[] = \Html::select('option', '1', 'JENABLED');
     $options[] = \Html::select('option', '0', 'JDISABLED');
     $options[] = \Html::select('option', '2', 'JARCHIVED');
     $options[] = \Html::select('option', '-2', 'JTRASHED');
     return $options;
 }
Exemplo n.º 22
0
 /**
  * Method to get the field input.
  *
  * @return	string		The field input.
  * @since	1.6
  */
 protected function getInput()
 {
     $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     $options = array();
     foreach ($this->element->children() as $option) {
         $options[] = Html::select('option', $option->attributes('value'), Lang::txt(trim($option->data())));
     }
     $options[] = Html::select('option', '0', Lang::txt('JSITE'));
     $options[] = Html::select('option', '1', Lang::txt('JADMINISTRATOR'));
     $return = Html::select('genericlist', $options, $this->name, $onchange, 'value', 'text', $this->value, $this->id);
     return $return;
 }
Exemplo n.º 23
0
 public function fetchElement($name, $value, &$node, $control_name)
 {
     $db = App::get('db');
     $query = 'SELECT a.id, c.title, a.name' . ' FROM #__newsfeeds AS a' . ' INNER JOIN #__categories AS c ON a.catid = c.id' . ' WHERE a.published = 1' . ' AND c.published = 1' . ' ORDER BY a.catid, a.name';
     $db->setQuery($query);
     $options = $db->loadObjectList();
     $n = count($options);
     for ($i = 0; $i < $n; $i++) {
         $options[$i]->text = $options[$i]->title . '-' . $options[$i]->name;
     }
     array_unshift($options, Html::select('option', '0', '- ' . Lang::txt('COM_NEWSFEEDS_SELECT_FEED') . ' -', 'id', 'text'));
     return Html::select('genericlist', $options, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'id', 'text', $value, $control_name . $name);
 }
 /**
  * Method to get the field options for category
  * Use the extension attribute in a form to specify the.specific extension for
  * which categories should be displayed.
  * Use the show_root attribute to specify whether to show the global category root in the list.
  *
  * @return  array    The field option objects.
  */
 protected function getOptions()
 {
     $options = array();
     $options[] = Html::select('option', '0', Lang::txt('All'));
     include_once PATH_CORE . DS . 'components' . DS . 'com_publications' . DS . 'tables' . DS . 'category.php';
     $db = App::get('db');
     $sr = new \Components\Publications\Tables\Category($db);
     $types = $sr->getCategories();
     foreach ($types as $anode) {
         $options[] = Html::select('option', $anode->id, stripslashes($anode->name));
     }
     return $options;
 }
Exemplo n.º 25
0
 /**
  * Method to get the field options for category
  * Use the extension attribute in a form to specify the.specific extension for
  * which categories should be displayed.
  * Use the show_root attribute to specify whether to show the global category root in the list.
  *
  * @return  array    The field option objects.
  */
 protected function getOptions()
 {
     $options = array();
     $options[] = Html::select('option', '0', Lang::txt('All'));
     include_once PATH_CORE . DS . 'components' . DS . 'com_resources' . DS . 'tables' . DS . 'type.php';
     $db = App::get('db');
     $sr = new \Components\Resources\Tables\Type($db);
     $types = $sr->getMajorTypes();
     foreach ($types as $anode) {
         $options[] = Html::select('option', $anode->id, stripslashes($anode->type));
     }
     return $options;
 }
Exemplo n.º 26
0
 /**
  * Return any options this element may have
  *
  * @param   string  $name          Name of the field
  * @param   string  $value         Value to check against
  * @param   object  $element       Data Source Object.
  * @param   string  $control_name  Control name (eg, control[fieldname])
  * @return  string  HTML
  */
 public function fetchElement($name, $value, &$element, $control_name)
 {
     $class = isset($element->class) ? 'class="' . $element->class . '"' : 'class="inputbox"';
     $options = array();
     if (!$element->required) {
         $options[] = \Html::select('option', '', Lang::txt('COM_RESOURCES_SELECT'));
     }
     foreach ($element->options as $option) {
         $val = $option->value;
         $text = $option->label;
         $options[] = \Html::select('option', $val, $text);
     }
     return '<span class="field-wrap">' . \Html::select('genericlist', $options, $control_name . '[' . $name . ']', $class, 'value', 'text', $value, $control_name . '-' . $name) . '</span>';
 }
Exemplo n.º 27
0
 /**
  * Return any options this element may have
  *
  * @param   string  $name          Name of the field
  * @param   string  $value         Value to check against
  * @param   object  $element       Data Source Object.
  * @param   string  $control_name  Control name (eg, control[fieldname])
  * @return  string  HTML
  */
 public function fetchElement($name, $value, &$element, $control_name)
 {
     if (!$value) {
         jimport('joomla.language.helper');
         $language = \JLanguageHelper::detectLanguage();
         $language = explode('-', $language);
         $value = $language[0];
     }
     $languages = array();
     foreach ($this->_codes as $code => $lang) {
         $languages[] = \Html::select('option', $code, $lang);
     }
     array_unshift($languages, \Html::select('option', '', '- ' . Lang::txt('Select Language') . ' -'));
     return '<span class="field-wrap">' . \Html::select('genericlist', $languages, $control_name . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value, $control_name . '-' . $name) . '</span>';
 }
Exemplo n.º 28
0
 /**
  * Method to get the field input.
  *
  * @return	string		The field input.
  * @since	1.6
  */
 protected function getInput()
 {
     $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     $options = array();
     foreach ($this->element->children() as $option) {
         $options[] = Html::select('option', $option->attributes('value'), Lang::txt(trim((string) $option)));
     }
     $db = App::get('db');
     $query = $db->getQuery(true);
     $query->select('type')->from('#__extensions');
     $db->setQuery($query);
     $types = array_unique($db->loadColumn());
     foreach ($types as $type) {
         $options[] = Html::select('option', $type, Lang::txt('COM_INSTALLER_TYPE_' . strtoupper($type)));
     }
     $return = Html::select('genericlist', $options, $this->name, $onchange, 'value', 'text', $this->value, $this->id);
     return $return;
 }
Exemplo n.º 29
0
 /**
  * Method to get the field input.
  *
  * @return	string		The field input.
  * @since	1.6
  */
 protected function getInput()
 {
     $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     $options = array();
     foreach ($this->element->children() as $option) {
         $options[] = Html::select('option', (string) $option->attributes()->value, Lang::txt(trim((string) $option)));
     }
     $dbo = App::get('db');
     $query = $dbo->getQuery(true);
     $query->select('DISTINCT folder');
     $query->from('#__extensions');
     $query->where('folder != ' . $dbo->quote(''));
     $query->order('folder');
     $dbo->setQuery((string) $query);
     $folders = $dbo->loadColumn();
     foreach ($folders as $folder) {
         $options[] = Html::select('option', $folder, $folder);
     }
     $return = Html::select('genericlist', $options, $this->name, $onchange, 'value', 'text', $this->value, $this->id);
     return $return;
 }
Exemplo n.º 30
0
function reportAjaxListModules_ALL(Web $w)
{
    $modules = array();
    // organise criteria
    $who = $w->session('user_id');
    $where = "";
    // get report categories from available report list
    $reports = $w->Report->getReportsbyUserWhere($who, $where);
    if ($reports) {
        foreach ($reports as $report) {
            if (!array_key_exists($report->module, $modules)) {
                $modules[$report->module] = array(ucfirst($report->module), $report->module);
            }
        }
    }
    if (!$modules) {
        $modules = array(array("No Reports", ""));
    }
    // load Module dropdown and return
    $modules = Html::select("module", $modules);
    $w->setLayout(null);
    $w->out(json_encode($modules));
}