本文整理汇总了PHP中Sh404sefHelperGeneral::makeToolbarTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Sh404sefHelperGeneral::makeToolbarTitle方法的具体用法?PHP Sh404sefHelperGeneral::makeToolbarTitle怎么用?PHP Sh404sefHelperGeneral::makeToolbarTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sh404sefHelperGeneral
的用法示例。
在下文中一共展示了Sh404sefHelperGeneral::makeToolbarTitle方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($tpl = null)
{
// get current layout
$params['layout'] = JRequest::getCmd('layout', 'default');
// push the appropriate data into the view
$methodName = '_pushConfigData' . ucfirst($params['layout']);
if (is_callable(array($this, $methodName))) {
$this->{$methodName}();
}
// build the toolbar
$toolBar = $this->_makeToolbar($params);
$this->assignRef('toolbar', $toolBar);
// add title and icon to toolbar
$this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_CONFIGURATION'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title'));
// insert needed css files
$this->_addCss();
// link to custom javascript
JHtml::script('config.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
// also add some custom javascript tp collect editor content
if ($params['layout'] == 'errordocs') {
$this->_addJs();
}
// add tooltips
JHTML::_('behavior.tooltip');
// now display normally
parent::display($tpl);
}
示例2: display
public function display($tpl = null)
{
// get model and update context with current
$model =& $this->getModel();
$context = $model->updateContext($this->_context . '.' . $this->getLayout());
// get url id
$notFoundUrlId = JRequest::getInt('notfound_url_id');
// read url data from model
$url =& $model->getUrl($notFoundUrlId);
// and push url into the template for display
$this->assign('url', $url);
// build the toolbar
$toolBar = $this->_makeToolbar();
$this->assignRef('toolbar', $toolBar);
// add title.
$this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_NOT_FOUND_ENTER_REDIRECT'), $icon = 'addedit.png', $class = 'header'));
// insert needed css files
$this->_addCss();
// link to custom javascript
JHtml::script('edit.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
// add domready event
$document =& JFactory::getDocument();
// add tooltips
JHTML::_('behavior.tooltip');
// now display normally
parent::display($tpl);
}
示例3: display
public function display($tpl = null)
{
// get model and update context with current
$model =& $this->getModel();
$context = $model->updateContext($this->_context . '.' . $this->getLayout());
// get url id
$notFoundUrlId = JRequest::getInt('notfound_url_id');
// read url data from model. This is the 404 request we want to
// redirect to something else
// must be called before model->getList()
$url =& $model->getUrl($notFoundUrlId);
// and push url into the template for display
$this->assign('url', $url);
// attach data, according to specific layout requested
$methodName = '_attachData' . ucfirst($this->getLayout());
if (is_callable(array($this, $methodName))) {
$this->{$methodName}();
}
// build the toolbar
$methodName = '_makeToolbar' . ucfirst($this->getLayout());
if (is_callable(array($this, $methodName))) {
$this->{$methodName}();
}
// add confirmation phrase to toolbar
$this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_NOT_FOUND_SELECT_REDIRECT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title'));
// insert needed css files
$this->_addCss();
// link to custom javascript
JHtml::script('notfound.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
// now display normally
parent::display($tpl);
}
示例4: _makeToolbarDefaultJ2
/**
* Create toolbar for default layout view
*
* @param midxed $params
*/
private function _makeToolbarDefaultJ2($params = null)
{
// add title
$title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_PAGEIDS_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
JFactory::getApplication()->JComponentTitle = $title;
// get toolbar object
$bar = JToolBar::getInstance('toolbar');
$bar->addButtonPath(JPATH_COMPONENT . '/' . 'classes');
// add import button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 400);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=import&opsubject=pageids';
$bar->appendButton('Shpopuptoolbarbutton', 'import', $url, JText::_('COM_SH404SEF_IMPORT_BUTTON'), $msg = '', $task = 'import', $list = false, $hidemenu = true, $params);
// add import button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 380);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=export&opsubject=pageids';
$bar->appendButton('Shpopuptoolbarbutton', 'export', $url, JText::_('COM_SH404SEF_EXPORT_BUTTON'), $msg = '', $task = 'export', $list = false, $hidemenu = true, $params);
// separator
JToolBarHelper::divider();
// add delete button as an ajax call
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 300);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=pageids&task=confirmdelete&tmpl=component';
$bar->appendButton('Shpopuptoolbarbutton', 'delete', $url, JText::_('Delete'), $msg = JText::_('VALIDDELETEITEMS', true), $task = 'purgeselected', $list = true, $hidemenu = true, $params);
// separator
JToolBarHelper::divider();
}
示例5: _makeViewInfo
/**
* Attach css, js and create toolbar for Info view
*
* @param midxed $params
*/
private function _makeViewInfo($params = null)
{
global $mainframe;
// add our own css
JHtml::styleSheet('list.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
// add title
$title = Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_TITLE_SUPPORT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
$mainframe->set('JComponentTitle', $title);
}
示例6: _makeToolbar
/**
* Create toolbar for default layout view
*
* @param midxed $params
*/
private function _makeToolbar($params = null)
{
$mainframe =& JFactory::getApplication();
// Get the JComponent instance of JToolBar
$bar =& JToolBar::getInstance('toolbar');
// add title
$title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_ALIASES_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
$mainframe->set('JComponentTitle', $title);
// add "New url" button
$bar =& JToolBar::getInstance('toolbar');
$bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
// add edit button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 800, 'y' => 600);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=editalias&task=edit&tmpl=component&view=editurl&startOffset=2';
$bar->appendButton('Shpopuptoolbarbutton', 'edit', $url, JText::_('Edit'), $msg = '', $task = 'edit', $list = true, $hidemenu = true, $params);
// add delete button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 300);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=editalias&task=confirmdelete&tmpl=component';
$bar->appendButton('Shpopuptoolbarbutton', 'delete', $url, JText::_('Delete'), $msg = JText::_('VALIDDELETEITEMS', true), $task = 'delete', $list = true, $hidemenu = true, $params);
// separator
JToolBarHelper::divider();
// add import button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 400);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=import&opsubject=aliases';
$bar->appendButton('Shpopuptoolbarbutton', 'import', $url, JText::_('COM_SH404SEF_IMPORT_BUTTON'), $msg = '', $task = 'import', $list = false, $hidemenu = true, $params);
// add import button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 300);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=export&opsubject=aliases';
$bar->appendButton('Shpopuptoolbarbutton', 'export', $url, JText::_('COM_SH404SEF_EXPORT_BUTTON'), $msg = '', $task = 'export', $list = false, $hidemenu = true, $params);
// separator
JToolBarHelper::divider();
// edit home page button
$params['class'] = 'modalediturl';
$params['size'] = array('x' => 800, 'y' => 600);
$js = '\\function(){window.parent.shAlreadySqueezed = false;if(window.parent.shReloadModal) parent.window.location=\'' . $this->defaultRedirectUrl . '\';window.parent.shReloadModal=true}';
$params['onClose'] = $js;
$bar->appendButton('Shpopupbutton', 'home', JText::_('COM_SH404SEF_HOME_PAGE_ICON'), "index.php?option=com_sh404sef&c=editalias&task=edit&view=editurl&home=1&tmpl=component&startOffset=1", $params);
// separator
JToolBarHelper::divider();
}
示例7: display
public function display($tpl = null)
{
// version prefix
$this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix();
// get model and update context with current
$model = $this->getModel();
$context = $model->updateContext($this->_context . '.' . $this->getLayout());
// read data from model
$list = $model->getList((object) array('layout' => $this->getLayout(), 'simpleUrlList' => true));
// and push it into the view for display
$this->assign('items', $list);
$this->assign('itemCount', count($this->items));
$this->assign('pagination', $model->getPagination());
$options = $model->getDisplayOptions();
$this->assign('options', $options);
$this->assign('mainUrl', $model->getMainUrl());
if (version_compare(JVERSION, '3.0', 'ge')) {
$document = JFactory::getDocument();
// add our own css
JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_list.css');
// add modal css and js
ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument());
ShlHtmlBs_helper::addBootstrapModalFixCss(JFactory::getDocument());
ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument());
// add display filters
$this->_addFilters();
// render submenu sidebar
$this->sidebar = JHtmlSidebar::render();
} else {
// add confirmation phrase to toolbar
$this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_DUPLICATE_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title'));
// build the toolbar
$this->_makeToolbarJ2();
// add our own css
JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_urls.css');
JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');
// link to custom javascript
JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/list.js');
$this->assign('optionsSelect', $this->_makeOptionsSelect($options));
}
// link to custom javascript
JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/list.js');
// now display normally
parent::display($this->joomlaVersionPrefix);
}
示例8: _makeToolbarDefault
/**
* Create toolbar for default layout view
*
* @param midxed $params
*/
private function _makeToolbarDefault($params = null)
{
global $mainframe;
// Get the JComponent instance of JToolBar
$bar =& JToolBar::getInstance('toolbar');
// add title
$title = Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_META_TAGS'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
$mainframe->set('JComponentTitle', $title);
// get toolbar object
$bar =& JToolBar::getInstance('toolbar');
$bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
// add import button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 400);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=import&opsubject=urls';
// importing metas is same as importing urls, as export format is same
$bar->appendButton('Shpopuptoolbarbutton', 'import', $url, JText::_('Import'), $msg = '', $task = 'import', $list = false, $hidemenu = true, $params);
// add export button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 300);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=export&opsubject=metas';
$bar->appendButton('Shpopuptoolbarbutton', 'export', $url, JText::_('Export'), $msg = '', $task = 'export', $list = false, $hidemenu = true, $params);
// separator
JToolBarHelper::divider();
// edit home page button
$params['class'] = 'modalediturl';
$params['size'] = array('x' => 700, 'y' => 500);
$js = '\\function(){shAlreadySqueezed = false;if(parent.shReloadModal) parent.window.location=\'' . $this->defaultRedirectUrl . '\';parent.shReloadModal=true}';
$params['onClose'] = $js;
$bar->appendButton('Shpopupbutton', 'home', JText16::_('COM_SH404SEF_HOME_PAGE_ICON'), "index.php?option=com_sh404sef&c=editurl&task=edit&home=1&tmpl=component", $params);
// separator
JToolBarHelper::divider();
// add save button as an ajax call
$bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
$params['class'] = 'savemeta';
$params['id'] = 'savemeta';
$params['closewindow'] = 0;
$bar->appendButton('Shajaxbutton', 'save', 'Save', "index.php?option=com_sh404sef&c=metas&task=save&shajax=1&tmpl=component", $params);
// separator
JToolBarHelper::divider();
}
示例9: _makeToolbarView404J2
/**
* Create toolbar for 404 pages template
*
* @param midxed $params
*/
private function _makeToolbarView404J2($params = null)
{
// Get the JComponent instance of JToolBar
$bar = JToolBar::getInstance('toolbar');
// and connect to our buttons
$bar->addButtonPath(JPATH_COMPONENT . '/' . 'classes');
// add title
$title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_404_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
JFactory::getApplication()->JComponentTitle = $title;
// add edit button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 800, 'y' => 600);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=editurl&task=edit&tmpl=component';
$bar->appendButton('Shpopuptoolbarbutton', 'edit', $url, JText::_('Edit'), $msg = '', $task = 'edit', $list = true, $hidemenu = true, $params);
// add delete button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 300);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=editurl&task=confirmdelete404&tmpl=component';
$bar->appendButton('Shpopuptoolbarbutton', 'delete', $url, JText::_('Delete'), $msg = JText::_('VALIDDELETEITEMS', true), $task = 'delete', $list = true, $hidemenu = true, $params);
// separator
JToolBarHelper::divider();
// add import button
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 380);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=export&opsubject=view404';
$bar->appendButton('Shpopuptoolbarbutton', 'export', $url, JText::_('Export'), $msg = '', $task = 'export', $list = false, $hidemenu = true, $params);
// separator
JToolBarHelper::divider();
// add purge and purge selected buttons
$params['class'] = 'modaltoolbar';
$params['size'] = array('x' => 500, 'y' => 300);
unset($params['onClose']);
$url = 'index.php?option=com_sh404sef&c=urls&task=confirmpurge404&tmpl=component';
$bar->appendButton('Shpopuptoolbarbutton', 'purge', $url, JText::_('COM_SH404SEF_PURGE'), $msg = JText::_('VALIDDELETEITEMS', true), $task = 'purge', $list = false, $hidemenu = true, $params);
// separator
JToolBarHelper::divider();
}
示例10: display
public function display( $tpl = null) {
// get model and update context with current
$model = &$this->getModel();
$context = $model->updateContext( $this->_context . '.' . $this->getLayout());
// get url id
$cid = JRequest::getVar('cid', array(0), 'default', 'array');
$cid = intval($cid[0]);
// get home page flag, and make sure id is 0 if editing home data
$home = JRequest::getInt( 'home');
if ($home == 1) {
$cid = 0;
}
$this->assign( 'home', $home);
// optional starting pane in case of tabbed edition
$startOffset = JRequest::getInt( 'startOffset', 0);
$this->assign( 'startOffset', $startOffset);
// read url data from model
$url = &$model->getById( $cid);
// if editing home, set home url
if ($this->home == 1) {
$url->set( 'newurl', sh404SEF_HOMEPAGE_CODE);
}
// controllers may forbid to edit sef or non-sef urls
$noUrlEditing = empty( $this->noUrlEditing) ? false : $this->noUrlEditing;
$this->assign( 'noUrlEditing', $noUrlEditing);
// and push url into the template for display
$this->assign( 'url', $url);
// we only allow editing of non-sef url for new urls, that is when non sef url field is empty
// of for 404s, when we have a sef but no non-sef
$newUrl = $url->get('newurl');
$this->assign( 'canEditNewUrl', empty( $newUrl));
// are we creating a new url rcord or editing an existing one
$oldUrl = $url->get('oldurl');
$existingUrl = !empty( $newUrl) || !empty( $newUrl);
// now read meta for this url, using meta model
if ($existingUrl) {
$metaModel = &JModel::getInstance( 'metas', 'Sh404sefModel');
$metas = $metaModel->getList( (object) array('newurl' => $url->get('newurl') ), $returnZeroElement = true );
$meta = $metas[0];
} else {
$meta = JTable::getInstance( 'metas', 'Sh404sefTable');
}
$this->assign( 'meta', $meta);
// now read aliases for this url, using an aliases model
if ($existingUrl) {
$aliasModel = &JModel::getInstance( 'aliases', 'Sh404sefModel');
$aliases = $aliasModel->getDisplayableList( (object) array('newurl' => $url->get('newurl') ) );
} else {
$aliases = '';
}
$this->assign( 'aliases', $aliases);
// now read pageid for this url, using pageid model
$pageidModel = &JModel::getInstance( 'pageids', 'Sh404sefModel');
$pageids = $pageidModel->getList( (object) array('newurl' => $url->get('newurl') ), $returnZeroElement = true );
$this->assign( 'pageid', $pageids[0]);
// push social seo data
$this->_pushDataSocial_seo();
// build the toolbar
$toolBar = $this->_makeToolbar();
$this->assignRef( 'toolbar', $toolBar);
// add title. If there is an id, we are editing an existing url, or else we create a new one
// other case : edting home page, there is a specific title
if ($home == 1) {
$title = JText::_( 'COM_SH404SEF_HOME_PAGE_EDIT_TITLE');
} else {
$title = $url->get('id') ? JText::_( 'COM_SH404SEF_EDIT_URL_TITLE') : JText::_('COM_SH404SEF_ADD_URL_TITLE');
}
$this->assign( 'toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle( $title, $icon = 'sh404sef', $class = 'sh404sef-toolbar-title'));
// insert needed css files
$this->_addCss();
// link to custom javascript
JHtml::script( 'edit.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
// add domready event
$document = & JFactory::getDocument();
//$js = 'window.addEvent("domready", function(){ shAttachResizer();});';
//$document->addScriptDeclaration( $js);
// add tooltips
JHTML::_('behavior.tooltip');
// now display normally
//.........这里部分代码省略.........
示例11: _makeViewInfo
/**
* Attach css, js and create toolbar for Info view
*
* @param midxed $params
*/
private function _makeViewInfo($params = null)
{
// add our own css
JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');
// decide on help file language
$languageCode = Sh404sefHelperLanguage::getFamily();
$basePath = JPATH_ROOT . '/administrator/components/com_sh404sef/language/%s.readme.php';
// fall back to english if language readme does not exist
jimport('joomla.filesystem.file');
if (!JFile::exists(sprintf($basePath, $languageCode))) {
$languageCode = 'en';
}
$this->assign('readmeFilename', sprintf($basePath, $languageCode));
if (version_compare(JVERSION, '3.0', 'ge')) {
// render submenu sidebar
$this->sidebar = JHtmlSidebar::render();
// add modal css and js
ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument());
ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument());
JToolbarHelper::title(JText::_('COM_SH404SEF_TITLE_SUPPORT'), 'sh404sef-toolbar-title');
} else {
// add title
$title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_TITLE_SUPPORT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
JFactory::getApplication()->JComponentTitle = $title;
}
}
示例12: _makeViewInfo
/**
* Attach css, js and create toolbar for Info view
*
* @param midxed $params
*/
private function _makeViewInfo($params = null)
{
// add our own css
JHtml::styleSheet('list.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
// decide on help file language
$languageCode = Sh404sefHelperLanguage::getFamily();
$basePath = JPATH_ROOT . '/administrator/components/com_sh404sef/language/%s.readme.php';
// fall back to english if language readme does not exist
jimport('joomla.filesystem.file');
if (!JFile::exists(sprintf($basePath, $languageCode))) {
$languageCode = 'en';
}
$this->assign('readmeFilename', sprintf($basePath, $languageCode));
// add title
$title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_TITLE_SUPPORT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
JFactory::getApplication()->set('JComponentTitle', $title);
}