本文整理汇总了PHP中JHelp类的典型用法代码示例。如果您正苦于以下问题:PHP JHelp类的具体用法?PHP JHelp怎么用?PHP JHelp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JHelp类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSites
/**
* 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;
}
示例2: fetchElement
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);
}
示例3: _getCommand
/**
* 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;
}
示例4: _getCommand
/**
* 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;
}
示例5:
/**
* 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;
}
示例6: getOptions
/**
* 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;
}
示例7: _getCommand
/**
* 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;
}
示例8: fetchElement
/**
*
* @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));
}
示例9: getOptions
/**
* 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;
}
示例10: gethelpsites
/**
* 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();
}
示例11: fetchElement
/**
* 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));
}
示例12:
/**
* 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;
}
示例13: foreach
<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>
示例14: loadTemplate
/**
* 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);
}
}
示例15: replaceToolbar
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;
}