?> <?php } else { ?> <?php echo Lang::txt('COM_RESOURCES_ERROR_MUST_BE_PART_OF_GROUP') . ' ' . implode(', ', $ghtml); ?> <?php } ?> </p> <?php } else { // get launch button $firstchild = $this->model->children(0); $html = $this->tab != 'play' && is_object($firstchild) ? \Components\Resources\Helpers\Html::primary_child($this->option, $this->model->resource, $firstchild, '') : ''; // Display some supporting documents $children = $this->model->children(); // Sort out supporting docs $html .= $children && count($children) > 1 ? \Components\Resources\Helpers\Html::sortSupportingDocs($this->model->resource, $this->option, $children) : ''; //$html .= $feeds ? $feeds : ''; $html .= $this->tab != 'play' ? \Components\Resources\Helpers\Html::license($this->model->params->get('license', '')) : ''; echo $html; } // --- end else (if group check passed) ?> </div><!-- / .aside launcharea --> </div> <?php // Display canonical
if (!$this->model->access('view-all')) { $ghtml = array(); foreach ($this->model->resource->getGroups() as $allowedgroup) { $ghtml[] = '<a href="' . Route::url('index.php?option=com_groups&gid=' . $allowedgroup) . '">' . $allowedgroup . '</a>'; } ?> <p class="warning"> <?php echo Lang::txt('COM_RESOURCES_ERROR_MUST_BE_PART_OF_GROUP') . ' ' . implode(', ', $ghtml); ?> </p> <?php } else { $ccount = count($this->model->children('standalone')); if ($ccount > 0) { echo \Components\Resources\Helpers\Html::primary_child($this->option, $this->model->resource, '', ''); } // get launch button $firstChild = $this->model->children(0); // Display some supporting documents $children = $this->model->children('!standalone'); // Sort out supporting docs $html .= $children && count($children) > 1 ? \Components\Resources\Helpers\Html::sortSupportingDocs($this->model->resource, $this->option, $children) : ''; echo $html; $live_site = rtrim(Request::base(), '/'); ?> <p> <a class="feed" id="resource-audio-feed" href="<?php echo $live_site . '/resources/' . $this->model->resource->id . '/feed.rss?format=audio'; ?> "><?php
/** * Display a level of the tag browser * NOTE: This view should only be called through AJAX * * @return void */ public function browserTask() { // Incoming $level = Request::getInt('level', 0); // A container for info to pass to the HTML for the view $bits = array(); $bits['supportedtag'] = $this->config->get('supportedtag'); // Process the level switch ($level) { case 1: // Incoming $bits['type'] = Request::getInt('type', 7); $bits['id'] = Request::getInt('id', 0); $bits['tg'] = Request::getVar('input', ''); $bits['tg2'] = Request::getVar('input2', ''); $rt = new Tags($bits['id']); // Get tags that have been assigned $bits['tags'] = $rt->get_tags_with_objects($bits['id'], $bits['type'], $bits['tg2']); break; case 2: // Incoming $bits['type'] = Request::getInt('type', 7); $bits['id'] = Request::getInt('id', 0); $bits['tag'] = Request::getVar('input', ''); $bits['tag2'] = Request::getVar('input2', ''); $bits['sortby'] = Request::getVar('sortby', 'title'); $bits['filter'] = Request::getVar('filter', array('level0', 'level1', 'level2', 'level3', 'level4')); if ($bits['tag'] == $bits['tag2']) { $bits['tag2'] = ''; } // Get parameters $bits['params'] = $this->config; // Get extra filter options $bits['filters'] = array(); if ($this->config->get('show_audience') && $bits['type'] == 7) { include_once dirname(dirname(__DIR__)) . DS . 'tables' . DS . 'audience.php'; include_once dirname(dirname(__DIR__)) . DS . 'tables' . DS . 'audiencelevel.php'; $rL = new AudienceLevel($this->database); $bits['filters'] = $rL->getLevels(); } $rt = new Tags($bits['id']); $bits['rt'] = $rt; // Get resources assigned to this tag $bits['tools'] = $rt->get_objects_on_tag($bits['tag'], $bits['id'], $bits['type'], $bits['sortby'], $bits['tag2'], $bits['filter']); // Set the typetitle $bits['typetitle'] = Lang::txt('COM_RESOURCES'); // See if we can load the type so we can set the typetitle if (isset($bits['type']) && $bits['type'] != 0) { $t = new Type($this->database); $t->load($bits['type']); $bits['typetitle'] = stripslashes($t->type); } $bits['supportedtagusage'] = $rt->getTagUsage($bits['supportedtag'], 'id'); break; case 3: // Incoming (should be a resource ID) $id = Request::getInt('input', 0); include_once dirname(dirname(__DIR__)) . DS . 'models' . DS . 'resource.php'; $model = Models\Resource::getInstance($id); $rt = new Tags($id); $bits['rt'] = $rt; $bits['config'] = $this->config; $bits['params'] = $model->params; // Get resource $model->resource->ranking = round($model->resource->ranking, 1); // Generate the SEF if ($model->resource->alias) { $sef = Route::url('index.php?option=' . $this->_option . '&alias=' . $model->resource->alias); } else { $sef = Route::url('index.php?option=' . $this->_option . '&id=' . $model->resource->id); } // Get resource helper $helper = new Helper($model->resource->id, $this->database); //$helper->getFirstChild(); //$helper->getContributorIDs(); $bits['authorized'] = $model->access('edit'); //$this->_authorize($helper->contributorIDs, $resource); $firstChild = $model->children(0); // Get the first child if ($firstChild || $model->isTool()) { $bits['primary_child'] = Html::primary_child($this->_option, $model->resource, $firstChild, ''); } // Get the sections $bits['sections'] = Event::trigger('resources.onResources', array($model, $this->_option, array('about'), 'metadata')); // Fill our container $bits['resource'] = $model->resource; $bits['helper'] = $helper; $bits['sef'] = $sef; break; } // Instantiate a new view $this->view->config = $this->config; $this->view->level = $level; $this->view->bits = $bits; // Output HTML foreach ($this->getErrors() as $error) { $this->view->setError($error); } $this->view->setName('browse')->setLayout('tags_list')->display(); }