Example #1
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 #2
1
 /**
  * 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 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);
 }
	/**
	 * Method to get the list of template style options
	 * grouped by template.
	 * Use the client attribute to specify a specific client.
	 * Use the template attribute to specify a specific template
	 *
	 * @return  array  The field option objects as a nested array in groups.
	 *
	 * @since   11.1
	 */
	protected function getGroups()
	{
		// Initialize variables.
		$groups = array();
		$lang = JFactory::getLanguage();

		// Get the client and client_id.
		$clientName = $this->element['client'] ? (string) $this->element['client'] : 'site';
		$client = JApplicationHelper::getClientInfo($clientName, true);

		// Get the template.
		$template = (string) $this->element['template'];

		// Get the database object and a new query object.
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		// Build the query.
		$query->select('s.id, s.title, e.name as name, s.template');
		$query->from('#__template_styles as s');
		$query->where('s.client_id = ' . (int) $client->id);
		$query->order('template');
		$query->order('title');
		if ($template)
		{
			$query->where('s.template = ' . $db->quote($template));
		}
		$query->join('LEFT', '#__extensions as e on e.element=s.template');
		$query->where('e.enabled=1');

		// Set the query and load the styles.
		$db->setQuery($query);
		$styles = $db->loadObjectList();

		// Build the grouped list array.
		if ($styles)
		{
			foreach ($styles as $style)
			{
				$template = $style->template;
				$lang->load('tpl_' . $template . '.sys', $client->path, null, false, false)
					|| $lang->load('tpl_' . $template . '.sys', $client->path . '/templates/' . $template, null, false, false)
					|| $lang->load('tpl_' . $template . '.sys', $client->path, $lang->getDefault(), false, false)
					|| $lang->load('tpl_' . $template . '.sys', $client->path . '/templates/' . $template, $lang->getDefault(), false, false);
				$name = JText::_($style->name);
				// Initialize the group if necessary.
				if (!isset($groups[$name]))
				{
					$groups[$name] = array();
				}

				$groups[$name][] = JHtml::_('select.option', $style->id, $style->title);
			}
		}

		// Merge any additional groups in the XML definition.
		$groups = array_merge(parent::getGroups(), $groups);

		return $groups;
	}
Example #5
0
 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;
 }
Example #6
0
 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  *
  * @since   11.4
  */
 protected function getOptions()
 {
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     // Select the required fields from the table.
     $query->select('c.id, c.country, c.country_jtext');
     $query->from('`#__tj_country` AS c');
     $query->where('c.com_quick2cart = 1');
     $query->order($db->escape('c.ordering ASC'));
     $db->setQuery($query);
     // Get all countries.
     $countries = $db->loadObjectList();
     $options = array();
     // Load lang file for countries
     $lang = JFactory::getLanguage();
     $lang->load('tjgeo.countries', JPATH_SITE, null, false, true);
     foreach ($countries as $c) {
         if ($lang->hasKey(strtoupper($c->country_jtext))) {
             $c->country = JText::_($c->country_jtext);
         }
         $options[] = JHtml::_('select.option', $c->id, $c->country);
     }
     if (!$this->loadExternally) {
         // Merge any additional options in the XML definition.
         $options = array_merge(parent::getOptions(), $options);
     }
     return $options;
 }
Example #7
0
 /**
  * Gets menu items by attribute
  *
  * @param	string	$attributes	The field name
  * @param	string	$values		The value of the field
  * @param	boolean	$firstonly	If true, only returns the first item found
  *
  * @return	array
  */
 public function getItems($attributes, $values, $firstonly = false)
 {
     $attributes = (array) $attributes;
     $values = (array) $values;
     $app = JApplication::getInstance('site');
     if ($app->isSite()) {
         // Filter by language if not set
         if (($key = array_search('language', $attributes)) === false) {
             if ($app->getLanguageFilter()) {
                 $attributes[] = 'language';
                 $values[] = array(JFactory::getLanguage()->getTag(), '*');
             }
         } elseif ($values[$key] === null) {
             unset($attributes[$key]);
             unset($values[$key]);
         }
         // Filter by access level if not set
         if (($key = array_search('access', $attributes)) === false) {
             $attributes[] = 'access';
             $values[] = JFactory::getUser()->getAuthorisedViewLevels();
         } elseif ($values[$key] === null) {
             unset($attributes[$key]);
             unset($values[$key]);
         }
     }
     return parent::getItems($attributes, $values, $firstonly);
 }
Example #8
0
function pagination_list_render($list)
{
    // Initialize variables
    $lang =& JFactory::getLanguage();
    $html = null;
    if ($list['start']['active']) {
        $html .= "<div class=\"page-button\"><div class=\"start\">" . $list['start']['data'] . "</div></div>";
    } else {
        $html .= "<div class=\"page-button off\"><div class=\"start\">" . $list['start']['data'] . "</div></div>";
    }
    if ($list['previous']['active']) {
        $html .= "<div class=\"page-button\"><div class=\"prev\">" . $list['previous']['data'] . "</div></div>";
    } else {
        $html .= "<div class=\"page-button\"><div class=\"prev\">" . $list['previous']['data'] . "</div></div>";
    }
    $html .= "\n<div class=\"pages\"><div class=\"page\">";
    foreach ($list['pages'] as $page) {
        $html .= $page['data'];
    }
    $html .= "\n</div></div>";
    if ($list['next']['active']) {
        $html .= "<div class=\"page-button\"><div class=\"next\">" . $list['next']['data'] . "</div></div>";
    } else {
        $html .= "<div class=\"page-button off\"><div class=\"next\">" . $list['next']['data'] . "</div></div>";
    }
    if ($list['end']['active']) {
        $html .= "<div class=\"page-button\"><div class=\"end\">" . $list['end']['data'] . "</div></div>";
    } else {
        $html .= "<div class=\"page-button off\"><div class=\"end\">" . $list['end']['data'] . "</div></div>";
    }
    return $html;
}
Example #9
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $params = JComponentHelper::getParams('com_tz_pinboard');
     $img_size = $params->get('portfolio_image_size');
     $this->assign('img_size', $img_size);
     if (JRequest::getCmd('task') != 'lists') {
         JFactory::getLanguage()->load('com_content');
         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 = TZ_PinboardHelper::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->assign('listsGroup', $this->get('FieldsGroup'));
         $this->assign('listsTags', $this->get('Tags'));
         $this->assign('listAttach', $this->get('Attachment'));
         $this->assign('listEdit', $this->get('FieldsContent'));
         $this->addToolbar();
     }
     parent::display($tpl);
 }
Example #10
0
 /**
  * Creates a list of maps.
  *
  * @return  array  An array containing the maps that can be selected.
  *
  * @since   2.5
  */
 public static function mapslist()
 {
     $lang = JFactory::getLanguage();
     // Load the finder types.
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('title AS text, id AS value');
     $query->from($db->quoteName('#__finder_taxonomy'));
     $query->where($db->quoteName('parent_id') . ' = 1');
     $query->order('ordering, title ASC');
     $db->setQuery($query);
     try {
         $rows = $db->loadObjectList();
     } catch (RuntimeException $e) {
         return;
     }
     // Compile the options.
     $options = array();
     $options[] = JHtml::_('select.option', '1', JText::_('COM_FINDER_MAPS_BRANCHES'));
     foreach ($rows as $row) {
         $key = $lang->hasKey(FinderHelperLanguage::branchPlural($row->text)) ? FinderHelperLanguage::branchPlural($row->text) : $row->text;
         $string = JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_($key));
         $options[] = JHtml::_('select.option', $row->value, $string);
     }
     return $options;
 }
Example #11
0
    function quickiconButton($link, $image, $text)
    {
        global $mainframe;
        $lang =& JFactory::getLanguage();
        $template = $mainframe->getTemplate();
        ?>
		<div style="float:<?php 
        echo $lang->isRTL() ? 'right' : 'left';
        ?>
;">
			<div class="icon">
				<a href="<?php 
        echo $link;
        ?>
">
					<?php 
        echo JHTML::_('image.site', $image, '/templates/' . $template . '/images/header/', NULL, NULL, $text);
        ?>
					<span><?php 
        echo $text;
        ?>
</span></a>
			</div>
		</div>
		<?php 
    }
