Exemple #1
0
 /**
  * The function returns References for current Article.
  * 
  * @access public
  * @return array The References.
  */
 public function getReferences()
 {
     $Ref = new Article_Reference();
     return $Ref->findList(array('ArticleId = ' . $this->Id), 'Layout asc');
 }
Exemple #2
0
 /**
  * The function returns references for current Article.
  * 
  * @access public
  * @param int $id The Article id.
  * @return string The HTML code.
  */
 public function ref($id = null)
 {
     $Article = new Article();
     if (Request::get('Reference')) {
         $Article = $Article->findItem(array('Id = ' . $id));
         if ($Article->Id) {
             $Reference = new Article_Reference();
             $Reference->ArticleId = $Article->Id;
             $Reference->setPost(Request::get('Reference', array()));
             $Reference->save();
         }
     }
     if (Request::get('delete')) {
         $Reference = new Article_Reference();
         $Reference = $Reference->findItem(array('Id = ' . Request::get('id')));
         $Article = $Reference->getArticle();
         $Reference->drop();
     }
     return $this->getView()->htmlReferences($Article);
 }