Example #1
0
 function execute(&$form, $action_id)
 {
     $config = $form->actions_config[$action_id];
     $settings_model = new \GCore\Admin\Models\Extension();
     $settings = $settings_model->find('first', array('conditions' => array('name' => 'chronoforms')));
     if ((int) $settings['Extension']['settings']['validated'] != 1) {
         echo '<br ' . '/><br' . ' /><a href="http://www.chronoengine.com" target="_blank"><stron' . 'g>Pow' . 'ere' . 'd b' . 'y Chr' . 'onoForms ' . '- C' . 'op' . 'yr' . 'ight' . ' (c' . ') 20' . '12 C' . 'hr' . 'ono' . 'E' . 'ng' . 'ine.' . 'com</st' . 'rong></a><b' . 'r />';
     }
 }
Example #2
0
 public static function admin_initialize($name)
 {
     $patch = " - Trial";
     $settings_model = new \GCore\Admin\Models\Extension();
     $settings_data = $settings_model->find('first', array('conditions' => array('name' => 'chronoforms')));
     if (!empty($settings_data['Extension']['settings'])) {
         $settings = $settings_data['Extension']['settings'];
         if (!empty($settings['validated_paypal'])) {
             $patch = " - Full";
         }
     }
     self::$title = self::$title . $patch;
     parent::admin_initialize($name);
 }
Example #3
0
 public static function getSettings($ext)
 {
     static $loaded;
     if (isset($loaded[$ext])) {
         return $loaded[$ext];
     } else {
         $settings_model = new \GCore\Admin\Models\Extension();
         $settings = $settings_model->find('first', array('conditions' => array('name' => $ext), 'cache' => true, 'recursive' => -1));
         if (!empty($settings['Extension']['settings'])) {
             return $loaded[$ext] = new Parameter($settings['Extension']['settings']);
         } else {
             return $loaded[$ext] = new Parameter('');
         }
     }
 }
Example #4
0
 function _save_settings($ext)
 {
     $settings_model = new \GCore\Admin\Models\Extension();
     $extenion_name = Str::camilize($ext);
     //check data exist
     $settings = $settings_model->find('first', array('conditions' => array('name' => $ext)));
     if (!empty($this->data[$extenion_name])) {
         if (!empty($settings['Extension']['settings'])) {
             $this->data[$extenion_name] = array_merge($settings['Extension']['settings'], $this->data[$extenion_name]);
             return $settings_model->save(array('settings' => $this->data[$extenion_name]), array('conditions' => array('name' => $ext)));
         } else {
             return $settings_model->save(array('name' => $ext, 'enabled' => 1, 'settings' => $this->data[$extenion_name]));
         }
     }
     return false;
 }
Example #5
0
 public static function _settings()
 {
     static $settings;
     if (!empty($settings)) {
         return $settings;
     }
     $settings_model = new \GCore\Admin\Models\Extension();
     $settings_data = $settings_model->find('first', array('conditions' => array('name' => 'chronoforms')));
     if (!empty($settings_data['Extension']['settings'])) {
         $settings = $settings_data['Extension']['settings'];
         return $settings;
     } else {
         return array();
     }
 }