Example #12
0
 function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     if (!isset($this->params)) {
         $plugin = JPluginHelper::getPlugin('system', 'hikashopuser');
         if (version_compare(JVERSION, '2.5', '<')) {
             jimport('joomla.html.parameter');
             $this->params = new JParameter($plugin->params);
         } else {
             $this->params = new JRegistry($plugin->params);
         }
     }
     $app = JFactory::getApplication();
     $this->cart = $app->getUserState('com_hikashop.cart_id');
     $this->wishlist = $app->getUserState('com_hikashop.wishlist_id');
     $this->currency = $app->getUserState('com_hikashop.currency_id');
     $this->entries = $app->getUserState('com_hikashop.entries_fields');
     $this->checkout_fields_ok = $app->getUserState('com_hikashop.checkout_fields_ok', 0);
     $this->checkout_fields = $app->getUserState('com_hikashop.checkout_fields');
     $app = JFactory::getApplication();
     if ($app->isAdmin() && @$_GET['option'] == 'com_plugins' && @$_GET['view'] == 'plugin' && (@$_GET['layout'] == 'edit' || @$_GET['task'] == 'edit')) {
         $lang = JFactory::getLanguage();
         $lang->load('com_hikashop', JPATH_SITE, null, true);
     }
 }
	public function postflight(){	
		define('_FM_COM', 'com_profiles');
		if(!defined('DS')) define('DS',DIRECTORY_SEPARATOR);	
		
		$lang = JFactory::getLanguage();
		define('_MY_LANGUAGE',$lang->getTag());
		define('_CLOSE_HREF','index.php');
			
		$ABSOLUTE_URI = (getenv('HTTPS') == 'on') ? substr_replace( str_replace("http://", "https://", JURI::base() ), '', -1, 1) : substr_replace(JURI::base(), '', -1, 1) . "/";
		define('_FM_ABSOLUTE_URI',$ABSOLUTE_URI);
		define('_FM_HOME_URL', "index.php?option="._FM_COM."&format=raw");
		define('_FM_HOME_FOLDER','components/'._FM_COM.'/filemanager');
		define('_FM_HOME_DIR', JPATH_ROOT . '/administrator/components/'._FM_COM.'/filemanager');
		define('_FM_LANGUAGE_DIR', _FM_HOME_DIR. DS.'languages');
		define('_FM_COOKIE_EXPIRE', time()+60*60*24*60);
		// Define Peer
		define('_FM_PEER','joomla');
			
		require_once _FM_HOME_DIR . DS . 'classes'.DS.'file.php';
		require_once _FM_HOME_DIR . DS . 'classes'.DS.'text.php';
		require_once _FM_HOME_DIR . DS .'includes'.DS.'version.php';
		
		$infoTemplates = _FM_HOME_DIR . DS ."languages" . DS . "info";
		
		$infoPath = $infoTemplates . DS . _MY_LANGUAGE . ".php" ;
		if(!MFile::is($infoPath)){
			$infoPath = $infoTemplates . DS . "en-GB.php";
		}
		
		$isWelcome = 1;
		$jed = null;
		$version=null;
		require_once $infoPath;
		
	}  //EOF install
