示例#1
0
 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   1.6
  */
 protected function getOptions()
 {
     $lang = JFactory::getLanguage();
     $options = array();
     $type = $this->form->getValue('db_type');
     // Some database drivers share DDLs; point these drivers to the correct parent
     if ($type == 'mysqli' || $type == 'pdomysql') {
         $type = 'mysql';
     } elseif ($type == 'sqlsrv') {
         $type = 'sqlazure';
     }
     // Get a list of files in the search path with the given filter.
     $files = JFolder::files(JPATH_INSTALLATION . '/sql/' . $type, '^sample.*\\.sql$');
     $currentLang = $lang->getTag();
     // BOF VIRTUEMART
     defined('DS') or define('DS', DIRECTORY_SEPARATOR);
     if (!class_exists('VmVirtueMart')) {
         require JPATH_INSTALLATION . DS . 'helper' . DS . 'virtuemart.php';
     }
     VmVirtueMart::loadVMLanguage($currentLang);
     $sampleNoneText = JText::_('INSTL_SITE_INSTALL_SAMPLE_NONE') . '<br/><strong>' . JText::_('COM_VIRTUEMART_INSTL_SITE_INSTALL_SAMPLE_NONE') . '</strong>';
     // Add option to not install sample data.
     $options[] = JHtml::_('select.option', '', JHtml::_('tooltip', JText::_('INSTL_SITE_INSTALL_SAMPLE_NONE_DESC'), '', '', $sampleNoneText));
     // EOF VIRTUEMART
     // Build the options list from the list of files.
     if (is_array($files)) {
         foreach ($files as $file) {
             $options[] = JHtml::_('select.option', $file, $lang->hasKey($key = 'INSTL_' . ($file = JFile::stripExt($file)) . '_SET') ? JHtml::_('tooltip', JText::_('INSTL_' . strtoupper($file = JFile::stripExt($file)) . '_SET_DESC'), '', '', JText::_('INSTL_' . ($file = JFile::stripExt($file)) . '_SET')) : $file);
         }
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   1.6
  */
 protected function getOptions()
 {
     $lang = JFactory::getLanguage();
     $options = array();
     $type = $this->form->getValue('db_type');
     // Some database drivers share DDLs; point these drivers to the correct parent
     if ($type == 'mysqli') {
         $type = 'mysql';
     } elseif ($type == 'sqlsrv') {
         $type = 'sqlazure';
     }
     // Get a list of files in the search path with the given filter.
     $files = JFolder::files(JPATH_INSTALLATION . '/sql/' . $type, '^sample.*\\.sql$');
     // Add option to not install sample data.
     $options[] = JHtml::_('select.option', '', JHtml::_('tooltip', JText::_('INSTL_SITE_INSTALL_SAMPLE_NONE_DESC'), '', '', JText::_('INSTL_SITE_INSTALL_SAMPLE_NONE')));
     // Build the options list from the list of files.
     if (is_array($files)) {
         foreach ($files as $file) {
             $options[] = JHtml::_('select.option', $file, $lang->hasKey($key = 'INSTL_' . ($file = JFile::stripExt($file)) . '_SET') ? JHtml::_('tooltip', JText::_('INSTL_' . strtoupper($file = JFile::stripExt($file)) . '_SET_DESC'), '', '', JText::_('INSTL_' . ($file = JFile::stripExt($file)) . '_SET')) : $file);
         }
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
 protected function getOptions()
 {
     $options = array();
     foreach ($this->options as $option) {
         $options[] = JHtml::_('select.option', $option, JText::_('MOD_WOW_RECRUITMENT_PRIO_' . strtoupper($option)));
     }
     return array_merge(parent::getOptions(), $options);
 }
示例#4
0
 protected function getOptions()
 {
     $options = parent::getOptions();
     if ($this->global != 0) {
         array_unshift($options, JHtml::_('select.option', $this->global, JText::_('JGLOBAL')));
     }
     array_unshift($options, JHtml::_('select.option', '1', JText::_('JYES')));
     array_unshift($options, JHtml::_('select.option', '0', JText::_('JNO')));
     return $options;
 }
示例#5
0
 /**
  * Method to get the options to populate list
  *
  * @return  array  The field option objects.
  *
  * @since   3.2
  */
 protected function getOptions()
 {
     // Hash for caching
     $hash = md5($this->element);
     $type = strtolower($this->type);
     if (!isset(static::$options[$type][$hash]) && !empty($this->predefinedOptions)) {
         static::$options[$type][$hash] = parent::getOptions();
         $options = array();
         // Allow to only use specific values of the predefined list
         $filter = isset($this->element['filter']) ? explode(',', $this->element['filter']) : array();
         foreach ($this->predefinedOptions as $value => $text) {
             if (empty($filter) || in_array($value, $filter)) {
                 $text = $this->translate ? JText::_($text) : $text;
                 $options[] = (object) array('value' => $value, 'text' => $text);
             }
         }
         static::$options[$type][$hash] = array_merge(static::$options[$type][$hash], $options);
     }
     return static::$options[$type][$hash];
 }
示例#6
0
 /**
  * Method to get the field options.
  *
  * @return	array	The field option objects.
  *
  * @since	1.6
  */
 protected function getOptions()
 {
     // Initialize variables.
     $lang = JFactory::getLanguage();
     $options = array();
     $type = $this->form instanceof JForm ? $this->form->getValue('db_type') : 'mysql' || 'sqlazure';
     if ($type == 'mysqli') {
         $type = 'mysql';
     } elseif ($type == 'sqlsrv') {
         $type = 'sqlazure';
     }
     // Get a list of files in the search path with the given filter.
     $files = JFolder::files(JPATH_INSTALLATION . '/sql/' . $type, '^sample.*\\.sql$');
     // Build the options list from the list of files.
     if (is_array($files)) {
         foreach ($files as $file) {
             $options[] = JHtml::_('select.option', $file, $lang->hasKey($key = 'INSTL_' . ($file = JFile::stripExt($file)) . '_SET') ? JText::_($key) : $file);
         }
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
示例#7
0
 /**
  * Method to get the field options.
  *
  * @return	array	The field option objects.
  * @since	1.2.0
  */
 public function getOptions()
 {
     $app = JFactory::getApplication();
     // Initialize variables.
     $item = $app->getUserState('com_bwpostman.edit.newsletter.data', null);
     // prepare query
     $_db = JFactory::getDbo();
     // Build the select list for the templates
     $query = $_db->getQuery(true);
     $query->select($_db->quoteName('id') . ' AS ' . $_db->quoteName('value'));
     $query->select($_db->quoteName('title') . ' AS ' . $_db->quoteName('title'));
     $query->select($_db->quoteName('description') . ' AS ' . $_db->quoteName('description'));
     $query->select($_db->quoteName('thumbnail') . ' AS ' . $_db->quoteName('thumbnail'));
     $query->from($_db->quoteName('#__bwpostman_templates'));
     // special for old newsletters with template_id < 1
     if ($item->text_template_id < 1 && !is_null($item->text_template_id)) {
         $query->where($_db->quoteName('id') . ' >= ' . $_db->Quote('-2'));
     } else {
         $query->where($_db->quoteName('id') . ' > ' . $_db->Quote('0'));
     }
     $query->where($_db->quoteName('archive_flag') . ' = ' . $_db->Quote('0'));
     $query->where($_db->quoteName('published') . ' = ' . $_db->Quote('1'));
     $query->where($_db->quoteName('tpl_id') . ' > ' . $_db->Quote('997'));
     $query->order($_db->quoteName('title') . ' ASC');
     $_db->setQuery($query);
     $options = $_db->loadObjectList();
     // Check for a database error.
     if ($_db->getErrorNum()) {
         $app->enqueueMessage($_db->getErrorMsg(), 'error');
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
示例#8
0
 /**
  * Method to get the field options.
  *
  * @return	array	The field option objects.
  * @since	1.0.1
  */
 public function getOptions()
 {
     $app = JFactory::getApplication();
     // Initialize variables.
     $user_id = null;
     $accesslevels = array();
     $subs_id = $app->getUserState('com_bwpostman.edit.subscriber.id', null);
     // prepare query
     $_db = JFactory::getDbo();
     $query = $_db->getQuery(true);
     $query_user = $_db->getQuery(true);
     // get user_ids if exists
     if (is_array($subs_id) && !empty($subs_id)) {
         $query_user->select($_db->quoteName('user_id'));
         $query_user->from($_db->quoteName('#__bwpostman_subscribers'));
         $query_user->where($_db->quoteName('id') . ' = ' . (int) $subs_id[0]);
         $_db->setQuery($query_user);
         $user_id = $_db->loadResult();
     }
     // get authorized viewlevels
     if ($user_id) {
         $accesslevels = JAccess::getAuthorisedViewLevels($user_id);
     }
     $query->select("id AS value, title, description AS text");
     $query->from($_db->quoteName('#__bwpostman_mailinglists'));
     $query->where($_db->quoteName('published') . ' = ' . (int) 1);
     $query->where($_db->quoteName('archive_flag') . ' = ' . (int) 0);
     if (is_array($accesslevels) && !empty($accesslevels)) {
         $query->where($_db->quoteName('access') . ' IN (' . implode(',', $accesslevels) . ')');
     } else {
         $query->where($_db->quoteName('access') . ' = ' . (int) 1);
     }
     $query->order('title ASC');
     $_db->setQuery($query);
     $options = $_db->loadObjectList();
     // Check for a database error.
     if ($_db->getErrorNum()) {
         $app->enqueueMessage($_db->getErrorMsg(), 'error');
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }