Example #1
1
 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;
 }
Example #2
1
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_REDSOCIALSTREAM_CONFIGURE'), 'configure.png');
     JToolBarHelper::apply();
     JToolBarHelper::cancel('cancel', 'COM_REDSOCIALSTREAM_CLOSE');
     //DEVNOTE: set document title
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSOCIALSTREAM_REDSOCIALSTREAMS'));
     $mainframe = JFactory::getApplication();
     $context = "config";
     $model = $this->getModel('configure');
     $db = JFactory::getDbo();
     $q = "SELECT * FROM #__redsocialstream_settings";
     $db->setQuery($q);
     $this->settingsrows = $db->loadObjectList();
     $typelist = $this->get('type_list_sorted');
     $pagination = $this->get('Pagination');
     //DEVNOTE:give me ordering from request
     $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'ordering');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '');
     $this->assignRef('lists', $lists);
     $this->assignRef("typelist", $typelist);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
Example #3
1
	public function onAfterRoute()
	{
		$app = JFactory::getApplication();

		if($app->isAdmin()){
			return;
		}

		$menus = $app->getMenu('site');
		$menu = $menus->getActive();
		if(!$menu || $menu->home != 1) return;

		$doc = JFactory::getDocument();
		if($doc->getType() != 'html') return;

		$params = JComponentHelper::getParams('com_xmlrpc');

		if($params->get('show_rsd', 1)){
			class_exists('XMLRPCHelperRoute') or require(JPATH_SITE.'/components/com_xmlrpc/helpers/route.php');
			$link = JRoute::_(XMLRPCHelperRoute::getRsdRoute());
			$doc->addHeadLink($link, 'EditURI', 'rel', array('type' => 'application/rsd+xml', 'title'=>'RSD'));
		}

		if($params->get('show_manifest', 1)){
			class_exists('XMLRPCHelperRoute') or require(JPATH_SITE.'/components/com_xmlrpc/helpers/route.php');
			$link = JRoute::_(XMLRPCHelperRoute::getManifestRoute());
			$doc->addHeadLink($link, 'wlwmanifest', 'rel', array('type'=>'application/wlwmanifest+xml'));
		}
	}
Example #4
1
 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');
     }
 }
Example #5
0
 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;
 }
 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  * @since   1.6
  */
 protected function getInput()
 {
     JHtml::_('jquery.framework');
     $itemid = JFactory::getApplication()->input->getInt('id', 0);
     $document = JFactory::getDocument();
     $document->addScript(JUri::root() . 'administrator/components/com_dzproduct/assets/js/customfield.js');
     JText::script('COM_DZPRODUCT_FIELD_CUSTOM_FIELD_ERROR_NO_FIELDS');
     JText::script('COM_DZPRODUCT_FIELD_CUSTOM_FIELD_ERROR_LOAD_FIELDS');
     JText::script('COM_DZPRODUCT_FIELD_CUSTOM_FIELD_BTN_EDIT_GROUP');
     $html = '<div 
                 id="' . $this->id . '" 
                 class="form-horizontal customfield" 
                 data-fieldname="' . $this->fieldname . '" 
                 data-controller="' . $this->element['controller'] . '" 
                 data-itemid="' . $itemid . '">
                 <div class="form-container"></div>
                 <img class="img-loading" src="' . JUri::root() . '/media/system/images/modal/spinner.gif" />
                 <div class="control-group">
                     <div class="controls">
                         <button class="btn btn-primary btn-reload"><span class="icon-refresh"></span>&nbsp;' . JText::_('COM_DZPRODUCT_RELOAD_FIELDS') . '</button>
                     </div>
                 </div>
             </div>';
     return $html;
 }
Example #7
0
 function display($dummy1 = false, $dummy2 = false)
 {
     $moduleId = JRequest::getInt('formid');
     if (empty($moduleId)) {
         return;
     }
     if (JRequest::getInt('interval') > 0) {
         setcookie('acymailingSubscriptionState', true, time() + JRequest::getInt('interval'), '/');
     }
     $db = JFactory::getDBO();
     $db->setQuery('SELECT * FROM #__modules WHERE id = ' . intval($moduleId) . ' AND `module` LIKE \'%acymailing%\' LIMIT 1');
     $module = $db->loadObject();
     if (empty($module)) {
         echo 'No module found';
         exit;
     }
     $module->user = substr($module->module, 0, 4) == 'mod_' ? 0 : 1;
     $module->name = $module->user ? $module->title : substr($module->module, 4);
     $module->style = null;
     $module->module = preg_replace('/[^A-Z0-9_\\.-]/i', '', $module->module);
     $params = array();
     if (JRequest::getInt('autofocus', 0)) {
         acymailing_loadMootools();
         $js = "\n\t\t\t\twindow = addEvent('load', function(){\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tvar moduleInputs = document.getElementsByTagName('input');\n\t\t\t\t\tif(moduleInputs){\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\twhile(moduleInputs[i].disabled == true){\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(moduleInputs[i]) moduleInputs[i].focus();\n\t\t\t\t\t}\n\t\t\t\t});";
         $doc = JFactory::getDocument();
         $doc->addScriptDeclaration($js);
     }
     echo JModuleHelper::renderModule($module, $params);
 }
 function tag()
 {
     $doc = JFactory::getDocument();
     $doc->addStyleSheet(ACYMAILING_CSS . 'frontendedition.css?v=' . filemtime(ACYMAILING_MEDIA . 'css' . DS . 'frontendedition.css'));
     JPluginHelper::importPlugin('acymailing');
     $dispatcher = JDispatcher::getInstance();
     $tagsfamilies = $dispatcher->trigger('acymailing_getPluginType');
     $defaultFamily = reset($tagsfamilies);
     $app = JFactory::getApplication();
     $fctplug = $app->getUserStateFromRequest(ACYMAILING_COMPONENT . ".tag", 'fctplug', $defaultFamily->function, 'cmd');
     ob_start();
     $defaultContents = $dispatcher->trigger($fctplug);
     $defaultContent = ob_get_clean();
     $js = 'function insertTag(){if(window.parent.insertTag(window.document.getElementById(\'tagstring\').value)) {acymailing_js.closeBox(true);}}';
     $js .= 'function setTag(tagvalue){window.document.getElementById(\'tagstring\').value = tagvalue;}';
     $js .= 'function showTagButton(){window.document.getElementById(\'insertButton\').style.display = \'inline\'; window.document.getElementById(\'tagstring\').style.display=\'inline\';}';
     $js .= 'function hideTagButton(){}';
     $js .= 'try{window.parent.previousSelection = window.parent.getPreviousSelection(); }catch(err){window.parent.previousSelection=false; }';
     $doc->addScriptDeclaration($js);
     $this->assignRef('fctplug', $fctplug);
     $type = JRequest::getString('type', 'news');
     $this->assignRef('type', $type);
     $this->assignRef('defaultContent', $defaultContent);
     $this->assignRef('tagsfamilies', $tagsfamilies);
     $app = JFactory::getApplication();
     $this->assignRef('app', $app);
     $ctrl = JRequest::getString('ctrl');
     $this->assignRef('ctrl', $ctrl);
 }
Example #9
0
 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&amp;task=element&amp;tmpl=component&amp;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;
 }
Example #10
0
 private function _initDefaultPage()
 {
     $document = JFactory::getDocument();
     $document->addCustomTag('<link href="' . JURI::root(true) . '/media/cbcc/js/jstree/themes/default/style.css" rel="stylesheet" />');
     $document->addScript(JURI::root(true) . '/media/jui/js/jquery.min.js');
     $document->addScript(JURI::root(true) . '/media/cbcc/js/jstree/jquery.jstree.js');
 }
 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);
 }
Example #12
0
 /**
  * Render the action bar title
  *
  * @param   array   $config An optional array with configuration options
  * @return  string  Html
  */
 public function title($config = array())
 {
     $config = new KObjectConfigJson($config);
     $config->append(array('command' => NULL));
     $title = $this->getObject('translator')->translate($config->command->title);
     $icon = $config->command->icon;
     $html = '';
     if (!empty($title)) {
         if (JFactory::getApplication()->isAdmin() && version_compare(JVERSION, '3.2', 'ge')) {
             $layout = new JLayoutFile('joomla.toolbar.title');
             $html = $layout->render(array('title' => $title, 'icon' => $icon));
         } elseif ($this->_useBootstrap()) {
             // Strip the extension.
             $icons = explode(' ', $icon);
             foreach ($icons as &$icon) {
                 $icon = 'pagetitle--' . preg_replace('#\\.[^.]*$#', '', $icon);
             }
             $html = '<div class="pagetitle ' . htmlspecialchars(implode(' ', $icons)) . '"><h2>' . $title . '</h2></div>';
         } else {
             $html = '<div class="header pagetitle icon-48-' . $icon . '">';
             $html .= '<h2>' . $title . '</h2>';
             $html .= '</div>';
         }
         if (JFactory::getApplication()->isAdmin()) {
             $app = JFactory::getApplication();
             $app->JComponentTitle = $html;
             $html = '';
             JFactory::getDocument()->setTitle($app->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - ' . $title);
         }
     }
     return $html;
 }
Example #13
0
 /**
  * Display the button
  *
  * @return array A four element array of (article_id, article_title, category_id, object)
  */
 function onDisplay($name)
 {
     /*
      * Javascript to insert the link
      * View element calls jSelectArticle when an article is clicked
      * jSelectArticle creates the link tag, sends it to the editor,
      * and closes the select frame.
      */
     $js = "\n\t\tfunction jSelectArticle(id, title, catid, object) {\n\t\t\tvar tag = '<a href='+'\"index.php?option=com_content&amp;view=article&amp;catid='+catid+'&amp;id='+id+'\">'+title+'</a>';\n\t\t\tjInsertEditorText(tag, '" . $name . "');\n\t\t\tSqueezeBox.close();\n\t\t}";
     $doc = JFactory::getDocument();
     $doc->addScriptDeclaration($js);
     JHtml::_('behavior.modal');
     /*
      * Use the built-in element view to select the article.
      * Currently uses blank class.
      */
     $link = 'index.php?option=com_content&amp;view=articles&amp;layout=modal&amp;tmpl=component';
     $button = new JObject();
     $button->set('modal', true);
     $button->set('link', $link);
     $button->set('text', JText::_('PLG_ARTICLE_BUTTON_ARTICLE'));
     $button->set('name', 'article');
     $button->set('options', "{handler: 'iframe', size: {x: 770, y: 400}}");
     return $button;
 }
Example #14
0
	/**
	 * This renders the necessary bootstrap data into the html headers.
	 */
	public function bootstrap()
	{
		static $isRendered	= false;

		$doc 				= JFactory::getDocument();

		if( !$isRendered && $doc->getType() == 'html' )
		{
			// @task: Include dependencies from foundry.
			require_once( JPATH_ROOT . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'foundry' . DIRECTORY_SEPARATOR . '3.1' . DIRECTORY_SEPARATOR . 'joomla' . DIRECTORY_SEPARATOR . 'configuration.php' );

			$config = Komento::getConfig();

			$environment = JRequest::getVar( 'komento_environment' , $config->get( 'komento_environment' ) );

			$folder	= 'scripts';

			// @task: Let's see if we should load the dev scripts.
			if( $environment == 'development' )
			{
				$folder		= 'scripts_';
			}

			$doc->addScript( rtrim( JURI::root() , '/' ) . '/media/com_komento/' . $folder . '/abstract.js' );

			$isRendered		= true;
		}

		return $isRendered;
	}
Example #15
0
 /**
  * Display the view
  */
 function display()
 {
     $document =& JFactory::getDocument();
     $viewName = JRequest::getVar('view', 'category', 'default', 'cmd');
     $viewType = $document->getType();
     // interceptors to support legacy urls
     switch ($this->getTask()) {
         //index.php?option=com_contact&task=category&id=0&Itemid=4
         case 'category':
             $viewName = 'category';
             $layout = 'default';
             break;
         case 'view':
             $viewName = 'contact';
             $layout = 'default';
             break;
     }
     // Set the default view name from the Request
     $view =& $this->getView($viewName, $viewType);
     // Push a model into the view
     $model =& $this->getModel($viewName);
     if (!JError::isError($model)) {
         $view->setModel($model, true);
     }
     // Workaround for the item view
     if ($viewName == 'contact') {
         $modelCat =& $this->getModel('category');
         $view->setModel($modelCat);
     }
     // Display the view
     $view->assign('error', $this->getError());
     $view->display();
 }
Example #16
0
 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);
 }
Example #17
0
 public function display()
 {
     //Set the document link
     $this->_document->link = $this->createRoute('format=html&view=posts&blog_blog_id=' . KRequest::get('get.id', 'int'));
     //Get the list of posts
     $posts = KFactory::get($this->getModel())->getList();
     foreach ($posts as $post) {
         // strip html from feed item title
         $title = html_entity_decode($post->title);
         // url link to article
         $link = $this->createRoute('format=html&view=post&slug=' . $post->slug);
         // generate the description as a hcard
         $description = $post->text;
         // load individual item creator class
         $item = new JFeedItem();
         $item->title = $title;
         $item->link = $link;
         $item->description = $description;
         $item->date = date('r', strtotime($post->created_on));
         $item->category = '';
         // loads item info into rss array
         $doc =& JFactory::getDocument();
         $doc->addItem($item);
     }
     return $this;
 }
Example #18
0
    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 . '&amp;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;
    }
Example #19
0
 /**
  * Renders the view
  *
  * @param   string  $tpl  Template name
  *
  * @return void
  *
  * @since  2.5.4
  */
 public function display($tpl = null)
 {
     // Get data from the model
     $this->state = $this->get('State');
     // Load useful classes
     $model = $this->getModel();
     $this->loadHelper('select');
     // Assign view variables
     $ftp = $model->getFTPOptions();
     $this->assign('updateInfo', $model->getUpdateInformation());
     $this->assign('methodSelect', JoomlaupdateHelperSelect::getMethods($ftp['enabled']));
     // Set the toolbar information
     JToolbarHelper::title(JText::_('COM_JOOMLAUPDATE_OVERVIEW'), 'install');
     JToolbarHelper::custom('update.purge', 'purge', 'purge', 'JTOOLBAR_PURGE_CACHE', false, false);
     // Add toolbar buttons
     JToolbarHelper::preferences('com_joomlaupdate');
     // Load mooTools
     JHtml::_('behavior.framework', true);
     // Load our Javascript
     $document = JFactory::getDocument();
     $document->addScript('../media/com_joomlaupdate/default.js');
     JHtml::_('stylesheet', 'media/mediamanager.css', array(), true);
     // Render the view
     parent::display($tpl);
 }
Example #20
0
    public function display($tpl = null) {

        $document = & JFactory::getDocument();
        $document->addStyleSheet('components/com_gglms/css/lista.css');
        $document->addStyleSheet('components/com_gglms/css/jquery.dataTables.css');
        $document->addStyleSheet('components/com_gglms/css/jquery.dataTables_themeroller.css');
        $document->addScript('components/com_gglms/js/jquery.dataTables.js');


        $model = & $this->getModel();




        $tpl = JRequest::getVar('tpl');


        if ($tpl == "byContent") {
            $contentStat = $model->getContentStat();
            $this->assignRef('ContentStat', $contentStat);
        }

        if ($tpl == "byDate") {
            $AccesByDay = $model->getAccesByDay();
            $this->assignRef('AccesByDay', $AccesByDay);
        }

        parent::display($tpl);
    }
Example #21
0
 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;
 }
Example #22
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     global $JElementJSComboJSWritten;
     if (!$JElementJSComboJSWritten) {
         $jsFile = dirname(__FILE__) . DS . "jscombobox.js";
         $jsUrl = str_replace(JPATH_ROOT, JURI::root(true), $jsFile);
         $jsUrl = str_replace(DS, "/", $jsUrl);
         $document = JFactory::getDocument();
         $document->addScript($jsUrl);
         $document->addstylesheet(str_replace('jscombobox.js', 'jscombobox.css', $jsUrl));
         $JElementJSComboJSWritten = TRUE;
     }
     $html = array();
     $attr = '';
     // Initialize some field attributes.
     $attr .= $this->element['class'] ? ' class="combobox ' . (string) $this->element['class'] . '"' : ' class="combobox"';
     // To avoid user's confusion, readonly="true" should imply disabled="true".
     if ((string) $this->element['readonly'] == 'true' || (string) $this->element['disabled'] == 'true') {
         $attr .= ' disabled="disabled"';
     }
     $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
     // Initialize JavaScript field attributes.
     $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     // Get the field options.
     $options = (array) $this->getOptions();
     //store saved value for textbox
     $attr .= $this->value ? ' data-value="' . $this->value . '"' : '';
     // Create a regular list.
     $html[] = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
     return implode($html);
 }
Example #23
0
 function process()
 {
     if (!$this->isAllowed('lists', 'filter')) {
         return;
     }
     JRequest::checkToken() or die('Invalid Token');
     $filid = JRequest::getInt('filid');
     if (!empty($filid)) {
         $this->store();
     }
     $filterClass = acymailing_get('class.filter');
     $filterClass->subid = JRequest::getString('subid');
     $filterClass->execute(JRequest::getVar('filter'), JRequest::getVar('action'));
     if (!empty($filterClass->report)) {
         if (JRequest::getCmd('tmpl') == 'component') {
             echo acymailing_display($filterClass->report, 'info');
             $js = "setTimeout('redirect()',2000); function redirect(){window.top.location.href = 'index.php?option=com_acymailing&ctrl=subscriber'; }";
             $doc = JFactory::getDocument();
             $doc->addScriptDeclaration($js);
             return;
         } else {
             $app = JFactory::getApplication();
             foreach ($filterClass->report as $oneReport) {
                 $app->enqueueMessage($oneReport);
             }
         }
     }
     return $this->edit();
 }
Example #24
0
 /**
  * Add the page title and toolbar.
  *
  * 
  */
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/jdownloadshelper.php';
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
     $canDo = JDownloadsHelper::getActions();
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_jdownloads/assets/css/style.css');
     $title = $isNew ? JText::_('COM_JDOWNLOADS_LICEDIT_ADD') : JText::_('COM_JDOWNLOADS_LICEDIT_EDIT');
     JToolBarHelper::title(JText::_('COM_JDOWNLOADS') . ': ' . $title, 'jdlicenses');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
         JToolBarHelper::apply('license.apply');
         JToolBarHelper::save('license.save');
     }
     if (!$checkedOut && $canDo->get('core.create')) {
         JToolBarHelper::save2new('license.save2new');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('license.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('license.cancel');
     } else {
         JToolBarHelper::cancel('license.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('help.license', true);
 }
Example #25
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     if ($this->getLayout() == 'pagebreak') {
         // TODO: This is really dogy - should change this one day.
         $eName = JRequest::getVar('e_name');
         $eName = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName);
         $document = JFactory::getDocument();
         $document->setTitle(JText::_('COM_CONTENT_PAGEBREAK_DOC_TITLE'));
         $this->assignRef('eName', $eName);
         parent::display($tpl);
         return;
     }
     // Initialiase variables.
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->canDo = ContentHelper::getActions($this->state->get('filter.category_id'));
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Example #26
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     // Load the modal behavior script.
     JHtml::_('behavior.modal', 'a.modal');
     // Build the script.
     $script = array();
     $script[] = '	function onBulletsSelect(data){';
     $script[] = '		alert("do something: " + data)';
     $script[] = '		SqueezeBox.close();';
     $script[] = '	}';
     // Add the script to the document head.
     JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
     // Setup variables for display.
     $html = array();
     $link = 'index.php?option=com_unitehcarousel&view=slider&layout=bullets&tmpl=component';
     $html[] = '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . $this->value . '" />';
     $bulletsText = "Change Bullets";
     $buttonID = $this->id . "-btn";
     $desc = UniteFunctionsHCar::getVal($this->element, "description");
     $htmlAddon = "";
     if (!empty($desc)) {
         $htmlAddon = ' title="' . $desc . '"';
         //$class .= " hasTip";	//making problems with rel
     }
     // The user select button.
     $html[] = '	<a id="' . $buttonID . '" class="modal panel_button" ' . $htmlAddon . '  href="' . $link . '&amp;' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 900, y: 450}}">' . $bulletsText . '</a>';
     $html = implode("\n", $html);
     return $html;
 }
Example #27
0
 /**
  * Method to get the field input markup for a generic list.
  * Use the multiple attribute to enable multiselect.
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getInput()
 {
     $document = JFactory::getDocument();
     $jsPath = JURI::root(true) . '/modules/mod_currentdatetime/js';
     $joomlaVersion = new JVersion();
     if ($joomlaVersion->isCompatible('3')) {
         JHtml::_('jquery.ui', array('core', 'sortable'));
     } else {
         $document->addStyleSheet($jsPath . '/25/css/chosen.min.css');
         $document->addScript($jsPath . '/25/jquery.min.js');
         $document->addScript($jsPath . '/25/jquery-noconflict.js');
         $document->addScript($jsPath . '/25/chosen.jquery.min.js');
         $document->addScript($jsPath . '/25/jquery.ui.core.min.js');
         $document->addScript($jsPath . '/25/jquery.ui.widget.min.js');
         $document->addScript($jsPath . '/25/jquery.ui.mouse.min.js');
         $document->addScript($jsPath . '/25/jquery.ui.sortable.min.js');
     }
     $document->addScript($jsPath . '/jquery-chosen-sortable.min.js');
     $script = 'jQuery(function(){jQuery(".chzn-sortable").chosen().chosenSortable();});';
     $document->addScriptDeclaration($script);
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $html = parent::getInput();
     return $html;
 }
Example #28
0
 /**
  * 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;
 }
Example #29
0
 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;
 }
Example #30
0
    /**
     * Renders the view
     *
     * @param   string  $tpl  Template name
     *
     * @return void
     */
    public function display($tpl = null)
    {
        $password = JFactory::getApplication()->getUserState('com_joomlaupdate.password', null);
        $filesize = JFactory::getApplication()->getUserState('com_joomlaupdate.filesize', null);
        $ajaxUrl = JUri::base() . 'components/com_joomlaupdate/restore.php';
        $returnUrl = 'index.php?option=com_joomlaupdate&task=update.finalise';
        // Set the toolbar information
        JToolbarHelper::title(JText::_('COM_JOOMLAUPDATE_OVERVIEW'), 'install');
        JToolBarHelper::divider();
        JToolBarHelper::help('JHELP_COMPONENTS_JOOMLA_UPDATE');
        // Add toolbar buttons
        if (JFactory::getUser()->authorise('core.admin', 'com_joomlaupdate')) {
            JToolbarHelper::preferences('com_joomlaupdate');
        }
        // Load mooTools
        JHtml::_('behavior.framework', true);
        $updateScript = <<<ENDSCRIPT
var joomlaupdate_password = '******';
var joomlaupdate_totalsize = '{$filesize}';
var joomlaupdate_ajax_url = '{$ajaxUrl}';
var joomlaupdate_return_url = '{$returnUrl}';

ENDSCRIPT;
        // Load our Javascript
        $document = JFactory::getDocument();
        $document->addScript('../media/com_joomlaupdate/json2.js');
        $document->addScript('../media/com_joomlaupdate/encryption.js');
        $document->addScript('../media/com_joomlaupdate/update.js');
        JHtml::_('script', 'system/progressbar.js', true, true);
        JHtml::_('stylesheet', 'media/mediamanager.css', array(), true);
        $document->addScriptDeclaration($updateScript);
        // Render the view
        parent::display($tpl);
    }