Example #14
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title($isNew ? JText::_('COM_TEMPLATES_MANAGER_ADD_STYLE') : JText::_('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'thememanager');
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         JToolBarHelper::apply('style.apply');
         JToolBarHelper::save('style.save');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('style.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('style.cancel');
     } else {
         JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     // Get the help information for the template item.
     $lang = JFactory::getLanguage();
     $help = $this->get('Help');
     if ($lang->hasKey($help->url)) {
         $debug = $lang->setDebug(false);
         $url = JText::_($help->url);
         $lang->setDebug($debug);
     } else {
         $url = null;
     }
     JToolBarHelper::help($help->key, false, $url);
 }
 /**
  * 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;
 }
Example #16
0
 /**
  * Method to get a list of content types
  *
  * @return  array  The field option objects.
  *
  * @since   3.1
  */
 protected function getOptions()
 {
     $lang = JFactory::getLanguage();
     $db = JFactory::getDbo();
     $query = $db->getQuery(true)->select('a.type_id AS value, a.type_title AS text, a.type_alias AS alias')->from('#__content_types AS a')->order('a.type_title ASC');
     // Get the options.
     $db->setQuery($query);
     try {
         $options = $db->loadObjectList();
     } catch (RuntimeException $e) {
         return false;
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     foreach ($options as $option) {
         // Make up the string from the component sys.ini file
         $parts = explode('.', $option->alias);
         $comp = array_shift($parts);
         // Make sure the component sys.ini is loaded
         $lang->load($comp . '.sys', JPATH_ADMINISTRATOR, null, false, true) || $lang->load($comp . '.sys', JPATH_ADMINISTRATOR . '/components/' . $comp, null, false, true);
         $option->string = implode('_', $parts);
         $option->string = $comp . '_CONTENT_TYPE_' . $option->string;
         if ($lang->hasKey($option->string)) {
             $option->text = JText::_($option->string);
         }
     }
     return $options;
 }
 /**
  * Constructor
  *
  * For php4 compatability we must not use the __constructor as a constructor for plugins
  * because func_get_args ( void ) returns a copy of all passed arguments NOT references.
  * This causes problems with cross-referencing necessary for the observer design pattern.
  *
  * @param object $subject The object to observe
  * @param 	array  $config  An array that holds the plugin configuration
  * @since 1.5
  */
 function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $language = JFactory::getLanguage();
     $language->load('plg_citruscart_' . $this->_element, JPATH_ADMINISTRATOR, 'en-GB', true);
     $language->load('plg_citruscart_' . $this->_element, JPATH_ADMINISTRATOR, null, true);
 }
    public function addIcon($image, $url, $text, $newWindow = false)
    {
        $lang =& JFactory::getLanguage();
        $newWindow = $newWindow ? ' target="_blank"' : '';
        ?>
		<div style="float:<?php 
        echo $lang->isRTL() ? 'right' : 'left';
        ?>
;">
			<div class="icon">
				<a href="<?php 
        echo $url;
        ?>
"<?php 
        echo $newWindow;
        ?>
>
					<?php 
        echo JHTML::_('image', 'administrator/components/com_joomleague/assets/icons/' . $image, NULL, NULL);
        ?>
					<span><?php 
        echo $text;
        ?>
</span></a>
			</div>
		</div>
<?php 
    }
 /**
  * Constructor
  *
  * For php4 compatability we must not use the __constructor as a constructor for plugins
  * because func_get_args ( void ) returns a copy of all passed arguments NOT references.
  * This causes problems with cross-referencing necessary for the observer design pattern.
  *
  * @param object $subject The object to observe
  * @param 	array  $config  An array that holds the plugin configuration
  * @since 1.5
  */
 function plgTiendaReport_salesbymanufacturer(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $language = JFactory::getLanguage();
     $language->load('plg_tienda_' . $this->_element, JPATH_ADMINISTRATOR, 'en-GB', true);
     $language->load('plg_tienda_' . $this->_element, JPATH_ADMINISTRATOR, null, true);
 }
Example #20
0
 protected function addToolbar($title = '', $name = '')
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $bar = JToolBar::getInstance('toolbar');
     $lang = JFactory::getLanguage();
     require_once JPATH_COMPONENT . '/helpers/toolbar/link.php';
     if ($this->isNew) {
         $key = 'APP_CCK_FORM_' . $name . '_TITLE_ADD';
         if ($lang->hasKey($key) == 1) {
             $title = JText::_($key);
         } else {
             $key = 'COM_CCK_TITLE_FORM_ADD_' . str_replace(' ', '_', $title);
             $title = $lang->hasKey($key) == 1 ? JText::_($key) : JText::_('COM_CCK_TITLE_ADD') . ' ' . $title;
         }
         JToolBarHelper::title($title, 'pencil-2');
         $bar->prependButton('CckLink', 'cancel', 'JTOOLBAR_CANCEL', 'javascript:JCck.Core.submit(\'form.cancel\');');
     } else {
         $key = 'APP_CCK_FORM_' . $name . '_TITLE_EDIT';
         if ($lang->hasKey($key) == 1) {
             $title = JText::_($key);
         } else {
             $key = 'COM_CCK_TITLE_FORM_EDIT_' . str_replace(' ', '_', $title);
             $title = $lang->hasKey($key) == 1 ? JText::_($key) : JText::_('COM_CCK_TITLE_EDIT') . ' ' . $title;
         }
         JToolBarHelper::title($title, 'pencil-2');
         $bar->prependButton('CckLink', 'cancel', 'JTOOLBAR_CLOSE', 'javascript:JCck.Core.submit(\'form.cancel\');');
     }
     $bar->prependButton('CckLink', 'save-new', 'JTOOLBAR_SAVE_AND_NEW', 'javascript:JCck.Core.submit(\'form.save2new\');');
     $bar->prependButton('CckLink', 'save', 'JTOOLBAR_SAVE', 'javascript:JCck.Core.submit(\'form.save\');');
     $bar->prependButton('CckLink', 'apply', 'JTOOLBAR_APPLY', 'javascript:JCck.Core.submit(\'form.apply\');');
 }
 function getObjectTitle($id)
 {
     // Gallery comments
     $language = JFactory::getLanguage();
     $language->load('com_joomgallery', JPATH_ROOT);
     return JText::_('JGS_COMMON_GALLERY');
 }
Example #22
0
 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;
 }
Example #23
0
 /**
  * Configure the Submenu links.
  *
  * @param   string    The extension being used for the categories.
  *
  * @return  void
  * @since   1.6
  */
 public static function addSubmenu($extension)
 {
     // Avoid nonsense situation.
     if ($extension == 'com_categories') {
         return;
     }
     $parts = explode('.', $extension);
     $component = $parts[0];
     if (count($parts) > 1) {
         $section = $parts[1];
     }
     // Try to find the component helper.
     $eName = str_replace('com_', '', $component);
     $file = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/helpers/' . $eName . '.php');
     if (file_exists($file)) {
         require_once $file;
         $prefix = ucfirst(str_replace('com_', '', $component));
         $cName = $prefix . 'Helper';
         if (class_exists($cName)) {
             if (is_callable(array($cName, 'addSubmenu'))) {
                 $lang = JFactory::getLanguage();
                 // loading language file from the administrator/language directory then
                 // loading language file from the administrator/components/*extension*/language directory
                 $lang->load($component, JPATH_BASE, null, false, false) || $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, false) || $lang->load($component, JPATH_BASE, $lang->getDefault(), false, false) || $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), $lang->getDefault(), false, false);
                 call_user_func(array($cName, 'addSubmenu'), 'categories' . (isset($section) ? '.' . $section : ''));
             }
         }
     }
 }
Example #24
0
 /**
  * Custom loadLanguage method
  *
  * @access	public
  * @param	string	$path the path where to find language files
  * @since	1.6
  */
 public function loadLanguage($path = null)
 {
     $source = $this->parent->getPath('source');
     if (!$source) {
         $this->parent->setPath('source', JPATH_PLUGINS . '/' . $this->parent->extension->folder . '/' . $this->parent->extension->element);
     }
     $this->manifest = $this->parent->getManifest();
     $element = $this->manifest->files;
     if ($element) {
         $group = strtolower((string) $this->manifest->attributes()->group);
         $name = '';
         if (count($element->children())) {
             foreach ($element->children() as $file) {
                 if ((string) $file->attributes()->plugin) {
                     $name = strtolower((string) $file->attributes()->plugin);
                     break;
                 }
             }
         }
         if ($name) {
             $extension = "plg_{$group}_{$name}";
             $lang = JFactory::getLanguage();
             $source = $path ? $path : JPATH_PLUGINS . "/{$group}/{$name}";
             $folder = (string) $element->attributes()->folder;
             if ($folder && file_exists("{$path}/{$folder}")) {
                 $source = "{$path}/{$folder}";
             }
             $lang->load($extension . '.sys', $source, null, false, false) || $lang->load($extension . '.sys', JPATH_ADMINISTRATOR, null, false, false) || $lang->load($extension . '.sys', $source, $lang->getDefault(), false, false) || $lang->load($extension . '.sys', JPATH_ADMINISTRATOR, $lang->getDefault(), false, false);
         }
     }
 }
Example #25
0
 /**
  *  Prepare content method
  *
  * Method is called by the view
  *
  * @param   string  $context  The context of the content being passed to the plugin.
  * @param   object  &$row     The article object.  Note $article->text is also available
  * @param   object  &$params  The article params
  * @param   int     $page     The 'page' number
  *
  * @return  void
  */
 public function onContentPrepare($context, &$row, &$params, $page = 0)
 {
     jimport('joomla.html.parameter');
     jimport('joomla.filesystem.file');
     // Load fabrik language
     $lang = JFactory::getLanguage();
     $lang->load('com_fabrik', JPATH_BASE . '/components/com_fabrik');
     if (!defined('COM_FABRIK_FRONTEND')) {
         JError::raiseError(400, JText::_('COM_FABRIK_SYSTEM_PLUGIN_NOT_ACTIVE'));
     }
     // Get plugin info
     $plugin = JPluginHelper::getPlugin('content', 'fabrik');
     // $$$ hugh had to rename this, it was stomping on com_content and friends $params
     // $$$ which is passed by reference to us!
     $fparams = new JRegistry($plugin->params);
     // Simple performance check to determine whether bot should process further
     $botRegex = $fparams->get('Botregex') != '' ? $fparams->get('Botregex') : 'fabrik';
     if (JString::strpos($row->text, $botRegex) === false) {
         return true;
     }
     require_once COM_FABRIK_FRONTEND . '/helpers/parent.php';
     /* $$$ hugh - hacky fix for nasty issue with IE, which (for gory reasons) doesn't like having our JS content
      * wrapped in P tags.  But the default WYSIWYG editor in J! will automagically wrap P tags around everything.
      * So let's just look for obvious cases of <p>{fabrik ...}</p>, and replace the P's with DIV's.
      * Yes, it's hacky, but it'll save us a buttload of support work.
      */
     $pregex = "/<p>\\s*{" . $botRegex . "\\s*.*?}\\s*<\\/p>/i";
     $row->text = preg_replace_callback($pregex, array($this, 'preplace'), $row->text);
     // $$$ hugh - having to change this to use {[]}
     $regex = "/{" . $botRegex . "\\s*.*?}/i";
     $row->text = preg_replace_callback($regex, array($this, 'replace'), $row->text);
 }
Example #26
0
 function __construct($form = null)
 {
     // Must load admin language files
     $lang = JFactory::getLanguage();
     $lang->load("com_jevents", JPATH_ADMINISTRATOR);
     parent::__construct($form);
 }
Example #27
0
 function submissionsViewFile()
 {
     $lang = JFactory::getLanguage();
     $lang->load('com_rsform', JPATH_ADMINISTRATOR);
     $hash = JRequest::getCmd('hash');
     if (strlen($hash) != 32) {
         return $this->setRedirect('index.php');
     }
     $config = JFactory::getConfig();
     $secret = $config->getValue('config.secret');
     $this->_db->setQuery("SELECT * FROM #__rsform_submission_values WHERE MD5(CONCAT(SubmissionId,'" . $this->_db->getEscaped($secret) . "',FieldName)) = '" . $hash . "'");
     $result = $this->_db->loadObject();
     // Not found
     if (empty($result)) {
         return $this->setRedirect('index.php');
     }
     // Not an upload field
     $this->_db->setQuery("SELECT c.ComponentTypeId FROM #__rsform_properties p LEFT JOIN #__rsform_components c ON (p.ComponentId=c.ComponentId) WHERE p.PropertyName='NAME' AND p.PropertyValue='" . $this->_db->getEscaped($result->FieldName) . "'");
     $type = $this->_db->loadResult();
     if ($type != 9) {
         return $this->setRedirect('index.php', JText::_('RSFP_VIEW_FILE_NOT_UPLOAD'));
     }
     jimport('joomla.filesystem.file');
     if (JFile::exists($result->FieldValue)) {
         RSFormProHelper::readFile($result->FieldValue);
     }
     $this->setRedirect('index.php', JText::_('RSFP_VIEW_FILE_NOT_FOUND'));
 }
