Example #1
0
 /**
  *  вернет список атачментов к посту
  *
  *  результат в $this->_actions_data['attachments']
  */
 public function action_attachments($post_id = null)
 {
     $this->_actions_data['attachments'] = array();
     if ($post_id == null) {
         if (empty($_REQUEST['post_id']) || !is_numeric($_REQUEST['post_id'])) {
             return;
         }
         $post_id = $_REQUEST['post_id'];
     }
     foreach (posts_attachments::find_all_by_post_id($post_id) as $attachment) {
         $this->_actions_data['attachments'][] = $attachment->attributes();
     }
 }