Esempio n. 1
0
 /**
  * 
  */
 public function ajaxRemoveTag($id)
 {
     $filter = JFilterInput::getInstance();
     $id = $filter->clean($id, 'int');
     $objResponse = new JAXResponse();
     $my = CFactory::getUser();
     // @todo: make sure user has the permission
     CFactory::load('libraries', 'tags');
     $tags = new CTags();
     $tag =& JTable::getInstance('Tag', 'CTable');
     $tag->load($id);
     $table = $tags->getItemTable($tag);
     $allowEdit = $table->tagAllow($my->id);
     if ($allowEdit) {
         $tags->delete($id);
         $objResponse->addScriptCall('joms.jQuery(\'#tag-' . $id . '\').remove');
     }
     return $objResponse->sendResponse();
 }