• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SettingsForm类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中SettingsForm的典型用法代码示例。如果您正苦于以下问题:PHP SettingsForm类的具体用法?PHP SettingsForm怎么用?PHP SettingsForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SettingsForm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: load

 public function load()
 {
     $this->headline = $GLOBALS['language']->getString("SETTINGS") . " (" . $GLOBALS['language']->getString("FOLDER") . ")";
     $settings = new SettingsForm();
     $settings->role = 3;
     $settings->template = "plugin_settingswidget_widget";
     if (isset($_SESSION['dir'])) {
         $settings->dir = $_SESSION['dir'];
     }
     if (isset($_GET['dir'])) {
         $settings->url = UrlRewriting::GetUrlByAlias($_GET['include'], "dir=" . $_GET['dir']);
     } else {
         $settings->url = UrlRewriting::GetUrlByAlias($_GET['include']);
     }
     if (isset($_GET['areatype'])) {
         $settings->areaType = $_GET['areatype'];
     }
     if (isset($_GET['area'])) {
         $settings->area = $_GET['area'];
     }
     if (isset($_GET['role'])) {
         $settings->role = $_GET['role'];
     }
     $this->content = $settings->getCode();
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:25,代码来源:settingswidget.php


示例2: actionIndex

 public function actionIndex()
 {
     if (!Yii::app()->user->checkAccess('store.update')) {
         $this->redirect(array('site/ErrorException', 'err_no' => 403));
     }
     $settings = Yii::app()->settings;
     $model = new SettingsForm();
     if (isset($_POST['SettingsForm'])) {
         $model->setAttributes($_POST['SettingsForm']);
         $settings->deleteCache();
         foreach ($model->attributes as $category => $values) {
             $settings->set($category, $values);
         }
         Yii::app()->user->setFlash('success', '<strong>Well done!</strong> Site settings were updated..');
         $this->refresh();
     }
     foreach ($model->attributes as $category => $values) {
         $cat = $model->{$category};
         foreach ($values as $key => $val) {
             $cat[$key] = $settings->get($category, $key);
         }
         $model->{$category} = $cat;
     }
     $this->render('index', array('model' => $model));
 }
开发者ID:soklux,项目名称:bakou-pos,代码行数:25,代码来源:SettingsController.php


示例3: actionIndex

 public function actionIndex()
 {
     $settings = Yii::app()->settings;
     $model = new SettingsForm();
     if (isset($_POST['SettingsForm'])) {
         $model->setAttributes($_POST['SettingsForm']);
         $settings->deleteCache();
         foreach ($model->attributes as $category => $values) {
             if ($category === 'logo') {
                 continue;
             }
             $settings->set($category, $values);
         }
         Yii::app()->user->setFlash('success', 'Site settings were updated.');
         $this->refresh();
     }
     foreach ($model->attributes as $category => $values) {
         if ($category === 'logo') {
             continue;
         }
         $cat = $model->{$category};
         foreach ($values as $key => $val) {
             $cat[$key] = $settings->get($category, $key);
         }
         $model->{$category} = $cat;
     }
     $this->render('index', array('model' => $model));
 }
开发者ID:lhfcainiao,项目名称:basic,代码行数:28,代码来源:SettingsController.php


示例4: actionIndex

 public function actionIndex()
 {
     $settings = Yii::app()->settings;
     // 多个客户端同时操作时,每个客户端的缓存不一致,导致数据不一致,
     // 故删除cache, 统一从数据库取数据
     $settings->deleteCache();
     $model = new SettingsForm();
     if (isset($_POST['SettingsForm'])) {
         $model->setAttributes($_POST['SettingsForm']);
         //$settings->deleteCache();
         foreach ($model->attributes as $category => $values) {
             $settings->set($category, $values);
         }
         Yii::app()->user->setFlash('success', 'Site settings were updated.');
         $this->refresh();
     }
     foreach ($model->attributes as $category => $values) {
         $cat = $model->{$category};
         foreach ($values as $key => $val) {
             $cat[$key] = $settings->get($category, $key);
         }
         $model->{$category} = $cat;
     }
     $this->render('index', array('model' => $model));
 }
开发者ID:zwq,项目名称:unpei,代码行数:25,代码来源:SettingsController.php


示例5: actionUpdate

 public function actionUpdate($id)
 {
     $model = new SettingsForm();
     if (isset($_POST['SettingsForm'])) {
         $model->attributes = $_POST['SettingsForm'];
         if ($model->validate() && $model->save()) {
             $this->redirect(array('index'));
         }
     } else {
         $model->loadDataFromStore($id);
     }
     $directories = glob(Yii::getPathOfAlias('webroot.themes') . "/*", GLOB_ONLYDIR);
     $themes = array();
     foreach ($directories as $directory) {
         $themes[] = basename($directory);
     }
     $layouts = CHtml::listData(Layout::model()->findAll(), 'layout_id', 'name');
     $countries = CHtml::listData(Country::model()->findAll(), 'country_id', 'name');
     $zones = CHtml::listData(Zone::model()->findAllByAttributes(array('country_id' => $model->country)), 'zone_id', 'name');
     $languages = CHtml::listData(Language::model()->findAll(), 'language_id', 'name');
     $currencies = CHtml::listData(Currency::model()->findAll(), 'currency_id', 'title');
     $yesNoOptions = array(0 => Yii::t('settings', 'No'), 1 => Yii::t('settings', 'Yes'));
     $lengthClasses = CHtml::listData(LengthClassDescription::model()->findAll(), 'length_class_id', 'title');
     $weightClasses = CHtml::listData(WeightClassDescription::model()->findAll(), 'weight_class_id', 'title');
     $taxesOptions = array("" => Yii::t("settings", "--- None ---"), "shipping" => Yii::t("settings", "Shipping Address"), "payment" => Yii::t("settings", "Payment Address"));
     $customerGroups = CHtml::listData(CustomerGroupDescription::model()->findAll(), 'customer_group_id', 'name');
     $informations = array_merge(array(0 => Yii::t("settings", "--- None ---")), CHtml::listData(InformationDescription::model()->findAll(), 'information_id', 'title'));
     // TODO: localisation
     $orderStatuses = CHtml::listData(OrderStatus::model()->findAllByAttributes(array('language_id' => 1)), 'order_status_id', 'name');
     // TODO: localisation
     $returnStatuses = CHtml::listData(ReturnStatus::model()->findAllByAttributes(array('language_id' => 1)), 'return_status_id', 'name');
     $mailProtocols = array("mail" => Yii::t("settings", "Mail"), "smtp" => Yii::t("settings", "SMTP"));
     $this->render('update', array('model' => $model, 'themes' => $themes, 'layouts' => $layouts, 'countries' => $countries, 'zones' => $zones, 'languages' => $languages, 'currencies' => $currencies, 'yesNoOptions' => $yesNoOptions, 'lengthClasses' => $lengthClasses, 'weightClasses' => $weightClasses, 'taxesOptions' => $taxesOptions, 'customerGroups' => $customerGroups, 'informations' => $informations, 'orderStatuses' => $orderStatuses, 'returnStatuses' => $returnStatuses, 'mailProtocols' => $mailProtocols));
 }
开发者ID:damnpoet,项目名称:yiicart,代码行数:34,代码来源:SettingsController.php


示例6: SettingsForm

 public function SettingsForm()
 {
     $form = new SettingsForm($this, 'SettingsForm');
     $member_id = Member::currentUserID();
     $back_url = isset($_POST['RedirectURL']) ? $_POST['RedirectURL'] : $_GET['RedirectURL'];
     $form->loadDataFrom(array("MemberID" => $member_id, "RedirectURL" => $back_url));
     return $form;
 }
开发者ID:liquidedge,项目名称:forum_subscribe,代码行数:8,代码来源:SubscribeController.php


示例7: index

 /**
  * Default action
  */
 public function index()
 {
     $form = new SettingsForm($this);
     if (!empty($_POST) && $form->isValid($_POST)) {
         $data = $form->getValues();
         OW::getConfig()->saveConfig('blogs', 'results_per_page', $data['results_per_page']);
     }
     $this->addForm($form);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:12,代码来源:admin.php


示例8: index

 /**
  * Default action
  */
 public function index()
 {
     $form = new SettingsForm($this);
     if (!empty($_POST) && $form->isValid($_POST)) {
         $data = $form->getValues();
         OW::getConfig()->saveConfig('links', 'results_per_page', $data['results_per_page']);
         OW::getConfig()->saveConfig('links', 'result_mode', $data['mode']);
         OW::getFeedback()->info(OW::getLanguage()->text('links', 'updated'));
         $this->redirect(OW::getRouter()->getBaseUrl() . OW::getRouter()->getUri());
     }
     $this->addForm($form);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:15,代码来源:admin.php


示例9: display

    public function display()
    {
        $settings = new SettingsForm();
        $settings->role = 3;
        $settings->url = UrlRewriting::GetUrlByAlias($_GET['include']);
        if (isset($_GET['areatype'])) {
            $settings->areaType = $_GET['areatype'];
        }
        if (isset($_GET['area'])) {
            $settings->area = $_GET['area'];
        }
        if (isset($_GET['role'])) {
            $settings->role = $_GET['role'];
        }
        $settings->display();
        ?>
        <div style="margin-left:500px;">
        <h2>Skins</h2>
      <?php 
        $skins = DataBase::Current()->ReadRows("SELECT * FROM {'dbprefix'}skins WHERE LOWER(name) IN (SELECT DISTINCT name FROM {'dbprefix'}settings WHERE areaType = 'skins' AND area = {'dbprefix'}skins.name)");
        if ($skins) {
            foreach ($skins as $skin) {
                $url = UrlRewriting::GetUrlByAlias("admin/settings", "areatype=skins&area=" . urlencode($skin->name));
                echo "<a href=\"" . $url . "\">" . $skin->name . "</a><br />";
            }
        }
        ?>
        <h2>Plugins</h2>
      <?php 
        $plugins = new PluginList();
        $plugins->loadAll();
        foreach ($plugins->plugins as $plugin) {
            if ($plugin->configurationFile != '') {
                $url = UrlRewriting::GetUrlByAlias("admin/pluginsettings", "plugin=" . $plugin->path);
                ?>
              <a href="<?php 
                echo $url;
                ?>
"><?php 
                echo $plugin->name;
                ?>
</a><br />
            <?php 
            }
        }
        ?>
        </div>
      <?php 
    }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:49,代码来源:settingspage.php


示例10: actionSettings

 public function actionSettings()
 {
     $model = new SettingsForm();
     // collect user input data
     if (isset($_POST['SettingsForm'])) {
         if ($_POST['SettingsForm']['BITLY_API_KEY'] && $_POST['SettingsForm']['BITLY_LOGIN']) {
             $model->setScenario('validate_bitly');
         }
         $model->attributes = $_POST['SettingsForm'];
         if ($model->validate()) {
             $model->save();
         }
     }
     $this->render('settings', array('formModel' => $model));
 }
开发者ID:priyranjansingh,项目名称:getleads,代码行数:15,代码来源:AccountController.php


示例11: manage

 function manage($verb, $args)
 {
     if (parent::manage($verb, $args)) {
         return true;
     }
     if (!$this->getEnabled()) {
         return false;
     }
     switch ($verb) {
         case 'settings':
             $journal =& Request::getJournal();
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, null, 'plugins');
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         default:
             return false;
     }
     return true;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:31,代码来源:MetsGatewayPlugin.inc.php


示例12: WPCW_showPage_Settings_Network_load

/**
 * Shows the settings page for the plugin, shown just for the network page.
 */
function WPCW_showPage_Settings_Network_load()
{
    $page = new PageBuilder(true);
    $page->showPageHeader(__('WP Courseware - Settings', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
    $settingsFields = array('section_access_key' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Licence Key Settings', 'wp_courseware'), false, true)), 'licence_key' => array('label' => __('Licence Key', 'wp_courseware'), 'type' => 'text', 'desc' => __('Your licence key for the WP Courseware plugin.', 'wp_courseware'), 'validate' => array('type' => 'string', 'maxlen' => 32, 'minlen' => 32, 'regexp' => '/^[A-Za-z0-9]+$/', 'error' => __('Please enter your 32 character licence key, which contains only letters and numbers.', 'wp_courseware'))));
    $settings = new SettingsForm($settingsFields, WPCW_DATABASE_SETTINGS_KEY, 'wpcw_form_settings_general');
    // Set strings and messages
    $settings->setAllTranslationStrings(WPCW_forms_getTranslationStrings());
    $settings->setSaveButtonLabel('Save ALL Settings', 'wp_courseware');
    // Form event handlers - processes the saved settings in some way
    $settings->afterSaveFunction = 'WPCW_showPage_Settings_afterSave';
    $settings->show();
    // RHS Support Information
    $page->showPageMiddle('23%');
    WPCW_docs_showSupportInfo($page);
    WPCW_docs_showSupportInfo_News($page);
    WPCW_docs_showSupportInfo_Affiliate($page);
    $page->showPageFooter();
}
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:22,代码来源:page_settings.inc.php


示例13: WPCW_showPage_Certificates_load

/**
 * Show the page where the user can set up the certificate settings. 
 */
function WPCW_showPage_Certificates_load()
{
    $page = new PageBuilder(true);
    $page->showPageHeader(__('Training Courses - Certificate Settings', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
    $settingsFields = array('section_certificates_defaults' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Certificate Settings', 'wp_courseware'))), 'cert_signature_type' => array('label' => __('Signature Type', 'wp_courseware'), 'type' => 'radio', 'cssclass' => 'wpcw_cert_signature_type', 'required' => 'true', 'data' => array('text' => sprintf('<b>%s</b> - %s', __('Text', 'wp_courseware'), __('Just use text for the signature.', 'wp_courseware')), 'image' => sprintf('<b>%s</b> - %s', __('Image File', 'wp_courseware'), __('Use an image for the signature.', 'wp_courseware')))), 'cert_sig_text' => array('label' => __('Name to use for signature', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_signature_type_text', 'desc' => __('The name to use for the signature area.', 'wp_courseware'), 'validate' => array('type' => 'string', 'maxlen' => 150, 'minlen' => 1, 'regexp' => '/^[^<>]+$/', 'error' => __('Please enter the name to use for the signature area.', 'wp_courseware'))), 'cert_sig_image_url' => array('label' => __('Your Signature Image', 'wp_courseware'), 'cssclass' => 'wpcw_image_upload_field wpcw_cert_signature_type_image', 'type' => 'text', 'desc' => '&bull;&nbsp;' . __('The URL of your signature image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The image must be <b>%d pixels wide, and %d pixels high</b> to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_SIGNATURE_WIDTH_PX * 2, WPCW_CERTIFICATE_SIGNATURE_HEIGHT_PX * 2), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your signature image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_sig_image_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_sig_image_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for the signature image...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))), 'cert_logo_enabled' => array('label' => __('Show your logo?', 'wp_courseware'), 'cssclass' => 'wpcw_cert_logo_enabled', 'type' => 'radio', 'required' => 'true', 'data' => array('cert_logo' => sprintf('<b>%s</b> - %s', __('Yes', 'wp_courseware'), __('Use your logo on the certificate.', 'wp_courseware')), 'no_cert_logo' => sprintf('<b>%s</b> - %s', __('No', 'wp_courseware'), __('Don\'t show a logo on the certificate.', 'wp_courseware')))), 'cert_logo_url' => array('label' => __('Your Logo Image', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_logo_url wpcw_image_upload_field', 'desc' => '&bull;&nbsp;' . __('The URL of your logo image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The image must be <b>%d pixels wide, and %d pixels</b> high to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_LOGO_WIDTH_PX * 2, WPCW_CERTIFICATE_LOGO_HEIGHT_PX * 2), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your logo image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_logo_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_logo_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for your logo on the certificate...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))), 'cert_background_type' => array('label' => __('Certificate Background', 'wp_courseware'), 'cssclass' => 'wpcw_cert_background_type', 'type' => 'radio', 'required' => 'true', 'data' => array('use_default' => sprintf('<b>%s</b> - %s', __('Built-in', 'wp_courseware'), __('Use the built-in certificate background.', 'wp_courseware')), 'use_custom' => sprintf('<b>%s</b> - %s', __('Custom', 'wp_courseware'), __('Use your own certificate background.', 'wp_courseware')))), 'cert_background_custom_url' => array('label' => __('Custom Background Image', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_background_custom_url wpcw_image_upload_field', 'desc' => '&bull;&nbsp;' . __('The URL of your background image.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The background image must be <b>%d pixels wide, and %d pixels</b> high at <b>72 dpi</b> to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_BG_WIDTH_PX, WPCW_CERTIFICATE_BG_HEIGHT_PX), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your certificate background image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_background_custom_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_background_custom_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for the certificate background...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))));
    $settings = new SettingsForm($settingsFields, WPCW_DATABASE_SETTINGS_KEY, 'wpcw_form_settings_certificates');
    $settings->setSaveButtonLabel(__('Save ALL Settings', 'wp_courseware'));
    $settings->msg_settingsSaved = __('Settings successfully saved.', 'wp_courseware');
    $settings->msg_settingsProblem = __('There was a problem saving the settings.', 'wp_courseware');
    $settings->setAllTranslationStrings(WPCW_forms_getTranslationStrings());
    $settings->show();
    // RHS Support Information
    $page->showPageMiddle('23%');
    // Create a box where the admin can preview the certificates to see what they look like.
    $page->openPane('wpcw-certificates-preview', __('Preview Certificate', 'wp_courseware'));
    printf('<p>%s</p>', __('After saving the settings, you can preview the certificate using the button below. The preview opens in a new window.', 'wp_courseware'));
    printf('<div class="wpcw_btn_centre"><a href="%spdf_create_certificate.php?certificate=preview" target="_blank" class="button-primary">%s</a></div>', WPCW_plugin_getPluginPath(), __('Preview Certificate', 'wp_courseware'));
    $page->closePane();
    WPCW_docs_showSupportInfo($page);
    WPCW_docs_showSupportInfo_News($page);
    WPCW_docs_showSupportInfo_Affiliate($page);
    $page->showPageFooter();
}
开发者ID:NClaus,项目名称:Ambrose,代码行数:26,代码来源:page_settings_certificates.inc.php


示例14: WPCW_showPage_Certificates_load

/**
 * Show the page where the user can set up the certificate settings. 
 */
function WPCW_showPage_Certificates_load()
{
    $page = new PageBuilder(true);
    $page->showPageHeader(__('Training Courses - Certificate Settings', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
    $settingsFields = array('section_certificates_defaults' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Certificate Settings', 'wp_courseware'))), 'cert_signature_type' => array('label' => __('Signature Type', 'wp_courseware'), 'type' => 'radio', 'cssclass' => 'wpcw_cert_signature_type', 'required' => 'true', 'data' => array('text' => sprintf('<b>%s</b> - %s', __('Text', 'wp_courseware'), __('Just use text for the signature.', 'wp_courseware')), 'image' => sprintf('<b>%s</b> - %s', __('Image File', 'wp_courseware'), __('Use an image for the signature.', 'wp_courseware')))), 'cert_sig_text' => array('label' => __('Name to use for signature', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_signature_type_text', 'desc' => __('The name to use for the signature area.', 'wp_courseware'), 'validate' => array('type' => 'string', 'maxlen' => 150, 'minlen' => 1, 'regexp' => '/^[^<>]+$/', 'error' => __('Please enter the name to use for the signature area.', 'wp_courseware'))), 'cert_sig_image_url' => array('label' => __('Your Signature Image', 'wp_courseware'), 'cssclass' => 'wpcw_image_upload_field wpcw_cert_signature_type_image', 'type' => 'text', 'desc' => '&bull;&nbsp;' . __('The URL of your signature image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The image must be <b>%d pixels wide, and %d pixels high</b> to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_SIGNATURE_WIDTH_PX * 2, WPCW_CERTIFICATE_SIGNATURE_HEIGHT_PX * 2), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your signature image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_sig_image_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_sig_image_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for the signature image...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))), 'cert_logo_enabled' => array('label' => __('Show your logo?', 'wp_courseware'), 'cssclass' => 'wpcw_cert_logo_enabled', 'type' => 'radio', 'required' => 'true', 'data' => array('cert_logo' => sprintf('<b>%s</b> - %s', __('Yes', 'wp_courseware'), __('Use your logo on the certificate.', 'wp_courseware')), 'no_cert_logo' => sprintf('<b>%s</b> - %s', __('No', 'wp_courseware'), __('Don\'t show a logo on the certificate.', 'wp_courseware')))), 'cert_logo_url' => array('label' => __('Your Logo Image', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_logo_url wpcw_image_upload_field', 'desc' => '&bull;&nbsp;' . __('The URL of your logo image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The image must be <b>%d pixels wide, and %d pixels</b> high to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_LOGO_WIDTH_PX * 2, WPCW_CERTIFICATE_LOGO_HEIGHT_PX * 2), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your logo image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_logo_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_logo_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for your logo on the certificate...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))), 'cert_background_type' => array('label' => __('Certificate Background', 'wp_courseware'), 'cssclass' => 'wpcw_cert_background_type', 'type' => 'radio', 'required' => 'true', 'data' => array('use_default' => sprintf('<b>%s</b> - %s', __('Built-in', 'wp_courseware'), __('Use the built-in certificate background.', 'wp_courseware')), 'use_custom' => sprintf('<b>%s</b> - %s', __('Custom', 'wp_courseware'), __('Use your own certificate background.', 'wp_courseware')))), 'cert_background_custom_url' => array('label' => __('Custom Background Image', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_background_custom_url wpcw_image_upload_field', 'desc' => '&bull;&nbsp;' . __('The URL of your background image.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The background image must be <b>%d pixels wide, and %d pixels</b> high at <b>72 dpi</b> to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_BG_WIDTH_PX, WPCW_CERTIFICATE_BG_HEIGHT_PX), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your certificate background image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_background_custom_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_background_custom_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for the certificate background...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))), 'section_encodings' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Language and Encoding Settings', 'wp_courseware'))), 'certificate_encoding' => array('label' => __('Certificate Encoding', 'wp_courseware'), 'type' => 'select', 'required' => true, 'desc' => __('Choose a codepage encoding that matches your language to ensure certificates render correctly. You may need an encoding other than <code>ISO-8859-1</code> if you are using a non-English language.', 'wp_courseware'), 'data' => array('ISO-8859-1' => __('ISO-8859-1 - Latin alphabet - North America, Western Europe, Latin America, etc. (Default)', 'wp_courseware'), 'ISO-8859-2' => __('ISO-8859-2 - Latin alphabet 2 - Eastern Europe.', 'wp_courseware'), 'ISO-8859-3' => __('ISO-8859-3 - Latin alphabet 3 - SE Europe, Esperanto', 'wp_courseware'), 'ISO-8859-4' => __('ISO-8859-4 - Latin alphabet 4 - Scandinavia/Baltics', 'wp_courseware'), 'ISO-8859-5' => __('ISO-8859-5 - Latin/Cyrillic - Bulgarian, Belarusian, Russian and Macedonian', 'wp_courseware'), 'ISO-8859-6' => __('ISO-8859-6 - Latin/Arabic - Arabic languages', 'wp_courseware'), 'ISO-8859-7' => __('ISO-8859-7 - Latin/Greek - modern Greek language', 'wp_courseware'), 'ISO-8859-8' => __('ISO-8859-8 - Latin/Hebrew - Hebrew languages', 'wp_courseware'), 'ISO-8859-9' => __('ISO-8859-9 - Latin 5 part 9 - Turkish languages', 'wp_courseware'), 'ISO-8859-10' => __('ISO-8859-10 - Latin 6 Lappish, Nordic, Eskimo - The Nordic languages', 'wp_courseware'), 'ISO-8859-15' => __('ISO-8859-15 - Latin 9 (aka Latin 0) - Similar to ISO 8859-1', 'wp_courseware'))));
    $settings = new SettingsForm($settingsFields, WPCW_DATABASE_SETTINGS_KEY, 'wpcw_form_settings_certificates');
    $settings->setSaveButtonLabel(__('Save ALL Settings', 'wp_courseware'));
    $settings->msg_settingsSaved = __('Settings successfully saved.', 'wp_courseware');
    $settings->msg_settingsProblem = __('There was a problem saving the settings.', 'wp_courseware');
    $settings->setAllTranslationStrings(WPCW_forms_getTranslationStrings());
    $settings->show();
    // RHS Support Information
    $page->showPageMiddle('23%');
    // Create a box where the admin can preview the certificates to see what they look like.
    $page->openPane('wpcw-certificates-preview', __('Preview Certificate', 'wp_courseware'));
    printf('<p>%s</p>', __('After saving the settings, you can preview the certificate using the button below. The preview opens in a new window.', 'wp_courseware'));
    printf('<div class="wpcw_btn_centre"><a href="%spdf_create_certificate.php?certificate=preview" target="_blank" class="button-primary">%s</a></div>', WPCW_plugin_getPluginPath(), __('Preview Certificate', 'wp_courseware'));
    $page->closePane();
    WPCW_docs_showSupportInfo($page);
    WPCW_docs_showSupportInfo_News($page);
    WPCW_docs_showSupportInfo_Affiliate($page);
    $page->showPageFooter();
}
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:26,代码来源:page_settings_certificates.inc.php


