예제 #1
0
 public static function run()
 {
     require_once dirname(__FILE__) . '/classes/config.class.php';
     $name = PrisnaGWTConfig::getDbSettingsName();
     if (get_option($name)) {
         delete_option($name);
     }
 }
 public static function getSettings($_force = false, $_direct = false)
 {
     if (is_array(self::$_settings) && $_force == false) {
         return self::$_settings;
     }
     $current = self::_get_settings();
     if ($_direct) {
         return $current;
     }
     $defaults = self::getDefaults();
     $result = PrisnaGWTCommon::mergeArrays($defaults, $current);
     $result = self::_adjust_languages($result, $current);
     return self::$_settings = $result;
 }
예제 #3
0
 public static function isLoadingAdminPage()
 {
     return in_array(PrisnaGWTCommon::getVariable('page', 'GET'), array(PrisnaGWTConfig::getAdminHandle()));
 }
예제 #4
0
 protected function _gen_options()
 {
     $this->align_mode = PrisnaGWTConfig::getSettingValue('align_mode');
     $this->_gen_layout();
     $this->_gen_languages();
     $this->_gen_google_analytics();
     $this->_gen_banner();
     $this->_gen_flags();
     $result = array();
     foreach ($this->_properties as $key => $property) {
         if (array_key_exists('option_id', $property) && !PrisnaGWTValidator::isEmpty($property['option_id'])) {
             $result[$key] = array('option_id' => $property['option_id'], 'value' => $this->_prepare_option_value($key, $property['value']));
         }
     }
     $this->options_formatted = PrisnaGWTCommon::renderObject($result, array('type' => 'html', 'content' => "\t\t{{ option_id }}: {{ value }},\n"));
     $this->options_formatted = preg_replace('/,\\n$/', "\n", $this->options_formatted);
 }
예제 #5
0
 public function __construct($_properties)
 {
     $this->xml_url = PrisnaGWTCommon::getHomeUrl('/' . PrisnaGWTConfig::getSitemapFilename() . '.xml');
     $this->csv_url = PrisnaGWTCommon::getHomeUrl('/' . PrisnaGWTConfig::getSitemapFilename() . '.csv');
     parent::__construct($_properties);
 }
 public static function isAvailable()
 {
     if (PrisnaGWTConfig::getSettingValue('test_mode') == 'true' && !current_user_can('administrator')) {
         return false;
     }
     return true;
 }