Exemple #1
0
 /**
  * Basically a copy of the getOptions method from the helpsite form field
  */
 protected function getSites()
 {
     jimport('joomla.language.help');
     // Merge any additional options in the XML definition.
     $options = JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml');
     return $options;
 }
Exemple #2
0
 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);
 }
Exemple #3
0
 /**
  * Get the JavaScript command for the button
  *
  * @access	private
  * @param	object	$definition	Button definition
  * @return	string	JavaScript command string
  * @since	1.5
  */
 function _getCommand($ref, $com)
 {
     // Get Help URL
     jimport('joomla.language.help');
     $url = JHelp::createURL($ref, $com);
     $cmd = "popupWindow('{$url}', '" . JText::_('Help', true) . "', 640, 480, 1)";
     return $cmd;
 }
Exemple #4
0
 /**
  * Get the JavaScript command for the button
  *
  * @param   string   $ref        The name of the help screen (its key reference).
  * @param   boolean  $com        Use the help file in the component directory.
  * @param   string   $override   Use this URL instead of any other.
  * @param   string   $component  Name of component to get Help (null for current component)
  *
  * @return  string   JavaScript command string
  *
  * @since   12.1
  */
 protected function _getCommand($ref, $com, $override, $component)
 {
     // Get Help URL
     $url = JHelp::createURL($ref, $com, $override, $component);
     $url = htmlspecialchars($url, ENT_QUOTES);
     $cmd = "Joomla.popupWindow('{$url}', '" . JText::_('JHELP', true) . "', 700, 500, 1)";
     return $cmd;
 }
Exemple #5
0
 /**
  * Method to get the page
  */
 public function &getPage()
 {
     if (is_null($this->page)) {
         $page = JFactory::getApplication()->input->get('page', 'JHELP_START_HERE');
         $this->page = JHelp::createUrl($page);
     }
     return $this->page;
 }
 /**
  * Method to get the help site field options.
  *
  * @return  array  The field option objects.
  *
  * @since   11.1
  */
 protected function getOptions()
 {
     // Get Joomla version.
     $version = new JVersion();
     $jver = explode('.', $version->getShortVersion());
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml', $this->value));
     return $options;
 }
Exemple #7
0
 /**
  * Get the JavaScript command for the button
  *
  * @param   string   $ref		The name of the help screen (its key reference).
  * @param   boolean  $com		Use the help file in the component directory.
  * @param   string   $override	Use this URL instead of any other.
  * @param   string   $component	Name of component to get Help (null for current component)
  *
  * @return  string   JavaScript command string
  * @since   11.1
  */
 protected function _getCommand($ref, $com, $override, $component, $width, $height)
 {
     // Get Help URL
     jimport('joomla.language.help');
     $url = JHelp::createURL($ref, $com, $override, $component);
     $url = htmlspecialchars($url, ENT_QUOTES);
     $cmd = "popupWindow('{$url}', '" . JText::_('JHELP', true) . "', {$width}, {$height}, 1)";
     return $cmd;
 }