示例15: manage

 /**
  * Execute a management verb on this plugin
  * @param $verb string
  * @param $args array
  * @param $message string Result status message
  * @param $messageParams array Parameters for the message key
  * @return boolean
  */
 function manage($verb, $args, &$message, &$messageParams)
 {
     if (!parent::manage($verb, $args, $message, $messageParams)) {
         return false;
     }
     switch ($verb) {
         case 'settings':
             $journal =& Request::getJournal();
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     return false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             return true;
         default:
             // Unknown management verb
             assert(false);
             return false;
     }
 }
开发者ID:jasonzou,项目名称:OJS-2.4.6,代码行数:39,代码来源:AnnouncementFeedPlugin.inc.php


示例16: SettingsForm

    function SettingsForm()
    {
        parent::MailForm();
        $this->parseSettings('inc/app/devnotes/forms/settings/settings.php');
        $this->widgets['notes']->setValues(array('on' => intl_get('On'), 'off' => intl_get('Off'), 'date' => intl_get('Until date')));
        $this->widgets['submit_button']->setValues(intl_get('Save Changes'));
        $this->widgets['notes_date']->setValue(date('Y-m-d'));
        if (DEVNOTES === true) {
            $this->widgets['notes']->setValue('on');
        } elseif (DEVNOTES === false) {
            $this->widgets['notes']->setValue('off');
        } else {
            $this->widgets['notes']->setValue('date');
            $this->widgets['notes_date']->setValue(DEVNOTES);
        }
        $this->widgets['contact']->setValue(appconf('contact'));
        $this->widgets['ignore_list']->setValue(join(', ', appconf('ignore')));
    }
    function onSubmit($vals)
    {
        // update devnotes_config table and respond
        if ($vals['notes'] == 'date') {
            $vals['notes'] = $vals['notes_date'];
        }
        db_execute('update devnotes_config set notes = ?, contact = ?, ignore_list = ?', $vals['notes'], $vals['contact'], $vals['ignore_list']);
        header('Location: ' . site_prefix() . '/index/devnotes-admin-action');
        exit;
    }
}
$form = new SettingsForm();
echo $form->run();
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php


