Пример #1
0
 /**
  * Manage tags on a resource
  *
  * @return  void
  */
 public function displayTask()
 {
     $id = Request::getInt('id', 0);
     // Get resource title
     $row = new Resource($this->database);
     $row->load($id);
     if (!$row->get('id')) {
         Notify::error(Lang::txt('COM_RESOURCES_NOTFOUND'));
         return $this->cancelTask();
     }
     // Get tags for this resource
     $rt = new TagCloud($id);
     $mytagarray = array();
     $myrawtagarray = array();
     foreach ($rt->tags() as $tagMen) {
         $mytagarray[] = $tagMen->get('tag');
         $myrawtagarray[] = $tagMen->get('raw_tag');
     }
     // Get all tags
     $tags = $rt->tags('list', array('scope' => null, 'scope_id' => 0), true);
     $objtags = new stdClass();
     $objtags->tagMen = implode(', ', $myrawtagarray);
     // Output the HTML
     $this->view->set('id', $id)->set('row', $row)->set('tags', $tags)->set('mytagarray', $mytagarray)->set('objtags', $objtags)->setErrors($this->getErrors())->display();
 }