Exemple #8
0
 /**
  *
  * @since   11.1
  *
  * @deprecated
  */
 public function fetchElement($name, $value, &$node, $control_name)
 {
     jimport('joomla.language.help');
     // Get Joomla version.
     $version = new JVersion();
     $jver = explode('.', $version->getShortVersion());
     $helpsites = JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml', $value);
     array_unshift($helpsites, JHtml::_('select.option', '', JText::_('local')));
     return JHtml::_('select.genericlist', $helpsites, $control_name . '[' . $name . ']', array('id' => $control_name . $name, 'list.attr' => 'class="inputbox"', 'list.select' => $value));
 }
 /**
  * Method to get the help site field options.
  *
  * @return  array  The field option objects.
  *
  * @since   1.6.0
  */
 protected function getOptions()
 {
     // Merge any additional options in the XML definition.
     $opts = array();
     if (file_exists(PATH_CORE . '/help/helpsites.xml')) {
         $opts = JHelp::createSiteList(PATH_CORE . '/help/helpsites.xml', $this->value);
     } else {
         $opts[] = JHtml::_('select.option', 'English (GB) - HUBzero help', 'http://hubzero.org/documentation/');
     }
     $options = array_merge(parent::getOptions(), $opts);
     return $options;
 }
 /**
  * Returns the updated options for help site selector
  *
  * @return  void
  *
  * @since   3.5
  * @throws  Exception
  */
 public function gethelpsites()
 {
     jimport('joomla.filesystem.file');
     // Set FTP credentials, if given
     JClientHelper::setCredentialsFromRequest('ftp');
     if (($data = file_get_contents('https://update.joomla.org/helpsites/helpsites.xml')) === false) {
         throw new Exception(JText::_('COM_CONFIG_ERROR_HELPREFRESH_FETCH'), 500);
     } elseif (!JFile::write(JPATH_ADMINISTRATOR . '/help/helpsites.xml', $data)) {
         throw new Exception(JText::_('COM_CONFIG_ERROR_HELPREFRESH_ERROR_STORE'), 500);
     }
     $options = array_merge(array(JHtml::_('select.option', '', JText::_('JOPTION_USE_DEFAULT'))), JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml'));
     echo json_encode($options);
     JFactory::getApplication()->close();
 }
Exemple #11
0
 /**
  * Fetch a calendar element
  *
  * @param   string  $name          Element name
  * @param   string  $value         Element value
  * @param   object  &$node         XMLElement node object containing the settings for the element
  * @param   string  $control_name  Control name
  * @return  string
  */
 public function fetchElement($name, $value, &$node, $control_name)
 {
     $helpsites = \JHelp::createSiteList(PATH_CORE . '/help/helpsites.xml', $value);
     array_unshift($helpsites, Builder\Select::option('', \App::get('language')->txt('local')));
     return Builder\Select::genericlist($helpsites, $control_name . '[' . $name . ']', array('id' => $control_name . $name, 'list.attr' => 'class="inputbox"', 'list.select' => $value));
 }
Exemple #12
0
 /**
  * Method to get the latest version check
  *
  * @return  string  Latest Version Check URL
  */
 public function &getLatestVersionCheck()
 {
     if (!$this->latest_version_check) {
         $override = 'http://help.joomla.org/proxy/index.php?option=com_help&keyref=Help{major}{minor}:Joomla_Version_{major}_{minor}_{maintenance}';
         $this->latest_version_check = JHelp::createUrl('JVERSION', false, $override);
     }
     return $this->latest_version_check;
 }
Exemple #13
0
			<legend><?php 
echo JText::_('Admin_Alphabetical_Index');
?>
</legend>

			<div class="helpIndex">
				<ul class="subext">
					<?php 
foreach ($this->toc as $k => $v) {
    ?>
						<li>
							<?php 
    if ($this->help_url) {
        ?>
								<?php 
        echo JHtml::_('link', JHelp::createUrl($k), $v, array('target' => 'helpFrame'));
        ?>
							<?php 
    } else {
        ?>
								<?php 
        echo JHtml::_('link', JURI::base() . 'help/' . $this->lang_tag . '/' . $k, $v, array('target' => 'helpFrame'));
        ?>
							<?php 
    }
    ?>
						</li>
					<?php 
}
?>
				</ul>
Exemple #14
0
 /**
  * Load a template file -- This is a special implementation that tries to find the files within the distribution help
  * dir first. There localized versions of these files can be stored!
  *
  * @access	public
  * @param string $tpl The name of the template source file ...
  * automatically searches the template paths and compiles as needed.
  * @return string The output of the the template script.
  */
 public function loadTemplate($tpl = null)
 {
     global $mainframe, $option;
     // clear prior output
     $this->_output = null;
     $file = isset($tpl) ? $this->_layout . '_' . $tpl : $this->_layout;
     // Add specific prefix to the file for usage within the help directry
     $file = 'help.' . $file;
     // clean the file name
     $file = preg_replace('/[^A-Z0-9_\\.-]/i', '', $file);
     // Get Help URL
     jimport('joomla.language.help');
     $filetofind = JHelp::createURL($file, true);
     // TODO: reactivate - this construct can not deal with symbolic links!
     //$this->_template = JPath::find(JPATH_ADMINISTRATOR, $filetofind);
     $fullname = JPATH_ADMINISTRATOR . DS . $filetofind;
     $this->_template = JFile::exists($fullname) ? $fullname : false;
     if ($this->_template != false) {
         // unset so as not to introduce into template scope
         unset($tpl);
         unset($file);
         // never allow a 'this' property
         if (isset($this->this)) {
             unset($this->this);
         }
         // start capturing output into a buffer
         ob_start();
         // include the requested template filename in the local scope
         // (this will execute the view logic).
         include $this->_template;
         // done with the requested template; get the buffer and
         // clear it.
         $this->_output = ob_get_contents();
         ob_end_clean();
         return $this->_output;
     } else {
         return parent::loadTemplate($tpl);
     }
 }
Exemple #15
0
 function replaceToolbar($body)
 {
     $t3toolbar = T3_ADMIN_PATH . '/admin/tpls/toolbar.php';
     $input = JFactory::getApplication()->input;
     if (file_exists($t3toolbar) && class_exists('JToolBar')) {
         //get the existing toolbar html
         jimport('joomla.language.help');
         $params = T3::getTplParams();
         $toolbar = JToolBar::getInstance('toolbar')->render('toolbar');
         $helpurl = JHelp::createURL($input->getCmd('view') == 'template' ? 'JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT' : 'JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES_EDIT');
         $helpurl = htmlspecialchars($helpurl, ENT_QUOTES);
         //render our toolbar
         ob_start();
         include $t3toolbar;
         $t3toolbar = ob_get_clean();
         //replace it
         $body = str_replace($toolbar, $t3toolbar, $body);
     }
     return $body;
 }
Exemple #16
0
 /**
  * Show the configuration edit form
  * @param string The URL option
  */
 function showConfig()
 {
     // Initialize some variables
     $db =& JFactory::getDBO();
     $row = new JConfig();
     // compile list of the languages
     $langs = array();
     $menuitems = array();
     $lists = array();
     // PRE-PROCESS SOME LIST
     // -- Editors --
     // compile list of the editors
     $query = 'SELECT element AS value, name AS text' . ' FROM #__plugins' . ' WHERE folder = "editors"' . ' AND published = 1' . ' ORDER BY ordering, name';
     $db->setQuery($query);
     $edits = $db->loadObjectList();
     // -- Show/Hide --
     $show_hide = array(JHTML::_('select.option', 1, JText::_('Hide')), JHTML::_('select.option', 0, JText::_('Show')));
     $show_hide_r = array(JHTML::_('select.option', 0, JText::_('Hide')), JHTML::_('select.option', 1, JText::_('Show')));
     // -- menu items --
     $query = 'SELECT id AS value, name AS text FROM #__menu' . ' WHERE ( type="content_section" OR type="components" OR type="content_typed" )' . ' AND published = 1' . ' AND access = 0' . ' ORDER BY name';
     $db->setQuery($query);
     $menuitems = array_merge($menuitems, $db->loadObjectList());
     // SITE SETTINGS
     $lists['offline'] = JHTML::_('select.booleanlist', 'offline', 'class="inputbox"', $row->offline);
     if (!$row->editor) {
         $row->editor = '';
     }
     // build the html select list
     $lists['editor'] = JHTML::_('select.genericlist', $edits, 'editor', 'class="inputbox" size="1"', 'value', 'text', $row->editor);
     $listLimit = array(JHTML::_('select.option', 5, 5), JHTML::_('select.option', 10, 10), JHTML::_('select.option', 15, 15), JHTML::_('select.option', 20, 20), JHTML::_('select.option', 25, 25), JHTML::_('select.option', 30, 30), JHTML::_('select.option', 50, 50), JHTML::_('select.option', 100, 100));
     $lists['list_limit'] = JHTML::_('select.genericlist', $listLimit, 'list_limit', 'class="inputbox" size="1"', 'value', 'text', $row->list_limit ? $row->list_limit : 50);
     jimport('joomla.language.help');
     $helpsites = array();
     $helpsites = JHelp::createSiteList(JPATH_BASE . DS . 'help' . DS . 'helpsites-15.xml', $row->helpurl);
     array_unshift($helpsites, JHTML::_('select.option', '', JText::_('local')));
     $lists['helpsites'] = JHTML::_('select.genericlist', $helpsites, 'helpurl', ' class="inputbox"', 'value', 'text', $row->helpurl);
     // DEBUG
     $lists['debug'] = JHTML::_('select.booleanlist', 'debug', 'class="inputbox"', $row->debug);
     $lists['debug_lang'] = JHTML::_('select.booleanlist', 'debug_lang', 'class="inputbox"', $row->debug_lang);
     // DATABASE SETTINGS
     // SERVER SETTINGS
     $lists['gzip'] = JHTML::_('select.booleanlist', 'gzip', 'class="inputbox"', $row->gzip);
     $errors = array(JHTML::_('select.option', -1, JText::_('System Default')), JHTML::_('select.option', 0, JText::_('None')), JHTML::_('select.option', E_ERROR | E_WARNING | E_PARSE, JText::_('Simple')), JHTML::_('select.option', E_ALL, JText::_('Maximum')));
     $lists['xmlrpc_server'] = JHTML::_('select.booleanlist', 'xmlrpc_server', 'class="inputbox"', $row->xmlrpc_server);
     $lists['error_reporting'] = JHTML::_('select.genericlist', $errors, 'error_reporting', 'class="inputbox" size="1"', 'value', 'text', $row->error_reporting);
     $lists['enable_ftp'] = JHTML::_('select.booleanlist', 'ftp_enable', 'class="inputbox"', intval($row->ftp_enable));
     $forceSSL = array(JHTML::_('select.option', 0, JText::_('None')), JHTML::_('select.option', 1, JText::_('Administrator Only')), JHTML::_('select.option', 2, JText::_('Entire Site')));
     $lists['force_ssl'] = JHTML::_('select.genericlist', $forceSSL, 'force_ssl', 'class="inputbox" size="1"', 'value', 'text', @$row->force_ssl);
     // LOCALE SETTINGS
     $timeoffset = array(JHTML::_('select.option', -12, JText::_('(UTC -12:00) International Date Line West')), JHTML::_('select.option', -11, JText::_('(UTC -11:00) Midway Island, Samoa')), JHTML::_('select.option', -10, JText::_('(UTC -10:00) Hawaii')), JHTML::_('select.option', -9.5, JText::_('(UTC -09:30) Taiohae, Marquesas Islands')), JHTML::_('select.option', -9, JText::_('(UTC -09:00) Alaska')), JHTML::_('select.option', -8, JText::_('(UTC -08:00) Pacific Time (US &amp; Canada)')), JHTML::_('select.option', -7, JText::_('(UTC -07:00) Mountain Time (US &amp; Canada)')), JHTML::_('select.option', -6, JText::_('(UTC -06:00) Central Time (US &amp; Canada), Mexico City')), JHTML::_('select.option', -5, JText::_('(UTC -05:00) Eastern Time (US &amp; Canada), Bogota, Lima')), JHTML::_('select.option', -4.5, JText::_('(UTC -04:30) Venezuela')), JHTML::_('select.option', -4, JText::_('(UTC -04:00) Atlantic Time (Canada), Caracas, La Paz')), JHTML::_('select.option', -3.5, JText::_('(UTC -03:30) St. John\'s, Newfoundland, Labrador')), JHTML::_('select.option', -3, JText::_('(UTC -03:00) Brazil, Buenos Aires, Georgetown')), JHTML::_('select.option', -2, JText::_('(UTC -02:00) Mid-Atlantic')), JHTML::_('select.option', -1, JText::_('(UTC -01:00) Azores, Cape Verde Islands')), JHTML::_('select.option', 0, JText::_('(UTC 00:00) Western Europe Time, London, Lisbon, Casablanca')), JHTML::_('select.option', 1, JText::_('(UTC +01:00) Amsterdam, Berlin, Brussels, Copenhagen, Madrid, Paris')), JHTML::_('select.option', 2, JText::_('(UTC +02:00) Istanbul, Jerusalem, Kaliningrad, South Africa')), JHTML::_('select.option', 3, JText::_('(UTC +03:00) Baghdad, Riyadh, Moscow, St. Petersburg')), JHTML::_('select.option', 3.5, JText::_('(UTC +03:30) Tehran')), JHTML::_('select.option', 4, JText::_('(UTC +04:00) Abu Dhabi, Muscat, Baku, Tbilisi')), JHTML::_('select.option', 4.5, JText::_('(UTC +04:30) Kabul')), JHTML::_('select.option', 5, JText::_('(UTC +05:00) Ekaterinburg, Islamabad, Karachi, Tashkent')), JHTML::_('select.option', 5.5, JText::_('(UTC +05:30) Bombay, Calcutta, Madras, New Delhi, Colombo')), JHTML::_('select.option', 5.75, JText::_('(UTC +05:45) Kathmandu')), JHTML::_('select.option', 6, JText::_('(UTC +06:00) Almaty, Dhaka')), JHTML::_('select.option', 6.5, JText::_('(UTC +06:30) Yagoon')), JHTML::_('select.option', 7, JText::_('(UTC +07:00) Bangkok, Hanoi, Jakarta')), JHTML::_('select.option', 8, JText::_('(UTC +08:00) Beijing, Perth, Singapore, Hong Kong')), JHTML::_('select.option', 8.75, JText::_('(UTC +08:00) Ulaanbaatar, Western Australia')), JHTML::_('select.option', 9, JText::_('(UTC +09:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk')), JHTML::_('select.option', 9.5, JText::_('(UTC +09:30) Adelaide, Darwin, Yakutsk')), JHTML::_('select.option', 10, JText::_('(UTC +10:00) Eastern Australia, Guam, Vladivostok')), JHTML::_('select.option', 10.5, JText::_('(UTC +10:30) Lord Howe Island (Australia)')), JHTML::_('select.option', 11, JText::_('(UTC +11:00) Magadan, Solomon Islands, New Caledonia')), JHTML::_('select.option', 11.5, JText::_('(UTC +11:30) Norfolk Island')), JHTML::_('select.option', 12, JText::_('(UTC +12:00) Auckland, Wellington, Fiji, Kamchatka')), JHTML::_('select.option', 12.75, JText::_('(UTC +12:45) Chatham Island')), JHTML::_('select.option', 13, JText::_('(UTC +13:00) Tonga')), JHTML::_('select.option', 14, JText::_('(UTC +14:00) Kiribati')));
     $lists['offset'] = JHTML::_('select.genericlist', $timeoffset, 'offset', 'class="inputbox" size="1"', 'value', 'text', $row->offset);
     // MAIL SETTINGS
     $mailer = array(JHTML::_('select.option', 'mail', JText::_('PHP mail function')), JHTML::_('select.option', 'sendmail', JText::_('Sendmail')), JHTML::_('select.option', 'smtp', JText::_('SMTP Server')));
     $lists['mailer'] = JHTML::_('select.genericlist', $mailer, 'mailer', 'class="inputbox" size="1"', 'value', 'text', $row->mailer);
     $smtpsecure = array(JHTML::_('select.option', 'none', JText::_('None')), JHTML::_('select.option', 'ssl', 'SSL'), JHTML::_('select.option', 'tls', 'TLS'));
     $lists['smtpsecure'] = JHTML::_('select.genericlist', $smtpsecure, 'smtpsecure', 'class="inputbox" size="1"', 'value', 'text', isset($row->smtpsecure) ? $row->smtpsecure : '');
     $lists['smtpauth'] = JHTML::_('select.booleanlist', 'smtpauth', 'class="inputbox"', $row->smtpauth);
     // CACHE SETTINGS
     $lists['caching'] = JHTML::_('select.booleanlist', 'caching', 'class="inputbox"', $row->caching);
     jimport('joomla.cache.cache');
     $stores = JCache::getStores();
     $options = array();
     foreach ($stores as $store) {
         $options[] = JHTML::_('select.option', $store, JText::_(ucfirst($store)));
     }
     $lists['cache_handlers'] = JHTML::_('select.genericlist', $options, 'cache_handler', 'class="inputbox" size="1"', 'value', 'text', $row->cache_handler);
     // MEMCACHE SETTINGS
     if (!empty($row->memcache_settings) && !is_array($row->memcache_settings)) {
         $row->memcache_settings = unserialize(stripslashes($row->memcache_settings));
     }
     $lists['memcache_persist'] = JHTML::_('select.booleanlist', 'memcache_settings[persistent]', 'class="inputbox"', @$row->memcache_settings['persistent']);
     $lists['memcache_compress'] = JHTML::_('select.booleanlist', 'memcache_settings[compression]', 'class="inputbox"', @$row->memcache_settings['compression']);
     // META SETTINGS
     $lists['MetaAuthor'] = JHTML::_('select.booleanlist', 'MetaAuthor', 'class="inputbox"', $row->MetaAuthor);
     $lists['MetaTitle'] = JHTML::_('select.booleanlist', 'MetaTitle', 'class="inputbox"', $row->MetaTitle);
     // SEO SETTINGS
     $lists['sef'] = JHTML::_('select.booleanlist', 'sef', 'class="inputbox"', $row->sef);
     $lists['sef_rewrite'] = JHTML::_('select.booleanlist', 'sef_rewrite', 'class="inputbox"', $row->sef_rewrite);
     $lists['sef_suffix'] = JHTML::_('select.booleanlist', 'sef_suffix', 'class="inputbox"', $row->sef_suffix);
     // FEED SETTINGS
     $formats = array(JHTML::_('select.option', 'RSS2.0', JText::_('RSS')), JHTML::_('select.option', 'Atom', JText::_('Atom')));
     $summary = array(JHTML::_('select.option', 1, JText::_('Full Text')), JHTML::_('select.option', 0, JText::_('Intro Text')));
     $lists['feed_limit'] = JHTML::_('select.genericlist', $listLimit, 'feed_limit', 'class="inputbox" size="1"', 'value', 'text', $row->feed_limit ? $row->feed_limit : 10);
     $emailOptions = array(JHTML::_('select.option', 'author', JText::_('Author Email')), JHTML::_('select.option', 'site', JText::_('Site Email')));
     $lists['feed_email'] = JHTML::_('select.genericlist', $emailOptions, 'feed_email', 'class="inputbox" size="1"', 'value', 'text', @$row->feed_email ? $row->feed_email : 'author');
     // SESSION SETTINGS
     $stores = JSession::getStores();
     $options = array();
     foreach ($stores as $store) {
         $options[] = JHTML::_('select.option', $store, JText::_(ucfirst($store)));
     }
     $lists['session_handlers'] = JHTML::_('select.genericlist', $options, 'session_handler', 'class="inputbox" size="1"', 'value', 'text', $row->session_handler);
     // SHOW EDIT FORM
     ConfigApplicationView::showConfig($row, $lists);
 }
Exemple #17
0
</li>
					<li><?php 
echo JHtml::_('link', JHelp::createUrl('JHELP_GLOSSARY'), JText::_('COM_ADMIN_GLOSSARY'), array('target' => 'helpFrame'));
?>
</li>
					<hr class="hr-condensed" />
					<li class="nav-header"><?php 
echo JText::_('COM_ADMIN_ALPHABETICAL_INDEX');
?>
</li>
					<?php 
foreach ($this->toc as $k => $v) {
    ?>
						<li>
						    <?php 
    $url = JHelp::createUrl('JHELP_' . strtoupper($k));
    ?>
							<?php 
    echo JHtml::_('link', $url, $v, array('target' => 'helpFrame'));
    ?>
						</li>
					<?php 
}
?>
				</ul>
			</div>
		</div>
		<div class="span9">
			<iframe name="helpFrame" height="70%" src="<?php 
echo $this->page;
?>
 /**
  * Tests the createSiteList method with an XML file passed in the params
  *
  * @return  void
  *
  * @since   3.0
  */
 public function testCreateSiteList_withXML()
 {
     $this->assertThat(JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml'), $this->isType('array'), 'Returns the help site list defined in the XML file');
 }
Exemple #19
0
 /**
  * Method to get the help site field options.
  *
  * @return  array  The field option objects.
  *
  * @since   1.6
  */
 protected function getOptions()
 {
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml', $this->value));
     return $options;
 }
Exemple #20
0
 /**
  * Tests the createSiteList method
  *
  * @return  void
  *
  * @covers  JHelp::createSiteList
  * @since   3.0
  */
 public function testCreateSiteList()
 {
     $helpsite = array('text' => 'English (GB) help.joomla.org', 'value' => 'http://help.joomla.org');
     $this->assertEquals(array($helpsite), JHelp::createSiteList(null), 'Returns the default help site list');
     $this->assertInternalType('array', JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml'), 'Returns the help site list defined in the XML file');
 }
Exemple #21
0
 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  */
 protected function _getOptions()
 {
     jimport('joomla.language.help');
     $options = array_merge(parent::_getOptions(), JHelp::createSiteList(JPATH_ADMINISTRATOR . DS . 'help' . DS . 'helpsites-15.xml', $this->value));
     return $options;
 }
Exemple #22
0
 /**
  * Get the JavaScript command for the button
  *
  * @param   string   $ref        The name of the help screen (its key reference).
  * @param   boolean  $com        Use the help file in the component directory.
  * @param   string   $override   Use this URL instead of any other.
  * @param   string   $component  Name of component to get Help (null for current component)
  * @return  string   JavaScript command string
  */
 protected function _getCommand($ref, $com, $override, $component)
 {
     // Get Help URL
     jimport('joomla.language.help');
     $url = \JHelp::createURL($ref, $com, $override, $component);
     $url = htmlspecialchars($url, ENT_QUOTES);
     $cmd = "Joomla.popupWindow('{$url}', '" . \Lang::txt('JHELP', true) . "', 700, 500, 1)";
     return $cmd;
 }
Exemple #23
0
 /**
  * Load a template file -- This is a special implementation that tries to find the files within the distribution help
  * dir first. There localized versions of these files can be stored!
  *
  * @access	public
  * @param string $tpl The name of the template source file ...
  * automatically searches the template paths and compiles as needed.
  * @return string The output of the the template script.
  */
 function loadTemplate($tpl = null)
 {
     global $mainframe, $option;
     // clear prior output
     $this->_output = null;
     $file = $this->_layout;
     // clean the file name
     $file = preg_replace('/[^A-Z0-9_\\.-]/i', '', $file);
     // Get Help URL
     jimport('joomla.language.help');
     $filetofind = JHelp::createURL($file, true);
     $this->_template = JPath::find(JPATH_ADMINISTRATOR, $filetofind);
     if ($this->_template != false) {
         // unset so as not to introduce into template scope
         unset($tpl);
         unset($file);
         // never allow a 'this' property
         if (isset($this->this)) {
             unset($this->this);
         }
         // start capturing output into a buffer
         ob_start();
         // include the requested template filename in the local scope
         // (this will execute the view logic).
         include $this->_template;
         // done with the requested template; get the buffer and
         // clear it.
         $this->_output = ob_get_contents();
         ob_end_clean();
         return $this->_output;
     } else {
         return parent::loadTemplate($tpl);
     }
 }
Exemple #24
0
    /**
     * Display Help Page
     *
     * For this method the important two scenarios are local or remote help files.
     * In the case of local help files the language tag will be added in order to
     * allow different languages of help.<br />
     * In case of the remote server it is assumed that this server provide one specific
     * help set of files in one particular language.
     */
    function help()
    {
        global $mainframe;
        jimport('joomla.filesystem.folder');
        jimport('joomla.language.help');
        // Get Help URL - an empty helpurl is interpreted as local help files!
        $helpurl = $mainframe->getCfg('helpurl');
        if ($helpurl == 'http://help.mamboserver.com') {
            $helpurl = 'http://help.joomla.org';
        }
        $fullhelpurl = $helpurl . '/index2.php?option=com_content&amp;task=findkey&amp;pop=1&amp;keyref=';
        $helpsearch = JRequest::getString('helpsearch');
        $page = JRequest::getCmd('page', 'joomla.whatsnew15.html');
        $toc = getHelpToc($helpsearch);
        $lang =& JFactory::getLanguage();
        $langTag = $lang->getTag();
        if (!JFolder::exists(JPATH_BASE . DS . 'help' . DS . $langTag)) {
            $langTag = 'en-GB';
            // use english as fallback
        }
        if (!eregi('\\.html$', $page)) {
            $page .= '.xml';
        }
        ?>
		<form action="index.php?option=com_admin&amp;task=help" method="post" name="adminForm">

		<table class="adminform" border="1">
		<tr>
			<td colspan="2">
				<table width="100%">
					<tr>
						<td>
							<strong><?php 
        echo JText::_('Search');
        ?>
:</strong>
							<input class="text_area" type="hidden" name="option" value="com_admin" />
							<input type="text" name="helpsearch" value="<?php 
        echo $helpsearch;
        ?>
" class="inputbox" />
							<input type="submit" value="<?php 
        echo JText::_('Go');
        ?>
" class="button" />
							<input type="button" value="<?php 
        echo JText::_('Clear Results');
        ?>
" class="button" onclick="f=document.adminForm;f.helpsearch.value='';f.submit()" />
						</td>
						<td class="helpMenu">
							<?php 
        if ($helpurl) {
            ?>
							<?php 
            echo JHTML::_('link', JHelp::createUrl('joomla.glossary'), JText::_('Glossary'), array('target' => 'helpFrame'));
            ?>
							|
							<?php 
            echo JHTML::_('link', JHelp::createUrl('joomla.credits'), JText::_('Credits'), array('target' => 'helpFrame'));
            ?>
							|
							<?php 
            echo JHTML::_('link', JHelp::createUrl('joomla.support'), JText::_('Support'), array('target' => 'helpFrame'));
            ?>
							<?php 
        } else {
            ?>
							<?php 
            echo JHTML::_('link', JURI::base() . 'help/' . $langTag . '/joomla.glossary.html', JText::_('Glossary'), array('target' => 'helpFrame'));
            ?>
							|
							<?php 
            echo JHTML::_('link', JURI::base() . 'help/' . $langTag . '/joomla.credits.html', JText::_('Credits'), array('target' => 'helpFrame'));
            ?>
							|
							<?php 
            echo JHTML::_('link', JURI::base() . 'help/' . $langTag . '/joomla.support.html', JText::_('Support'), array('target' => 'helpFrame'));
            ?>
							<?php 
        }
        ?>
							|
							<?php 
        echo JHTML::_('link', 'http://www.gnu.org/licenses/gpl-2.0.html', JText::_('License'), array('target' => 'helpFrame'));
        ?>
							|
							<?php 
        echo JHTML::_('link', 'http://help.joomla.org', 'help.joomla.org', array('target' => 'helpFrame'));
        ?>
							|
							<?php 
        echo JHTML::_('link', 'index.php?option=com_admin&amp;task=changelog&amp;tmpl=component', JText::_('Changelog'), array('target' => 'helpFrame'));
        ?>
							|
							<?php 
        echo JHTML::_('link', 'http://www.joomla.org/content/blogcategory/57/111/', JText::_('Latest Version Check'), array('target' => 'helpFrame'));
        ?>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		</table>

		<div id="treecellhelp">
			<fieldset title="<?php 
        echo JText::_('Alphabetical Index');
        ?>
">
				<legend>
					<?php 
        echo JText::_('Alphabetical Index');
        ?>
				</legend>

				<div class="helpIndex">
					<ul class="subext">
						<?php 
        foreach ($toc as $k => $v) {
            if ($helpurl) {
                echo '<li>';
                echo JHTML::_('link', JHelp::createUrl($k), $v, array('target' => 'helpFrame'));
                echo '</li>';
            } else {
                echo '<li>';
                echo JHTML::_('link', JURI::base() . 'help/' . $langTag . '/' . $k, $v, array('target' => 'helpFrame'));
                echo '</li>';
            }
        }
        ?>
					</ul>
				</div>
			</fieldset>
		</div>

		<div id="datacellhelp">
			<fieldset title="<?php 
        echo JText::_('View');
        ?>
">
				<legend>
					<?php 
        echo JText::_('View');
        ?>
				</legend>
				<?php 
        if ($helpurl && $page != 'joomla.whatsnew15.html') {
            ?>
					<iframe name="helpFrame" src="<?php 
            echo $fullhelpurl . preg_replace('#\\.xml$|\\.html$#', '', $page);
            ?>
" class="helpFrame" frameborder="0"></iframe>
					<?php 
        } else {
            ?>
					<iframe name="helpFrame" src="<?php 
            echo JURI::base() . 'help/' . $langTag . '/' . $page;
            ?>
" class="helpFrame" frameborder="0"></iframe>
					<?php 
        }
        ?>
			</fieldset>
		</div>

		<input type="hidden" name="task" value="help" />
		</form>
		<?php 
    }