示例17: manage

 /**
  * @see GenericPlugin::manage()
  */
 function manage($verb, $args, &$message, &$messageParams)
 {
     if (!parent::manage($verb, $args, $message, $messageParams)) {
         return false;
     }
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
     $journal =& Request::getJournal();
     switch ($verb) {
         case 'connect':
             $this->import('classes.form.DataverseAuthForm');
             $form = new DataverseAuthForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, 'manager', 'plugin', array('generic', $this->getName(), 'select'));
                     return false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             return true;
         case 'select':
             $this->import('classes.form.DataverseSelectForm');
             $form = new DataverseSelectForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, 'manager', 'plugin', array('generic', $this->getName(), 'settings'));
                     return false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             return true;
         case 'settings':
             $this->import('classes.form.SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, 'manager', 'plugin', array('generic'));
                     return false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             return true;
         default:
             // Unknown management verb
             assert(false);
             return false;
     }
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:69,代码来源:DataversePlugin.inc.php


示例18: manage

 /**
  * @see PKPPlugin::manage()
  */
 function manage($verb, $args, &$message, &$messageParams, &$pluginModalContent = null)
 {
     $returner = true;
     $request = $this->getRequest();
     $journal = $request->getJournal();
     $this->addLocaleData();
     switch ($verb) {
         case 'settings':
             AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_PKP_MANAGER);
             $templateMgr = TemplateManager::getManager($request);
             $templateMgr->register_function('plugin_url', array($this, 'smartyPluginUrl'));
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if ($request->getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     $request->redirect(null, null, 'plugins');
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         case 'enable':
             $this->updateSetting($journal->getId(), 'enabled', true);
             $message = NOTIFICATION_TYPE_SWORD_ENABLED;
             $returner = false;
             break;
         case 'disable':
             $this->updateSetting($journal->getId(), 'enabled', false);
             $message = NOTIFICATION_TYPE_PLUGIN_DISABLED;
             $messageParams = array('pluginName' => $this->getDisplayName());
             $returner = false;
             break;
         case 'createDepositPoint':
         case 'editDepositPoint':
             $templateMgr = TemplateManager::getManager($request);
             $templateMgr->register_function('plugin_url', array($this, 'smartyPluginUrl'));
             $depositPointId = array_shift($args);
             if ($depositPointId == '') {
                 $depositPointId = null;
             } else {
                 $depositPointId = (int) $depositPointId;
             }
             $this->import('DepositPointForm');
             $form = new DepositPointForm($this, $journal->getId(), $depositPointId);
             if ($request->getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     $request->redirect(null, null, null, array('generic', $this->getName(), 'settings'));
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         case 'deleteDepositPoint':
             $journalId = $journal->getId();
             $depositPointId = (int) array_shift($args);
             $depositPoints = $this->getSetting($journalId, 'depositPoints');
             unset($depositPoints[$depositPointId]);
             $this->updateSetting($journalId, 'depositPoints', $depositPoints);
             $request->redirect(null, null, null, array('generic', 'SwordPlugin', 'settings'));
             break;
     }
     return $returner;
 }
开发者ID:jalperin,项目名称:ojs,代码行数:76,代码来源:SwordPlugin.inc.php


示例19: manage

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SettingsManager类代码示例发布时间:2022-05-23
下一篇:
PHP Settings类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap