本文整理汇总了PHP中JHelp::createURL方法的典型用法代码示例。如果您正苦于以下问题:PHP JHelp::createURL方法的具体用法?PHP JHelp::createURL怎么用?PHP JHelp::createURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JHelp
的用法示例。
在下文中一共展示了JHelp::createURL方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateURL
/**
* Tests the createURL method for com_content's Article Manager view
*
* @return void
*
* @covers JHelp::createURL
* @since 3.0
*/
public function testCreateURL()
{
$this->assertEquals('help/en-GB/Content_Article_Manager.html', JHelp::createURL('JHELP_CONTENT_ARTICLE_MANAGER'), 'Creates a local help URL for com_content Article Manager.');
$this->assertEquals('components/com_content/help/en-GB/Content_Article_Manager.html', JHelp::createURL('JHELP_CONTENT_ARTICLE_MANAGER', true, null, 'com_content'), 'Creates a local help URL for com_content Article Manager in the component.');
$this->assertEquals('http://domain.tld/help', JHelp::createURL('JHELP_CONTENT_ARTICLE_MANAGER', true, 'http://domain.tld/help', 'com_content'), 'Creates a remote help URL via an override for com_content Article Manager.');
$this->assertEquals('help/en-GB/Content_Article_Manager.html', JHelp::createURL('JHELP_CONTENT_ARTICLE_MANAGER', false, null, 'com_content'), 'Creates a local help URL for com_content Article Manager.');
}
示例2: _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;
}
示例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 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;
}
示例5: 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;
}
示例6: 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);
}
}
示例7: testCreateURL_com_content
/**
* Tests the createURL method for com_content's Article Manager view
*
* @return void
*
* @since 3.0
*/
public function testCreateURL_com_content()
{
$this->assertThat(JHelp::createURL('JHELP_CONTENT_ARTICLE_MANAGER', false, null, 'com_content'), $this->equalTo('help/en-GB/Content_Article_Manager.html'), 'Creates a local help URL for com_content Article Manager.');
}
示例8: _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
*/
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;
}
示例9: 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.
*/
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);
}
}