public function beforeFilter() { $this->appendJs('jquery-1.8.2.min.js', PJ_THIRD_PARTY_PATH . 'jquery/'); $this->appendJs('pjAdminCore.js'); $this->appendCss('reset.css'); $this->appendJs('jquery-ui.custom.min.js', PJ_THIRD_PARTY_PATH . 'jquery_ui/js/'); $this->appendCss('jquery-ui.min.css', PJ_THIRD_PARTY_PATH . 'jquery_ui/css/smoothness/'); $this->appendCss('pj-all.css', PJ_FRAMEWORK_LIBS_PATH . 'pj/css/'); $this->appendCss('admin.css'); if ($_GET['controller'] != 'pjInstaller') { $this->models['Option'] = pjOptionModel::factory(); $this->option_arr = $this->models['Option']->getPairs($this->getForeignId()); $this->set('option_arr', $this->option_arr); $this->setTime(); if (!isset($_SESSION[$this->defaultLocale])) { $locale_arr = pjLocaleModel::factory()->where('is_default', 1)->limit(1)->findAll()->getData(); if (count($locale_arr) === 1) { $this->setLocaleId($locale_arr[0]['id']); } } if (!in_array($_GET['action'], array('pjActionPreview'))) { $this->loadSetFields(); } } }
public function beforeFilter() { $OptionModel = pjOptionModel::factory(); $this->option_arr = $OptionModel->getPairs($this->getForeignId()); $this->set('option_arr', $this->option_arr); $this->setTime(); if (!isset($_SESSION[$this->defaultLocale])) { $locale_arr = pjLocaleModel::factory()->where('is_default', 1)->limit(1)->findAll()->getData(); if (count($locale_arr) === 1) { $this->setLocaleId($locale_arr[0]['id']); } } if (!in_array($_GET['action'], array('pjActionLoadCss'))) { $this->loadSetFields(); } }
public function pjActionIndex() { $this->checkLogin(); if ($this->isAdmin()) { if (isset($_POST['sms_post'])) { $pjOptionModel = pjOptionModel::factory(); if (0 != $pjOptionModel->where('foreign_id', $this->getForeignId())->where('`key`', 'plugin_sms_api_key')->findCount()->getData()) { $pjOptionModel->limit(1)->modifyAll(array('value' => $_POST['plugin_sms_api_key'])); } else { $pjOptionModel->setAttributes(array('foreign_id' => $this->getForeignId(), 'key' => 'plugin_sms_api_key', 'tab_id' => '99', 'value' => $_POST['plugin_sms_api_key'], 'type' => 'string', 'is_visible' => 0))->insert(); } pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjSms&action=pjActionIndex&err=PSS02"); } $this->appendJs('jquery.datagrid.js', PJ_FRAMEWORK_LIBS_PATH . 'pj/js/'); $this->appendJs('pjSms.js', $this->getConst('PLUGIN_JS_PATH')); } else { $this->set('status', 2); } }
private function pjActionUpdateFieldsIndex() { return pjOptionModel::factory()->where('`key`', 'o_fields_index')->limit(1)->modifyAll(array('value' => md5(uniqid(rand(), true))))->getAffectedRows(); }
public function pjActionTerm() { $this->checkLogin(); if ($this->isAdmin()) { $arr = pjOptionModel::factory()->where('t1.foreign_id', $this->getForeignId())->orderBy('t1.order ASC')->findAll()->getData(); $arr['i18n'] = pjMultiLangModel::factory()->getMultiLang(1, 'pjOption'); $this->set('arr', $arr); $locale_arr = pjLocaleModel::factory()->select('t1.*, t2.file')->join('pjLocaleLanguage', 't2.iso=t1.language_iso', 'left')->where('t2.file IS NOT NULL')->orderBy('t1.sort ASC')->findAll()->getData(); $lp_arr = array(); foreach ($locale_arr as $item) { $lp_arr[$item['id'] . "_"] = $item['file']; } $this->set('lp_arr', $locale_arr); $this->set('locale_str', pjAppController::jsonEncode($lp_arr)); $this->appendJs('jquery.multilang.js', PJ_FRAMEWORK_LIBS_PATH . 'pj/js/'); $this->appendJs('jquery.tipsy.js', PJ_THIRD_PARTY_PATH . 'tipsy/'); $this->appendCss('jquery.tipsy.css', PJ_THIRD_PARTY_PATH . 'tipsy/'); $this->appendJs('pjAdminOptions.js'); } }
public function pjActionLicense() { $arr = pjOptionModel::factory()->where('t1.foreign_id', $this->getForeignId())->where('t1.key', 'private_key')->limit(1)->findAll()->getData(); $hash = NULL; if (count($arr) === 1) { $hash = $arr[0]['value']; } pjUtil::redirect(base64_decode("aHR0cDovL3N1cHBvcnQuc3RpdmFzb2Z0LmNvbS9jaGVja2xpY2Vuc2Uv") . $hash); }