/** * Get the list of available pages * Called via Ajax * * @param integer $id_area Area ID * @param string $lang Language code * @param integer $code_context Context code * @return string Options list */ public function refresh_pages($id_area, $lang, $code_context) { // get context key $mod = new Context_model(); $context = $mod->get_by_code($id_area, $lang, $code_context); $str = ''; // only if code key is pages return options list if ($context->xkey == 'pages') { // get pages $items = $mod->get_pages($id_area, $lang); foreach ($items as $i) { $str .= '<option value="' . $i->id . '">' . $i->name . '</option>'; } } echo $str; }