</div> <?php if (count($this->items)) { ?> <ul class="submissions"> <?php foreach ($this->items as $id => $item) { ?> <li> <div class="header"> <?php $edit_hash = SubmissionHelper::getSubmissionHash($this->submission->id, $item->type, $id); ?> <?php $edit_link = RouteHelper::getSubmissionRoute($this->submission, $item->type, $edit_hash, $id, 'mysubmissions'); ?> <?php if ($this->submission->isInTrustedMode()) { ?> <a href="<?php echo JRoute::_($this->link_base . '&controller=submission&submission_id=' . $this->submission->id . '&task=remove&item_id=' . $id); ?> " title="<?php echo JText::_('Delete Item'); ?> " class="item-icon delete-item"></a> <?php
protected function _init() { //init vars $type_id = JRequest::getString('type_id'); $hash = JRequest::getString('submission_hash'); $this->redirect = YRequest::getString('redirect'); // check config $this->_checkConfig(); // get submission info from request if ($type_id) { if ($hash != SubmissionHelper::getSubmissionHash($this->submission->id, $type_id, $this->item_id)) { throw new SubmissionControllerException('Hashes did not match.'); } // else get submission info from active menu } elseif ($this->menu_params) { $type_id = $this->menu_params->get('type'); // remove item_id (menu item may not have an item_id) $this->item_id = null; } // set type $this->type = $this->submission->getType($type_id); // check type if (!$this->type) { throw new SubmissionControllerException('Submissions are not configured correctly.'); } // set hash $this->hash = $hash ? $hash : SubmissionHelper::getSubmissionHash($this->submission->id, $this->type->id, $this->item_id); // set layout $this->layout = $this->submission->getForm($this->type->id)->get('layout', ''); // check layout if (empty($this->layout)) { throw new SubmissionControllerException('Submission is not configured correctly.'); } // set layout path $this->layout_path = 'item.'; if ($this->renderer->pathExists('item/' . $this->type->id)) { $this->layout_path .= $this->type->id . '.'; } $this->layout_path .= $this->layout; // get positions $positions = $this->renderer->getConfig('item')->get($this->application->getGroup() . '.' . $this->type->id . '.' . $this->layout, array()); // get elements from positions $this->elements_config = array(); foreach ($positions as $position) { foreach ($position as $element) { if ($element_obj = $this->type->getElement($element->element)) { if (!$this->submission->isInTrustedMode()) { $metadata = $element_obj->getMetaData(); if ($metadata['trusted'] == 'true') { continue; } } $this->elements_config[$element->element] = $element; } } } // get item table $table = YTable::getInstance('item'); // get item if (!$this->item_id || !($this->item = $table->get($this->item_id))) { $this->item = new Item(); $this->item->application_id = $this->application->id; $this->item->type = $this->type->id; $now = JFactory::getDate(); $config = JFactory::getConfig(); $offset = $config->getValue('config.offset'); $now->setOffset($offset); $this->item->publish_up = $now->toFormat(SubmissionController::EDIT_DATE_FORMAT); $this->item->publish_down = YDatabase::getInstance()->getNullDate(); } }