本文整理汇总了PHP中JToolBarHelper::Preview方法的典型用法代码示例。如果您正苦于以下问题:PHP JToolBarHelper::Preview方法的具体用法?PHP JToolBarHelper::Preview怎么用?PHP JToolBarHelper::Preview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JToolBarHelper
的用法示例。
在下文中一共展示了JToolBarHelper::Preview方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _setToolbar
/**
* Setup the Toolbar
*
* @since 1.6
*/
protected function _setToolbar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = ModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
$client = $this->get('client');
JToolBarHelper::title(JText::_('Modules_Manager_Module'));
if ($this->item->module == 'mod_custom') {
JToolBarHelper::Preview('index.php?option=com_modules&tmpl=component&client=' . $client->id . '&pollid=' . $this->item->id);
}
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')) {
JToolBarHelper::apply('module.apply', 'JToolbar_Apply');
JToolBarHelper::save('module.save', 'JToolbar_Save');
JToolBarHelper::addNew('module.save2new', 'JToolbar_Save_and_new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::custom('module.save2copy', 'copy.png', 'copy_f2.png', 'JToolbar_Save_as_Copy', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('module.cancel', 'JToolbar_Cancel');
} else {
JToolBarHelper::cancel('module.cancel', 'JToolbar_Close');
}
JToolBarHelper::help('screen.module.edit');
}
示例2: display
function display($tpl = null)
{
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_mijopolls/assets/css/mijopolls.css');
$cid = JRequest::getVar('cid', array(0), '', 'array');
$edit = JRequest::getVar('edit', true);
$text = $edit ? JText::_('Edit') : JText::_('New');
JToolBarHelper::title(JText::_('COM_MIJOPOLLS_POLL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'mijopolls');
JToolBarHelper::Preview('index.php?option=com_mijopolls&cid[]=' . $cid[0]);
JToolBarHelper::save();
JToolBarHelper::apply();
JToolBarHelper::cancel();
$this->mainframe = JFactory::getApplication();
$user = JFactory::getUser();
$row = $this->get('ItemData');
// fail if checked out not by 'me'
if ($row->isCheckedOut($user->get('id'))) {
$msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_MIJOPOLLS_THE_POLL'), $row->title);
$this->setRedirect('index.php?option=com_mijopolls', $msg);
}
if ($row->id == 0) {
$row->published = 1;
}
$options = array();
$ordering = array();
if ($edit) {
$options = $row->getOptions($row->id);
} else {
$row->lag = 24 * 60;
}
//default colors for slices
$colors = array("ff0000", "ffff99", "00ccff", "66ff99", "ffcc00", "d7ebff", "ccffcc", "cccccc", "ffff00", "006699", "660000", "ffddee");
$task = JRequest::getCmd('task');
if (MijopollsHelper::is15()) {
$tpl .= '15';
$params = new JParameter($row->params, JPATH_COMPONENT . '/views/poll/poll.xml');
$this->params = $params;
} else {
if (MijopollsHelper::is30()) {
$tpl = '30';
$this->params = $this->get('Form');
} else {
if ($task != 'preview') {
$tpl = '25';
$this->params = $this->get('Form');
}
}
}
$this->row = $row;
$this->options = $options;
$this->color = $colors;
$this->edit = $edit;
parent::display($tpl);
}
示例3: _EDIT
/**
* Draws the menu for Editing an existing module
*/
function _EDIT($client)
{
$moduleType = JRequest::getCmd('module');
$cid = JRequest::getVar('cid', array(0), '', 'array');
JArrayHelper::toInteger($cid, array(0));
JToolBarHelper::title(JText::_('Module') . ': <small><small>[ ' . JText::_('Edit') . ' ]</small></small>', 'module.png');
if ($moduleType == 'custom') {
JToolBarHelper::Preview('index.php?option=com_modules&tmpl=component&client=' . $client->id . '&pollid=' . $cid[0]);
}
JToolBarHelper::save();
JToolBarHelper::apply();
if ($cid[0]) {
// for existing items the button is renamed `close`
JToolBarHelper::cancel('cancel', 'Close');
} else {
JToolBarHelper::cancel();
}
JToolBarHelper::help('screen.modules.edit');
}
示例4: display
function display($tpl = null)
{
$document =& JFactory::getDocument();
$document->addStyleSheet('components/com_acepolls/assets/css/acepolls.css');
$cid = JRequest::getVar('cid', array(0), '', 'array');
$edit = JRequest::getVar('edit', true);
$text = $edit ? JText::_('Edit') : JText::_('New');
JToolBarHelper::title(JText::_('COM_ACEPOLLS_POLL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'acepolls');
JToolBarHelper::Preview('index.php?option=com_acepolls&cid[]=' . $cid[0]);
JToolBarHelper::save();
JToolBarHelper::apply();
JToolBarHelper::cancel();
$this->mainframe = JFactory::getApplication();
$user =& JFactory::getUser();
$row = $this->get('ItemData');
// fail if checked out not by 'me'
if ($row->isCheckedOut($user->get('id'))) {
$msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_ACEPOLLS_THE_POLL'), $row->title);
$this->setRedirect('index.php?option=com_acepolls', $msg);
}
if ($row->id == 0) {
// defaults
$row->published = 1;
}
$options = array();
$ordering = array();
if ($edit) {
$options = $row->getOptions($row->id);
} else {
$row->lag = 24 * 60;
}
//default colors for slices
$colors = array("ff0000", "ffff99", "00ccff", "66ff99", "ffcc00", "d7ebff", "ccffcc", "cccccc", "ffff00", "006699", "660000", "ffddee");
$this->assignRef('row', $row);
$this->assignRef('options', $options);
$this->assignRef('params', $this->get('Form'));
$this->assignRef('color', $colors);
$this->assignRef('edit', $edit);
parent::display($tpl);
}
示例5: _EDIT
/**
* Draws the menu for Editing an existing module
*/
function _EDIT($client)
{
$config = plgSystemAdvancedModulesConfig();
$moduleType = JRequest::getCmd('module');
$cid = JRequest::getVar('cid', array(0), '', 'array');
JArrayHelper::toInteger($cid, array(0));
JToolBarHelper::title(JText::_('AMM_MODULE') . ': <small><small>[ ' . JText::_('Edit') . ' ]</small></small>', 'module.png');
if ($moduleType == 'custom') {
JToolBarHelper::Preview('index.php?option=com_advancedmodules&tmpl=component&client=' . $client->id . '&pollid=' . $cid['0']);
}
JToolBarHelper::save();
JToolBarHelper::apply();
if ($cid['0']) {
// for existing items the button is renamed `close`
JToolBarHelper::cancel('cancel', 'Close');
} else {
JToolBarHelper::cancel();
}
if ($config->show_config_in_item) {
JToolBarHelper::preferences('com_advancedmodules', '500');
}
JToolBarHelper::help('screen.modules.edit');
}
示例6: defined
<?php
defined('_JEXEC') or die('Restricted access');
?>
<?php
$cid = JRequest::getVar('cid', array(0), '', 'array');
$edit = JRequest::getVar('edit', true);
JArrayHelper::toInteger($cid, array(0));
$text = $edit ? JText::_('Edit') : JText::_('New');
JToolBarHelper::title(JText::_('Poll') . ': <small><small>[ ' . $text . ' ]</small></small>');
JToolBarHelper::Preview('index.php?option=com_poll&controller=poll&cid[]=' . $cid[0]);
JToolBarHelper::save();
JToolBarHelper::apply();
if ($edit) {
// for existing items the button is renamed `close`
JToolBarHelper::cancel('cancel', 'Close');
} else {
JToolBarHelper::cancel();
}
JToolBarHelper::help('screen.polls.edit');
?>
<?php
JFilterOutput::objectHTMLSafe($this->poll, ENT_QUOTES);
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {