Beispiel #1
0
 public function save()
 {
     $namespace = N2Request::getCmd('namespace', 'default');
     $settings = N2Request::getVar('settings');
     if ($namespace && $settings) {
         if ($namespace == 'default') {
             $namespace = 'settings';
         }
         if ($namespace == 'font' && N2Request::getInt('sliderid')) {
             $namespace .= N2Request::getInt('sliderid');
             self::markChanged(N2Request::getInt('sliderid'));
         }
         if ($namespace == 'joomla') {
             $license = empty($settings['license']) ? '' : $settings['license'];
             $updates = $this->db->queryAll("SELECT b.update_site_id FROM " . $this->db->tableAlias("extensions") . " AS a LEFT JOIN " . $this->db->tableAlias("update_sites_extensions") . " AS b ON a.extension_id = b.extension_id WHERE a.element = 'com_smartslider3'");
             if (count($updates)) {
                 $id = $updates[0]['update_site_id'];
                 unset($updates[0]);
                 if (count($updates)) {
                     foreach ($updates as $u) {
                         $this->db->setTableName("update_sites");
                         $this->db->deleteByAttributes(array("update_site_id" => $u['update_site_id']));
                         $this->db->setTableName("update_sites_extensions");
                         $this->db->deleteByAttributes(array("update_site_id" => $u['update_site_id']));
                     }
                 }
                 $this->db->setTableName("update_sites");
                 $this->db->update(array("location" => 'http://www.nextendweb.com/update2/joomla/update.php?license=' . urlencode($license) . '&fake=extension.xml'), array("update_site_id" => $id));
             }
         }
         N2SmartSliderSettings::store($namespace, json_encode($settings));
     }
 }
Beispiel #2
0
 static function set($key, $value)
 {
     self::getAll();
     self::$settings[$key] = $value;
     N2SmartSliderSettings::store(self::$_type, json_encode(self::$settings));
 }