function edit() { $country_id = JRequest::getInt("country_id"); $countries = $this->getModel("countries"); $country = JTable::getInstance('country', 'jshop'); $country->load($country_id); $first[] = JHTML::_('select.option', '0', _JSHOP_ORDERING_FIRST, 'ordering', 'name'); $rows = array_merge($first, $countries->getAllCountries(0)); $lists['order_countries'] = JHTML::_('select.genericlist', $rows, 'ordering', 'class="inputbox" size="1"', 'ordering', 'name', $country->ordering); $_lang = $this->getModel("languages"); $languages = $_lang->getAllLanguages(1); $multilang = count($languages) > 1; $edit = $country_id ? $edit = 1 : ($edit = 0); JFilterOutput::objectHTMLSafe($country, ENT_QUOTES); $view = $this->getView("countries", 'html'); $view->setLayout("edit"); $view->assign('country', $country); $view->assign('lists', $lists); $view->assign('edit', $edit); $view->assign('languages', $languages); $view->assign('etemplatevar', ''); $view->assign('multilang', $multilang); JPluginHelper::importPlugin('jshoppingadmin'); $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onBeforeEditCountries', array(&$view)); $view->displayEdit(); }
public static function fetchHead($params, $module) { $document = JFactory::getDocument(); $mainframe = JFactory::getApplication(); $template = $mainframe->getTemplate(); JHTML::_('behavior.framework'); $language = JFactory::getLanguage(); $mapApi = 'http://maps.google.com/maps/api/js?sensor=true&language=' . $language->getTag(); if ($params->get('weather')) { $mapApi .= '&libraries=weather'; } $document->addScript($mapApi); if (file_exists(JPATH_BASE . '/templates/' . $template . '/html/mod_bt_googlemaps/js/default.js')) { $document->addScript(JURI::root() . 'templates/' . $template . '/html/mod_bt_googlemaps/js/default.js'); } else { $document->addScript(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/js/btbase64.min.js'); if ($params->get('enable-custom-infobox')) { $document->addScript(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/js/infobox.js'); } $document->addScript(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/js/default.js'); } if (file_exists(JPATH_BASE . '/templates/' . $template . '/html/mod_bt_googlemaps/css/styles.css')) { $document->addStyleSheet(JURI::root() . 'templates/' . $template . '/html/mod_bt_googlemaps/css/style.css'); } else { $document->addStyleSheet(JURI::root() . 'modules/mod_bt_googlemaps/tmpl/css/style.css'); } }
/** * Get the header * * @return string The header HTML */ protected function getHeader() { $sortable = $this->element['sortable'] != 'false'; $view = $this->form->getView(); $model = $this->form->getModel(); $hasAjaxOrderingSupport = $view->hasAjaxOrderingSupport(); if (!$sortable) { // Non sortable?! I'm not sure why you'd want that, but if you insist... return JText::_('JGRID_HEADING_ORDERING'); } if (!$hasAjaxOrderingSupport) { // Ye olde Joomla! 2.5 method $html = JHTML::_('grid.sort', 'JFIELD_ORDERING_LABEL', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, 'browse'); $html .= JHTML::_('grid.order', $model->getList()); return $html; } else { // The new, drag'n'drop ordering support WITH a save order button $html = JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, null, 'asc', 'JGRID_HEADING_ORDERING'); $ordering = $view->getLists()->order == 'ordering'; if ($ordering) { $html .= '<a href="javascript:saveorder(' . (count($model->getList()) - 1) . ', \'saveorder\')" ' . 'rel="tooltip" class="save-order btn btn-micro pull-right" title="' . JText::_('JLIB_HTML_SAVE_ORDER') . '">' . '<span class="icon-ok"></span></a>'; } return $html; } }
/** * Image Manager Popup * * @param string $listFolder The image directory to display * @since 1.5 */ function getFolderList($base = null) { global $mainframe; // Get some paths from the request if (empty($base)) { $base = JA_WORKING_DATA_FOLDER; } // Get the list of folders jimport('joomla.filesystem.folder'); $folders = JFolder::folders($base, '.', 4, true); // Load appropriate language files $lang =& JFactory::getLanguage(); $lang->load(JRequest::getCmd('option'), JPATH_ADMINISTRATOR); $document =& JFactory::getDocument(); $document->setTitle(JText::_('Insert Image')); // Build the array of select options for the folder list $options[] = JHTML::_('select.option', "", "/"); foreach ($folders as $folder) { $folder = str_replace(JA_WORKING_DATA_FOLDER, "", $folder); $value = substr($folder, 1); $text = str_replace(DS, "/", $folder); $options[] = JHTML::_('select.option', $value, $text); } // Sort the folder list array if (is_array($options)) { sort($options); } // Create the drop-down folder select list $list = JHTML::_('select.genericlist', $options, 'folderlist', "class=\"inputbox\" size=\"1\" onchange=\"ImageManager.setFolder(this.options[this.selectedIndex].value)\" ", 'value', 'text', $base); return $list; }
function fetchButton($type = 'Acyactions') { $url = JURI::base() . "index.php?option=com_acymailing&ctrl=filter&tmpl=component"; $top = 0; $left = 0; $width = 700; $height = 500; $text = JText::_('ACTIONS'); if (!ACYMAILING_J30) { $class = "icon-32-acyaction"; } else { $class = "icon-14-acyaction"; } $js = "\r\nfunction getAcyActionUrl() {\r\n\ti = 0;\r\n\tmylink = 'index.php?option=com_acymailing&ctrl=filter&tmpl=component&subid=';\r\n\twhile(window.document.getElementById('cb'+i)){\r\n\t\tif(window.document.getElementById('cb'+i).checked)\r\n\t\t\tmylink += window.document.getElementById('cb'+i).value+',';\r\n\t\ti++;\r\n\t}\r\n\treturn mylink;\r\n}\r\n"; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); if (!ACYMAILING_J30) { JHTML::_('behavior.modal', 'a.modal'); return '<a href="' . $url . '" class="modal" onclick="this.href=getAcyActionUrl();" rel="{handler: \'iframe\', size: {x: ' . $width . ', y: ' . $height . '}}"><span class="' . $class . '" title="' . $text . '"></span>' . $text . '</a>'; } $html = '<button class="btn btn-small modal" data-toggle="modal" data-target="#modal-' . $type . '"><i class="' . $class . '"></i> ' . $text . '</button>'; $params['title'] = $text; $params['url'] = '\'+getAcyActionUrl()+\''; //$url; $params['height'] = $height; $params['width'] = $width; $modalHtml = JHtml::_('bootstrap.renderModal', 'modal-' . $type, $params); $html .= str_replace(array('id="modal-' . $type . '"'), array('id="modal-' . $type . '" style="width:' . ($width + 20) . 'px;height:' . ($height + 90) . 'px;margin-left:-' . ($width + 20) / 2 . 'px"'), $modalHtml); $html .= '<script>' . "\r\n" . 'jQuery(document).ready(function(){jQuery("#modal-' . $type . '").appendTo(jQuery(document.body));});' . "\r\n" . '</script>'; return $html; }
function fetchElement($name, $value, &$node, $control_name) { // init vars $class = $node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : 'class="inputbox"'; $constraint = $node->attributes('constraint'); // get renderer $this->renderer = new ItemRenderer(); $this->renderer->addPath($this->_parent->layout_path); // if selectable types isn't specified, get all types if (empty($this->_parent->selectable_types)) { $this->_parent->selectable_types = array(''); foreach (JFolder::folders($this->_parent->layout_path . '/' . $this->renderer->getFolder() . '/item') as $folder) { $this->_parent->selectable_types[] = $folder; } } // get layouts $layouts = array(); foreach ($this->_parent->selectable_types as $type) { $layouts = array_merge($layouts, $this->_getLayouts($type, $constraint)); } // create layout options $options = array(JHTML::_('select.option', '', JText::_('Item Name'))); foreach ($layouts as $layout => $layout_name) { $text = $layout_name; $val = $layout; $options[] = JHTML::_('select.option', $val, JText::_($text)); } return JHTML::_('select.genericlist', $options, $control_name . '[' . $name . ']', $class, 'value', 'text', $value, $control_name . $name); }
function display($tpl = null) { global $mainframe, $option; $cid = JRequest::getVar('cid_user'); if (!is_array($cid)) { $mainframe->redirect('index.php?option=' . $option); return; } $user_id = $cid[0]; $model = $this->getModel('user'); $model->load($user_id); $this->_setToolBar(); $say = JText::sprintf('USER_RESOURCES_TITLE', $model->user->username); $root_node = JText::_('RESOURCES_TREE_ROOT_NODE'); $nowdate = JFactory::getDate(); $str_now = JHTML::_('date', $nowdate->toMySQL(), '%Y-%m-%d %H:%M:%S'); $this->assign('nowdate', $str_now); $this->assign('say', $say); $this->assign('root_node', $root_node); $this->assignRef('uid', $user_id); $this->assignRef('option', $option); //hide the menu JRequest::setVar('hidemainmenu', 1); parent::display(); }
function display($tpl = null) { //initialise variables $document =& JFactory::getDocument(); $db =& JFactory::getDBO(); $app =& JFactory::getApplication(); JHTML::_('behavior.tooltip'); JHTML::_('behavior.modal'); //get vars $filter_order = $app->getUserStateFromRequest('com_eventlist.categoryelement.filter_order', 'filter_order', 'c.ordering', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest('com_eventlist.categoryelement.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter_state = $app->getUserStateFromRequest('com_eventlist.categoryelement.filter_state', 'filter_state', '*', 'word'); $search = $app->getUserStateFromRequest('com_eventlist.categoryelement.search', 'search', '', 'string'); $search = $db->getEscaped(trim(JString::strtolower($search))); $template = $app->getTemplate(); //prepare document $document->setTitle(JText::_('SELECT CATEGORY')); $document->addStyleSheet('templates/' . $template . '/css/general.css'); $document->addStyleSheet('components/com_eventlist/assets/css/eventlistbackend.css'); // Get data from the model $rows =& $this->get('Data'); $pageNav =& $this->get('Pagination'); //publish unpublished filter $lists['state'] = JHTML::_('grid.state', $filter_state); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; //assign data to template $this->assignRef('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('pageNav', $pageNav); parent::display($tpl); }
/** * Display the button * * @return array A two element array of ( imageName, textToInsert ) */ function render($name) { $mainframe =& JFactory::getApplication(); $button = new JObject(); if ($mainframe->isSite()) { $enable_frontend = $this->params->enable_frontend; if (!$enable_frontend) { return $button; } } JHTML::_('behavior.modal'); $document =& JFactory::getDocument(); $button_style = 'modulesanywhere'; if (!$this->params->button_icon) { $button_style = 'blank blank_modulesanywhere'; } $document->addStyleSheet(JURI::root(true) . '/plugins/editors-xtd/modulesanywhere/css/style.css'); $link = 'index.php?nn_qp=1' . '&folder=plugins.editors-xtd.modulesanywhere' . '&file=modulesanywhere.inc.php' . '&name=' . $name; $text = JText::_(str_replace(' ', '_', $this->params->button_text)); if ($text == str_replace(' ', '_', $this->params->button_text)) { $text = JText::_($this->params->button_text); } $button->set('modal', true); $button->set('link', $link); $button->set('text', $text); $button->set('name', $button_style); $button->set('options', "{handler: 'iframe', size: {x:window.getSize().x-100, y: window.getSize().y-100}}"); return $button; }
function fetchElement() { $db = JFactory::getDBO(); $query = ''; require JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'config.php'; VmConfig::loadConfig(); $query = 'SELECT a.virtuemart_category_id AS id, b.category_parent_id AS parent_id, b.category_parent_id AS parent, c. category_name AS title ' . 'FROM #__virtuemart_categories AS a ' . 'LEFT JOIN #__virtuemart_category_categories AS b ON a.virtuemart_category_id = b.category_child_id ' . 'LEFT JOIN #__virtuemart_categories_' . VMLANG . ' AS c ON a.virtuemart_category_id = c.virtuemart_category_id ' . 'WHERE a.published = 1 ' . 'ORDER BY a.ordering'; $db->setQuery($query); $menuItems = $db->loadObjectList(); $children = array(); if ($menuItems) { foreach ($menuItems as $v) { $pt = $v->parent_id; $list = isset($children[$pt]) ? $children[$pt] : array(); array_push($list, $v); $children[$pt] = $list; } } jimport('joomla.html.html.menu'); $options = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0); $this->_xml->addChild('option', 'Root')->addAttribute('value', 0); if (count($options)) { foreach ($options as $option) { $this->_xml->addChild('option', htmlspecialchars(' - ' . $option->treename))->addAttribute('value', $option->id); } } $this->_value = $this->_form->get($this->_name, $this->_default); return parent::fetchElement(); }
function display($tpl = null) { $entry = $this->get('Data'); $characters_length = $this->get('CharactersLength'); $robots_array = array('', 'index, follow', 'noindex, follow', 'index, nofollow', 'noindex, nofollow'); if (empty($entry->id)) { JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_NEWENTRY'), 'easyfrontendseo-add'); JToolBarHelper::save('save'); JToolBarHelper::cancel('cancel'); } else { JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_EDITENTRY'), 'easyfrontendseo-edit'); JToolbarHelper::apply('apply'); JToolBarHelper::save('save'); JToolBarHelper::cancel('cancel', 'Close'); } JHTML::_('behavior.framework'); $document = JFactory::getDocument(); $document->addStyleSheet('components/com_easyfrontendseo/css/easyfrontendseo.css'); $document->addScript('components/com_easyfrontendseo/js/wordcount.js', 'text/javascript'); $output = "window.addEvent('domready', function(){"; $output .= "new WordCount('counter_title', {inputName:'title', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_title', {inputName:'title', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n"; $output .= "new WordCount('counter_description', {inputName:'description', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_description', {inputName:'description', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n"; $output .= "new WordCount('counter_keywords', {inputName:'keywords', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_keywords', {inputName:'keywords', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n"; $output .= "new WordCount('counter_generator', {inputName:'generator', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_generator', {inputName:'generator', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n"; $output .= " });"; $document->addScriptDeclaration($output, 'text/javascript'); $this->entry = $entry; $this->characters_length = $characters_length; $this->robots_array = $robots_array; // Get donation code message require_once JPATH_COMPONENT . '/helpers/easyfrontendseo.php'; $donation_code_message = EasyFrontendSeoHelper::getDonationCodeMessage(); $this->donation_code_message = $donation_code_message; parent::display($tpl); }
protected function getInput() { // Base name of the HTML control. $ctrl = $this->name; $value = $this->value; // Construct an array of the HTML OPTION statements. $options = array(); // Construct the various argument calls that are supported. $attribs = ' '; if (isset($this->element['size'])) { $attribs .= 'size="' . (int) $this->element['size'] . '"'; } if (isset($this->element['class'])) { $attribs .= 'class="' . (string) $this->element['class'] . '"'; } else { $attribs .= 'class="inputbox"'; } if (isset($this->element['multiple'])) { $attribs .= ' multiple="multiple"'; } $db = JFactory::getDBO(); $options = array(); $options[0] = new stdClass(); $options[0]->id = 0; $options[0]->name = JText::_('RSM_NO_CATEGORY'); $db->setQuery("SELECT * FROM #__rsmembership_categories ORDER BY ordering"); $options = array_merge($options, $db->loadObjectList()); if ($value == '') { $value = $options; } // Render the HTML SELECT list. return JHTML::_('select.genericlist', $options, $ctrl, $attribs, 'id', 'name', $value, $ctrl); }
function display($tpl = null) { $prod =& $this->get('Data'); $isNew = $prod->id < 1; $text = $isNew ? JText::_("NEW") : JText::_("EDIT"); JToolBarHelper::title(JText::_("PRODUCT") . ': <small><small>[ ' . $text . ' ]</small></small>', 'fst_prods'); if (FST_Helper::Is16()) { JToolBarHelper::custom('translate', 'translate', 'translate', 'Translate', false); JToolBarHelper::spacer(); } JToolBarHelper::save(); if ($isNew) { JToolBarHelper::cancel(); } else { // for existing items the button is renamed `close` JToolBarHelper::cancel('cancel', 'Close'); } FSTAdminHelper::DoSubToolbar(); $this->assignRef('prod', $prod); $path = JPATH_SITE . DS . 'images' . DS . 'fst' . DS . 'products'; if (!file_exists($path)) { mkdir($path, 0777, true); } $files = JFolder::files($path, '(.png$|.jpg$|.jpeg$|.gif$)'); $sections[] = JHTML::_('select.option', '', JText::_("NO_IMAGE"), 'id', 'title'); foreach ($files as $file) { $sections[] = JHTML::_('select.option', $file, $file, 'id', 'title'); } $lists['images'] = JHTML::_('select.genericlist', $sections, 'image', 'class="inputbox" size="1" ', 'id', 'title', $prod->image); $this->assignRef('lists', $lists); parent::display($tpl); }
function fetchElement($name, $value, &$node, $control_name) { jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); $language = JFactory::getLanguage(); // create a unique id $id = preg_replace('#([^a-z0-9_-]+)#i', '', $control_name . 'filesystem' . $name); // add javascript if element has parameters if ($node->attributes('parameters')) { $document = JFactory::getDocument(); $document->addScriptDeclaration('$jce.Parameter.add("#' . $id . '", "filesystem");'); } // path to directory $path = WF_EDITOR_EXTENSIONS . DS . 'filesystem'; $filter = '\\.xml$'; $files = JFolder::files($path, $filter, false, true); $options = array(); if (!$node->attributes('exclude_default')) { $options[] = JHTML::_('select.option', '', WFText::_('WF_OPTION_NOT_SET')); } if (is_array($files)) { foreach ($files as $file) { // load language file $language->load('com_jce_filesystem_' . basename($file, '.xml'), JPATH_SITE); $xml = JApplicationHelper::parseXMLInstallFile($file); $options[] = JHTML::_('select.option', basename($file, '.xml'), WFText::_($xml['name'])); } } return JHTML::_('select.genericlist', $options, '' . $control_name . '[filesystem][' . $name . ']', 'class="inputbox"', 'value', 'text', $value, $id); }
public function getOptions() { // Must load admin language files $lang = JFactory::getLanguage(); $lang->load("com_jevents", JPATH_ADMINISTRATOR); $views = array(); include_once JPATH_ADMINISTRATOR . "/components/com_jevents/jevents.defines.php"; $exceptions_values = (string) $this->element['except'] ? (string) $this->element['except'] : ""; $exceptions = array(); $exceptions = explode(',', $exceptions_values); foreach (JEV_CommonFunctions::getJEventsViewList((string) $this->element["viewtype"]) as $viewfile) { if (in_array($viewfile, $exceptions)) { continue; } $views[] = JHTML::_('select.option', $viewfile, $viewfile); } sort($views); if ($this->menu != 'hide') { $task = JRequest::getVar('task'); if ($task == "params.edit") { unset($views['global']); } else { array_unshift($views, JHTML::_('select.option', 'global', JText::_('USE_GLOBAL'))); } } return $views; }
public function display($tpl = null) { JToolBarHelper::title(JText::_('COM_REDSHOP_GIFTCARD_MANAGEMENT'), 'redshop_giftcard_48'); $uri = JFactory::getURI(); jimport('joomla.html.pane'); $pane = JPane::getInstance('sliders'); $this->pane = $pane; $this->setLayout('default'); $lists = array(); $detail = $this->get('data'); $isNew = $detail->giftcard_id < 1; $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT'); JToolBarHelper::title(JText::_('COM_REDSHOP_GIFTCARDS') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_giftcard_48'); JToolBarHelper::apply(); JToolBarHelper::save(); if ($isNew) { JToolBarHelper::cancel(); } else { JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE')); } $lists['customer_amount'] = JHTML::_('select.booleanlist', 'customer_amount', 'class="inputbox" ', $detail->customer_amount); $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published); if (ECONOMIC_INTEGRATION == 1) { $redhelper = new redhelper(); $accountgroup = $redhelper->getEconomicAccountGroup(); $op = array(); $op[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT')); $accountgroup = array_merge($op, $accountgroup); $lists["accountgroup_id"] = JHTML::_('select.genericlist', $accountgroup, 'accountgroup_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->accountgroup_id); } $this->lists = $lists; $this->detail = $detail; $this->request_url = $uri->toString(); parent::display($tpl); }
public function getScript($block, $element, $url = null) { // Set the default AJAX-URL if (empty($url)) { $url = self::getUrl($block); } // Load ProtoType if (MageBridgeTemplateHelper::hasPrototypeJs() == true) { $script = "Event.observe(window,'load',function(){new Ajax.Updater('{$element}','{$url}',{method:'get'});});"; // Load jQuery } else { if (JFactory::getApplication()->get('jquery') == true) { $script = "jQuery(document).ready(function(){\n" . " jQuery('#" . $element . "').load('" . $url . "');" . "});\n"; // Load MooTools (Joomla!) } else { if (MageBridgeHelper::isJoomla15()) { JHTML::_('behavior.mootools'); $script = "window.addEvent('domready', function(){\n" . " var MBajax = new Ajax( '" . $url . "', {onSuccess: function(r){\n" . " \$('" . $element . "').innerHTML = r;\n" . " }});\n" . " MBajax.request();\n" . "});\n"; // Load MooTools (Joomla! 1.6) } else { JHTML::_('behavior.mootools'); $script = "window.addEvent('domready', function(){\n" . " var MBajax = new Request({\n" . " url: '" . $url . "', \n" . " onComplete: function(r){\n" . " \$('" . $element . "').innerHTML = r;\n" . " }\n" . " }).send();\n" . "});\n"; } } } return $script; }
public function __construct(&$subject, $config) { JHTML::_('behavior.keepalive'); // Keep session parent::__construct($subject, $config); $this->loadLanguage(); }
function getInput($name, $id, $value, $params, $children, $j15 = 0) { $this->params = $params; JHTML::_('behavior.modal', 'a.modal'); $_size = $this->def('size'); $_multiple = $this->def('multiple', 1); $_doc =& JFactory::getDocument(); $_js = "\n\t\t\tfunction jSelectArticle( id, title, object )\n\t\t\t{\n\t\t\t\tif ( document.getElementById(object+'_name') ) {\n\t\t\t\t\tdocument.getElementById(object+'_id').value = id;\n\t\t\t\t\tdocument.getElementById(object+'_name').value = title;\n\t\t\t\t} else {\n\t\t\t\t\t// multiple\n\t\t\t\t\tdocument.getElementById(object+'_id').value = document.getElementById(object+'_id').value.trim();\n\t\t\t\t\tif ( document.getElementById(object+'_id').value ) {\n\t\t\t\t\t\t document.getElementById(object+'_id').value += ',';\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById(object+'_id').value += id;\n\t\t\t\t}\n\t\t\t\tdocument.getElementById('sbox-window').close();\n\t\t\t}"; $_doc->addScriptDeclaration($_js); $_link = 'index.php?option=com_content&task=element&tmpl=component&object=' . $id; $html = "\n" . '<div style="float: left;">'; if (!$_multiple) { $val_name = $value; if ($value) { $db =& JFactory::getDBO(); // load the list of menu types $query = 'SELECT title' . ' FROM #__content' . ' WHERE id = ' . $value . ' LIMIT 1'; $db->setQuery($query); $val_name = $db->loadResult(); $val_name .= ' [' . $value . ']'; } $html .= '<input type="text" id="' . $id . '_name" value="' . $val_name . '" class="inputbox" size="' . $_size . '" disabled="disabled" />'; $html .= '<input type="hidden" name="' . $name . '" id="' . $id . '_id" value="' . $value . '" />'; } else { $html .= '<input type="text" name="' . $name . '" id="' . $id . '_id" value="' . $value . '" class="inputbox" size="' . $_size . '" />'; } $html .= '</div>'; $html .= '<div class="button2-left"><div class="blank"><a class="modal" title="' . JText::_('NN_SELECT_AN_ARTICLE') . '" href="' . $_link . '" rel="{handler: \'iframe\', size: {x: 650, y: 375}}">' . JText::_('NN_SELECT') . '</a></div></div>' . "\n"; return $html; }
function fetchElement($name, $value, &$node, $control_name) { $db =& JFactory::getDBO(); $section = $node->attributes('section'); $class = $node->attributes('class'); if (!$class) { $class = "inputbox"; } if (!isset($section)) { // alias for section $section = $node->attributes('scope'); if (!isset($section)) { $section = 'content'; } } if ($section == 'content') { // This might get a conflict with the dynamic translation - TODO: search for better solution $query = 'SELECT c.id, CONCAT_WS( "/",s.title, c.title ) AS title' . ' FROM #__categories AS c' . ' LEFT JOIN #__sections AS s ON s.id=c.section' . ' WHERE c.published = 1' . ' AND s.scope = ' . $db->Quote($section) . ' ORDER BY s.title, c.title'; } else { $query = 'SELECT c.id, c.title' . ' FROM #__categories AS c' . ' WHERE c.published = 1' . ' AND c.section = ' . $db->Quote($section) . ' ORDER BY c.title'; } $db->setQuery($query); $options = $db->loadObjectList(); array_unshift($options, JHTML::_('select.option', '0', '- ' . JText::_('Select Category') . ' -', 'id', 'title')); return JHTML::_('select.genericlist', $options, '' . $control_name . '[' . $name . ']', 'class="' . $class . '"', 'id', 'title', $value, $control_name . $name); }
function getMessage($extension = '', $xml = '', $version = '', $addmargin = 0) { if (!$extension || !$xml && !$version) { return; } $alias = preg_replace('#[^a-z\\-]#', '', str_replace('?', '-', strtolower($extension))); if ($xml) { $xml = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . DS . str_replace('/', DS, $xml)); if ($xml && isset($xml['version'])) { $version = $xml['version']; } } if (!$version) { return; } JHTML::_('behavior.mootools'); $document =& JFactory::getDocument(); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/js/script.js?v=' . $this->_version); $url = 'http://www.nonumber.nl/ext/version.php?ext=' . $alias . '&version=' . $version; $script = "\n\t\t\twindow.addEvent( 'domready', function() {\n\t\t\t\tnnScripts.loadajax(\n\t\t\t\t\t'" . $url . "',\n\t\t\t\t\t'nnScripts.displayVersion( \\'" . $alias . "\\', data )',\n\t\t\t\t\t'nnScripts.displayVersion( \\'" . $alias . "\\', \\'\\' )'\n\t\t\t\t);\n\t\t\t});\n\t\t"; $document->addScriptDeclaration($script); $msg = html_entity_decode(JText::sprintf('NN_A_NEWER_VERSION_IS_AVAILABLE', 'http://www.nonumber.nl/' . $alias . '/download', '<span id="nonumber_newversionnumber_' . $alias . '"></span>', $version), ENT_COMPAT, 'UTF-8'); $margin = $addmargin ? '10px;' : '3px;'; $msg = '<div style="border:3px solid #F0DC7E;color:#CC0000;margin-bottom:' . $margin . '"><div style="padding: 2px 5px;background-color:#EFE7B8">' . $msg . '</div></div>'; $msg = '<div id="nonumber_version_' . $alias . '" style="display: none;">' . $msg . '</div>'; return $msg; }
public function fetchElement($name, $value, &$node, $control_name) { $application = JFactory::getApplication(); $document = JFactory::getDocument(); $fieldName = $control_name . '[' . $name . ']'; $link = JURI::root() . COLOR_PICKER_URL . 'index.php?object=' . $name . '&color=' . preg_replace('/([^a-zA-Z0-9]?)/', '', $value); JHTML::script('colorpicker.js', COLOR_PICKER_URL); JHTML::_('behavior.modal', 'a.modal'); $title = JText::_('Select a Color'); $short_title = JText::_('Select'); $name_value = !empty($value) ? $value : $title; $background_color = !empty($value) ? $value : '#ffffff'; $html = <<<EOF <div style="float:left;"> <input style="background-color:#ffffff;" type="text" id="{$name}_name" value="{$name_value}" disabled="disabled" size="12" /> </div> <div style="float:left;"> <div style="background-color: {$background_color}; width:15px; height:15px; border: 1px solid #a3a3a3; margin-left:2px" id="{$name}_preview"></div> </div> <div class="button2-left"> <div class="blank"> <a class="modal" title="{$title}" href="{$link}" rel="{handler:'iframe', size: {x: 450, y: 375}}">{$short_title}</a> </div> </div> <input type="hidden" id="{$name}_id" name="{$fieldName}" value="{$value}" /> EOF; return $html; }
function fetchElement($name, $value, &$node, $control_name) { jimport('joomla.language.help'); $helpsites = JHelp::createSiteList(JPATH_ADMINISTRATOR . DS . 'help' . DS . 'helpsites-15.xml', $value); array_unshift($helpsites, JHTML::_('select.option', '', JText::_('local'))); return JHTML::_('select.genericlist', $helpsites, '' . $control_name . '[' . $name . ']', ' class="inputbox"', 'value', 'text', $value, $control_name . $name); }
function display($map, $values, $type = 'discount') { $id = $type . '_' . $map; $js = 'window.hikashop.ready( function(){ updateSubscription(\'' . $id . '\'); });'; if (!HIKASHOP_PHP5) { $doc =& JFactory::getDocument(); } else { $doc = JFactory::getDocument(); } $doc->addScriptDeclaration($js); if (empty($values)) { $values = 'none'; } $choiceValue = $values == 'none' ? $values : 'special'; $return = JHTML::_('hikaselect.radiolist', $this->choice, "choice_" . $id, 'onchange="updateSubscription(\'' . $id . '\');"', 'value', 'text', $choiceValue); $return .= '<input type="hidden" name="data[' . $type . '][' . $map . ']" id="hidden_' . $id . '" value="' . $values . '"/>'; $valuesArray = explode(',', $values); $listAccess = '<div style="display:none" id="div_' . $id . '"><table>'; foreach ($this->groups as $oneGroup) { $listAccess .= '<tr><td>'; if (version_compare(JVERSION, '1.6.0', '>=') || !in_array($oneGroup->value, array(29, 30))) { $listAccess .= '<input type="radio" onchange="updateSubscription(\'' . $id . '\');" value="' . $oneGroup->value . '" ' . (in_array($oneGroup->value, $valuesArray) ? 'checked' : '') . ' name="special_' . $id . '" id="special_' . $id . '_' . $oneGroup->value . '"/>'; } $listAccess .= '</td><td><label for="special_' . $id . '_' . $oneGroup->value . '">' . $oneGroup->text . '</label></td></tr>'; } $listAccess .= '</table></div>'; $return .= $listAccess; return $return; }
function fetchButton($type = 'Acytags', $newstype = 'news') { $url = JURI::base() . "index.php?option=com_acymailing&ctrl=tag&task=tag&tmpl=component&type=" . $newstype; $top = 0; $left = 0; $width = 780; $height = 550; $text = JText::_('TAGS'); if (!ACYMAILING_J30) { $class = "icon-32-tag"; } else { $class = "icon-14-tag"; } if (!ACYMAILING_J30) { JHTML::_('behavior.modal'); $html = "<a class=\"modal\" onclick=\"try{IeCursorFix();}catch(e){}\" href=\"{$url}\" rel=\"{handler: 'iframe', size: {x: {$width}, y: {$height}}}\">\n"; $html .= "<span class=\"{$class}\" title=\"{$text}\"></span>{$text}</a>\n"; return $html; } $html = '<button class="btn btn-small modal" data-toggle="modal" data-target="#modal-' . $type . '"><i class="' . $class . '"></i> ' . $text . '</button>'; $params['title'] = $text; $params['url'] = $url; $params['height'] = $height; $params['width'] = $width; $modalHtml = JHtml::_('bootstrap.renderModal', 'modal-' . $type, $params); $html .= str_replace(array('id="modal-' . $type . '"'), array('id="modal-' . $type . '" style="width:' . ($width + 20) . 'px;height:' . ($height + 90) . 'px;margin-left:-' . ($width + 20) / 2 . 'px"'), $modalHtml); $html .= '<script>' . "\r\n" . 'jQuery(document).ready(function(){jQuery("#modal-' . $type . '").appendTo(jQuery(document.body));});' . "\r\n" . '</script>'; return $html; }
protected function getInput() { JHTML::_('behavior.framework'); $document =& JFactory::getDocument(); if (!version_compare(JVERSION, '3.0', 'ge')) { $checkJqueryLoaded = false; $header = $document->getHeadData(); foreach ($header['scripts'] as $scriptName => $scriptData) { if (substr_count($scriptName, '/jquery')) { $checkJqueryLoaded = true; } } //Add js if (!$checkJqueryLoaded) { $document->addScript(JURI::root() . $this->element['path'] . 'js/jquery.min.js'); } $document->addScript(JURI::root() . $this->element['path'] . 'js/chosen.jquery.min.js'); $document->addStyleSheet(JURI::root() . $this->element['path'] . 'css/chosen.css'); } $document->addScript(JURI::root() . $this->element['path'] . 'js/colorpicker/colorpicker.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/jquery.lightbox-0.5.min.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/btbase64.min.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/bt.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/script.js'); //Add css $document->addStyleSheet(JURI::root() . $this->element['path'] . 'css/bt.css'); $document->addStyleSheet(JURI::root() . $this->element['path'] . 'js/colorpicker/colorpicker.css'); $document->addStyleSheet(JURI::root() . $this->element['path'] . 'css/jquery.lightbox-0.5.css'); return null; }
function fetchElement($name, $value, &$node, $control_name) { jimport('joomla.filesystem.folder'); // path to images directory $path = JPATH_ROOT . DS . $node->attributes('directory'); $filter = $node->attributes('filter'); $exclude = $node->attributes('exclude'); $recursive = $node->attributes('recursive') == 1 ? true : false; $folders = JFolder::folders($path, $filter, $recursive); $folders = $this->recursive_listdir($path, $node); $options = array(); foreach ($folders as $key => $folder) { if ($exclude) { if (preg_match(chr(1) . $exclude . chr(1), $folder)) { continue; } } $options[] = JHTML::_('select.option', $key, $folder); } if (!$node->attributes('hide_none')) { array_unshift($options, JHTML::_('select.option', '-1', '- ' . JText::_('Do not use') . ' -')); } if (!$node->attributes('hide_default')) { array_unshift($options, JHTML::_('select.option', '', '- ' . JText::_('Use default') . ' -')); } $fullName = ElementHelper::getFullName($this, $control_name, $name); return JHTML::_('select.genericlist', $options, $fullName, 'class="inputbox"', 'value', 'text', $value, "params{$name}"); }
static function getList(&$params) { //get database $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('MONTH(created) AS created_month, created, id, title, YEAR(created) AS created_year'); $query->from('#__content'); $query->where('state = 2 AND checked_out = 0'); $query->group('created_year DESC, created_month DESC'); // Filter by language if (JFactory::getApplication()->getLanguageFilter()) { $query->where('language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, intval($params->get('count'))); $rows = (array) $db->loadObjectList(); $app = JFactory::getApplication(); $menu = $app->getMenu(); $item = $menu->getItems('link', 'index.php?option=com_content&view=archive', true); $itemid = isset($item) && !empty($item->id) ? '&Itemid=' . $item->id : ''; $i = 0; $lists = array(); foreach ($rows as $row) { $date = JFactory::getDate($row->created); $created_month = $date->format('n'); $created_year = $date->format('Y'); $created_year_cal = JHTML::_('date', $row->created, 'Y'); $month_name_cal = JHTML::_('date', $row->created, 'F'); $lists[$i] = new stdClass(); $lists[$i]->link = JRoute::_('index.php?option=com_content&view=archive&year=' . $created_year . '&month=' . $created_month . $itemid); $lists[$i]->text = JText::sprintf('MOD_ARTICLES_ARCHIVE_DATE', $month_name_cal, $created_year_cal); $i++; } return $lists; }
function __construct($config = array()) { parent::__construct($config); JHTML::_('behavior.tooltip'); JRequest::setVar('tmpl', 'component'); $this->registerDefaultTask('tag'); }
protected function getInput() { $html = ''; $options = array(); $base = JPATH_ROOT . DIRECTORY_SEPARATOR . 'images'; $attr = ''; $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; if ((string) $this->element['readonly'] == 'true' || (string) $this->element['disabled'] == 'true') { $attr .= ' disabled="disabled"'; } $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; $attr .= $this->multiple ? ' multiple="multiple"' : ''; $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : ''; $options[] = JHTML::_('select.option', '', JText::_('AVATAR_SELECT_FOLDER')); $folders = JFolder::folders($base, '.', true, true); foreach ($folders as $folder) { $folder = str_replace($base, '', $folder); $value = str_replace(DIRECTORY_SEPARATOR, '/', substr($folder, 1)); $text = str_replace(DIRECTORY_SEPARATOR, '/', $folder); $options[] = JHTML::_('select.option', $value, $text); } if (is_array($options)) { sort($options); } $html = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id); return $html; }