Ejemplo n.º 1
0
 /**
  * Fix pathway
  *
  * @param      object  	$page
  *
  * @return     string
  */
 public function fixupPathway()
 {
     Pathway::clear();
     // Add group
     if ($this->model->groupOwner()) {
         Pathway::append(Lang::txt('COM_PROJECTS_GROUPS_COMPONENT'), Route::url('index.php?option=com_groups'));
         Pathway::append(\Hubzero\Utility\String::truncate($this->model->groupOwner('description'), 50), Route::url('index.php?option=com_groups&cn=' . $this->model->groupOwner('cn')));
         Pathway::append(Lang::txt('COM_PROJECTS_PROJECTS'), Route::url('index.php?option=com_groups&cn=' . $this->model->groupOwner('cn') . '&active=projects'));
     } else {
         Pathway::append(Lang::txt('COMPONENT_LONG_NAME'), Route::url('index.php?option=' . $this->_option));
     }
     if ($this->model->exists()) {
         Pathway::append(stripslashes($this->model->get('title')), Route::url('index.php?option=' . $this->_option . '&alias=' . $this->model->get('alias')));
     }
     if ($this->_tool && $this->_tool->id) {
         Pathway::append(ucfirst(Lang::txt('COM_PROJECTS_PANEL_TOOLS')), Route::url('index.php?option=' . $this->_option . '&alias=' . $this->model->get('alias') . '&active=tools'));
         Pathway::append(\Hubzero\Utility\String::truncate($this->_tool->title, 50), Route::url('index.php?option=' . $this->_option . '&alias=' . $this->model->get('alias') . '&active=tools&tool=' . $this->_tool->id));
         Pathway::append(ucfirst(Lang::txt('COM_PROJECTS_TOOLS_TAB_WIKI')), Route::url('index.php?option=' . $this->_option . '&alias=' . $this->model->get('alias') . '&active=tools&tool=' . $this->_tool->id . '&action=wiki'));
     } else {
         Pathway::append(ucfirst(Lang::txt('COM_PROJECTS_TAB_NOTES')), Route::url('index.php?option=' . $this->_option . '&alias=' . $this->model->get('alias') . '&active=notes'));
     }
 }
Ejemplo n.º 2
0
 /**
  * Build the "trail"
  *
  * @return  void
  */
 protected function _buildPathway()
 {
     $group_tasks = array('start', 'setup', 'view');
     $group = isset($this->group) ? $this->group : NULL;
     $active = isset($this->active) ? $this->active : NULL;
     // Point to group if group project
     if (is_object($group) && in_array($this->_task, $group_tasks)) {
         Pathway::clear();
         Pathway::append(Lang::txt('COM_PROJECTS_GROUPS_COMPONENT'), Route::url('index.php?option=com_groups'));
         Pathway::append(\Hubzero\Utility\String::truncate($group->get('description'), 50), Route::url('index.php?option=com_groups&cn=' . $group->cn));
         Pathway::append(Lang::txt('COM_PROJECTS_PROJECTS'), Route::url('index.php?option=com_groups&cn=' . $group->cn . '&active=projects'));
     } elseif (Pathway::count() <= 0) {
         Pathway::append(Lang::txt('COMPONENT_LONG_NAME'), Route::url('index.php?option=' . $this->_option));
     }
     // Project path
     if ($this->model->exists()) {
         $alias = $this->model->get('alias');
         $provisioned = $this->model->isProvisioned();
         $title = $this->model->get('title');
     }
     if (!empty($alias)) {
         if (!empty($provisioned)) {
             Pathway::append(stripslashes(Lang::txt('COM_PROJECTS_PROVISIONED_PROJECT')), Route::url('index.php?option=' . $this->_option . '&alias=' . $alias . '&action=activate'));
         } else {
             Pathway::append(stripslashes($title), Route::url('index.php?option=' . $this->_option . '&alias=' . $alias));
         }
     }
     // Controllers
     switch ($this->_controller) {
         case 'reports':
             Pathway::append(Lang::txt(strtoupper($this->_option) . '_' . strtoupper($this->_controller)), Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller));
             break;
         default:
             break;
     }
     // Task is set?
     if (!$this->_task) {
         return;
     }
     // Tasks
     switch ($this->_task) {
         case 'view':
             if ($active && !empty($alias)) {
                 switch ($active) {
                     case 'feed':
                         // nothing to add
                         break;
                     default:
                         Pathway::append(ucfirst(Lang::txt('COM_PROJECTS_TAB_' . strtoupper($this->active))), Route::url('index.php?option=' . $this->_option . '&alias=' . $alias . '&active=' . $active));
                         break;
                 }
             }
             break;
         case 'setup':
         case 'edit':
             if (empty($alias)) {
                 Pathway::append(Lang::txt(strtoupper($this->_option) . '_' . strtoupper($this->_task)), Route::url('index.php?option=' . $this->_option . '&task=' . $this->_task));
                 break;
             }
             break;
         case 'browse':
         case 'process':
             $reviewer = Request::getWord('reviewer', '');
             if ($reviewer == 'sponsored' || $reviewer == 'sensitive') {
                 $title = $reviewer == 'sponsored' ? Lang::txt('COM_PROJECTS_REVIEWER_SPS') : Lang::txt('COM_PROJECTS_REVIEWER_HIPAA');
                 Pathway::append($title, Route::url('index.php?option=' . $this->_option . '&task=browse&reviewer=' . $reviewer));
             } else {
                 Pathway::append(Lang::txt(strtoupper($this->_option) . '_' . strtoupper($this->_task)), Route::url('index.php?option=' . $this->_option . '&task=' . $this->_task));
             }
             break;
         case 'intro':
         case 'activate':
             // add nothing else
             break;
         default:
             Pathway::append(Lang::txt(strtoupper($this->_option) . '_' . strtoupper($this->_task)), Route::url('index.php?option=' . $this->_option . '&task=' . $this->_task));
             break;
     }
 }