Example #28
0
 /**
  * Custom loadLanguage method
  *
  * @param   string  $path  The path where we find language files
  *
  * @return  void
  *
  * @since   11.1
  */
 public function loadLanguage($path = null)
 {
     $source = $this->parent->getPath('source');
     if (!$source) {
         $this->parent->setPath('source', ($this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/modules/' . $this->parent->extension->element);
     }
     $this->manifest = $this->parent->getManifest();
     if ($this->manifest->files) {
         $element = $this->manifest->files;
         $extension = '';
         if (count($element->children())) {
             foreach ($element->children() as $file) {
                 if ((string) $file->attributes()->module) {
                     $extension = strtolower((string) $file->attributes()->module);
                     break;
                 }
             }
         }
         if ($extension) {
             $lang = JFactory::getLanguage();
             $source = $path ? $path : ($this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/modules/' . $extension;
             $folder = (string) $element->attributes()->folder;
             if ($folder && file_exists($path . '/' . $folder)) {
                 $source = $path . '/' . $folder;
             }
             $client = (string) $this->manifest->attributes()->client;
             $lang->load($extension . '.sys', $source, null, false, false) || $lang->load($extension . '.sys', constant('JPATH_' . strtoupper($client)), null, false, false) || $lang->load($extension . '.sys', $source, $lang->getDefault(), false, false) || $lang->load($extension . '.sys', constant('JPATH_' . strtoupper($client)), $lang->getDefault(), false, false);
         }
     }
 }
 protected function _getFieldTypes()
 {
     $data = array();
     $core_path = COM_TZ_PORTFOLIO_PLUS_ADDON_PATH . DIRECTORY_SEPARATOR . 'extrafields';
     if ($plg_ex = TZ_Portfolio_PlusPluginHelper::getPlugin('extrafields')) {
         $lang = JFactory::getLanguage();
         $field = $this->form->getData();
         $field = $field->toObject();
         foreach ($plg_ex as $i => $plg) {
             $folder = $plg->name;
             $core_f_xml_path = $core_path . DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR . $folder . '.xml';
             if (JFile::exists($core_f_xml_path)) {
                 $core_class = 'TZ_Portfolio_PlusExtraField' . $folder;
                 if (!class_exists($core_class)) {
                     JLoader::import('com_tz_portfolio_plus.addons.extrafields.' . $folder . '.' . $folder, JPATH_SITE . DIRECTORY_SEPARATOR . 'components');
                 }
                 $core_class = new $core_class($field);
                 $data[$i] = new stdClass();
                 $data[$i]->value = $folder;
                 $core_class->loadLanguage($folder);
                 $key_lang = 'PLG_EXTRAFIELDS_' . strtoupper($folder) . '_TITLE';
                 if ($lang->hasKey($key_lang)) {
                     $data[$i]->text = JText::_($key_lang);
                 } else {
                     $data[$i]->text = (string) $folder;
                 }
             }
         }
     }
     return $data;
 }
Example #30
-3
 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  *
  * @since   11.4
  */
 protected function getOptions()
 {
     // Initialise variables
     $folder = $this->element['folder'];
     if (!empty($folder)) {
         // Get list of plugins
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select('element AS value, name AS text');
         $query->from('#__extensions');
         $query->where('folder = ' . $db->q($folder));
         $query->where('enabled = 1');
         $query->order('ordering, name');
         $db->setQuery($query);
         $options = $db->loadObjectList();
         $lang = JFactory::getLanguage();
         foreach ($options as $i => $item) {
             $source = JPATH_PLUGINS . '/' . $folder . '/' . $item->value;
             $extension = 'plg_' . $folder . '_' . $item->value;
             $lang->load($extension . '.sys', JPATH_ADMINISTRATOR, null, false, false) || $lang->load($extension . '.sys', $source, null, false, false) || $lang->load($extension . '.sys', JPATH_ADMINISTRATOR, $lang->getDefault(), false, false) || $lang->load($extension . '.sys', $source, $lang->getDefault(), false, false);
             $options[$i]->text = JText::_($item->text);
         }
         if ($db->getErrorMsg()) {
             JError::raiseWarning(500, JText::_('JFRAMEWORK_FORM_FIELDS_PLUGINS_ERROR_FOLDER_EMPTY'));
             return '';
         }
     } else {
         JError::raiseWarning(500, JText::_('JFRAMEWORK_FORM_FIELDS_PLUGINS_ERROR_FOLDER_EMPTY'));
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }