Example #1
0
 /**
  * Register SEO form data
  *
  * @access	private
  * @param   integer $id_area Area ID
  * @param   array 	$_post _POST array
  * @return  void
  */
 private function editing_seo_data($id_area, $_post)
 {
     $msg = null;
     // check permission
     $msg = AdmUtils_helper::chk_priv_level($_SESSION['xuid'], 'areas', $id_area, 2);
     if (is_null($msg)) {
         // handle _POST
         $c = 0;
         $post = array();
         while (isset($_post['id_' . $c])) {
             $post[$_post['id_' . $c]] = array('title' => $_post['title_' . $c], 'description' => $_post['description_' . $c], 'keywords' => $_post['keywords_' . $c]);
             $c++;
         }
         // areas data relating to SEO are stored in 'alang'
         $mod = new Language_model();
         // enable logs
         if (LOGS && DEVEL) {
             $mod->set_log(true);
         }
         $result = $mod->update_seo_data($post);
         $msg = AdmUtils_helper::set_msg($result);
         // set what update
         if ($result[1]) {
             $msg->update[] = array('element' => 'topic', 'url' => BASE_URL . 'areas/index/1', 'title' => null);
         }
     }
     $this->response($msg);
 }