示例#1
0
<?php

/**
* @package   ZOO Component
* @file      _mysubmissions.php
* @version   2.3.0 December 2010
* @author    YOOtheme http://www.yootheme.com
* @copyright Copyright (C) 2007 - 2011 YOOtheme GmbH
* @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
JHTML::stylesheet('submission.css', 'media/zoo/assets/css/');
JHTML::script('submission.js', 'media/zoo/assets/js/');
$mysubmissions_link = RouteHelper::getMySubmissionsRoute($this->submission);
?>

<div class="toolbar">

	<div class="submission-add">
		<div class="trigger" title="<?php 
echo JText::_('Add Item');
?>
"><?php 
echo JText::_('Add Item');
?>
</div>
		<div class="links">
		<?php 
foreach ($this->types as $id => $type) {
    ?>
示例#2
0
 public function remove()
 {
     // init vars
     $msg = null;
     try {
         $this->_checkConfig();
         if (!$this->submission->isInTrustedMode()) {
             throw new YControllerException('The submission is not in Trusted Mode.');
         }
         // get item table and delete item
         $table = YTable::getInstance('item');
         $item = $table->get($this->item_id);
         // is current user the item owner and does the user have sufficient user rights
         if ($item->id && (!$item->canAccess($this->user) || $item->created_by != $this->user->id)) {
             throw new YControllerException('You are not allowed to make changes to this item.');
         }
         $table->delete($item);
         // set redirect message
         $msg = JText::_('Submission Deleted');
     } catch (YException $e) {
         // raise warning on exception
         JError::raiseWarning(0, JText::_('There was an error deleting your submission, please try again later.'));
         // add exception details, for super administrators only
         if ($this->user->superadmin) {
             JError::raiseWarning(0, (string) $e);
         }
     }
     $link = RouteHelper::getMySubmissionsRoute($this->submission);
     $this->setRedirect(JRoute::_($link, false), $msg);
 }