本文整理汇总了PHP中Toolbar::preview方法的典型用法代码示例。如果您正苦于以下问题:PHP Toolbar::preview方法的具体用法?PHP Toolbar::preview怎么用?PHP Toolbar::preview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Toolbar
的用法示例。
在下文中一共展示了Toolbar::preview方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defined
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* HUBzero is a registered trademark of Purdue University.
*
* @package hubzero-cms
* @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
defined('_HZEXEC_') or die;
$canDo = \Components\Poll\Helpers\Permissions::getActions('component');
$text = $this->poll->id ? Lang::txt('JACTION_EDIT') : Lang::txt('JACTION_CREATE');
Toolbar::title(Lang::txt('COM_POLL') . ': ' . $text, 'poll.png');
if ($this->poll->id) {
Toolbar::preview('index.php?option=' . $this->option . '&task=preview&id=' . $this->poll->id);
Toolbar::spacer();
}
if ($canDo->get('core.edit')) {
Toolbar::save();
Toolbar::apply();
Toolbar::spacer();
}
if ($this->poll->id) {
// for existing items the button is renamed `close`
Toolbar::cancel('cancel', 'COM_POLL_CLOSE');
} else {
Toolbar::cancel();
}
Toolbar::spacer();
Toolbar::help('poll');
示例2: defined
* HUBzero is a registered trademark of Purdue University.
*
* @package hubzero-cms
* @author Shawn Rice <zooley@purdue.edu>
* @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
defined('_HZEXEC_') or die;
$cid = Request::getVar('cid', array(0), '', 'array');
$edit = Request::getVar('edit', true);
\Hubzero\Utility\Arr::toInteger($cid, array(0));
$canDo = \Components\Poll\Helpers\Permissions::getActions('component');
$text = $edit ? Lang::txt('JACTION_EDIT') : Lang::txt('JACTION_CREATE');
Toolbar::title(Lang::txt('COM_POLL') . ': ' . $text, 'poll.png');
if ($this->poll->id) {
Toolbar::preview('index.php?option=' . $this->option . '&task=preview&cid=' . $cid[0]);
Toolbar::spacer();
}
if ($canDo->get('core.edit')) {
Toolbar::save();
Toolbar::apply();
Toolbar::spacer();
}
if ($edit) {
// for existing items the button is renamed `close`
Toolbar::cancel('cancel', 'COM_POLL_CLOSE');
} else {
Toolbar::cancel();
}
Toolbar::spacer();
Toolbar::help('poll');