Exemplo n.º 1
0
 public function admin_settings()
 {
     $uri = 'options-general.php?page=' . $this->args['domain'];
     $sub = isset($_GET['sub']) ? trim($_GET['sub']) : 'general';
     $subs = $this->getFilters($this->component . '_settings_subs', array());
     $messages = $this->getFilters($this->component . '_settings_messages', array());
     $titles = $this->getFilters($this->component . '_settings_titles', array());
     echo '<div class="wrap -settings-wrap">';
     printf('<h1>%s</h1>', isset($titles['title']) ? $titles['title'] : $this->args['title']);
     gPluginFormHelper::headerNav($uri, $sub, $subs);
     if (!empty($_GET['message'])) {
         if (empty($messages[$_REQUEST['message']])) {
             gPluginHTML::notice($_REQUEST['message'], 'notice-error');
         } else {
             echo $messages[$_REQUEST['message']];
         }
         $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
     }
     $file = $this->constants['plugin_dir'] . 'admin/' . $this->component . '.admin.' . $sub . '.php';
     if (file_exists($file)) {
         require_once $file;
     } else {
         do_action($this->args['domain'] . '_' . $this->component . '_settings_sub_' . $sub, $uri, $sub);
     }
     echo '<div class="clear"></div></div>';
 }
Exemplo n.º 2
0
 public static function notice($notice, $class = 'notice-success fade', $echo = TRUE)
 {
     self::__dep('gPluginHTML::notice()');
     return gPluginHTML::notice($notice, $class, $echo);
 }