本文整理汇总了PHP中SettingsForm类的典型用法代码示例。如果您正苦于以下问题:PHP SettingsForm类的具体用法?PHP SettingsForm怎么用?PHP SettingsForm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SettingsForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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;
}
示例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);
}
示例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);
}
示例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
}
示例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));
}
示例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;
}
示例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();
}
示例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' => '• ' . __('The URL of your signature image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>• ' . 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' => '• ' . __('The URL of your logo image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>• ' . 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' => '• ' . __('The URL of your background image.', 'wp_courseware') . '<br/>• ' . 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();
}
示例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' => '• ' . __('The URL of your signature image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>• ' . 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' => '• ' . __('The URL of your logo image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>• ' . 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' => '• ' . __('The URL of your background image.', 'wp_courseware') . '<br/>• ' . 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();
}
示例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;
}
}