本文整理汇总了PHP中ETFactory类的典型用法代码示例。如果您正苦于以下问题:PHP ETFactory类的具体用法?PHP ETFactory怎么用?PHP ETFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ETFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($rootDirectory)
{
parent::__construct($rootDirectory);
ETFactory::register("pagesModel", "PagesModel", dirname(__FILE__) . "/PagesModel.class.php");
ETFactory::registerAdminController("pages", "PagesAdminController", dirname(__FILE__) . "/PagesAdminController.class.php");
ETFactory::registerController("pages", "PagesController", dirname(__FILE__) . "/PagesController.class.php");
}
开发者ID:ZerGabriel,项目名称:Pages,代码行数:7,代码来源:plugin.php
示例2: action_create
public function action_create()
{
// Set up the form.
$form = ETFactory::make("form");
$form->action = URL("admin/profiles/create");
// Was the cancel button pressed?
if ($form->isPostBack("cancel")) {
$this->redirect(URL("admin/profiles"));
}
// Was the save button pressed?
if ($form->validPostBack("save")) {
$model = $this->model();
$data = array("name" => $form->getValue("name"), "description" => $form->getValue("description"), "type" => $form->getValue("type"), "options" => $form->getValue("options"), "showOnPosts" => (bool) $form->getValue("showOnPosts"), "hideFromGuests" => (bool) $form->getValue("hideFromGuests"), "searchable" => (bool) $form->getValue("searchable"), "position" => $model->count());
$model->create($data);
// If there were errors, pass them on to the form.
if ($model->errorCount()) {
$form->errors($model->errors());
} else {
$this->redirect(URL("admin/profiles"));
}
}
$this->data("form", $form);
$this->data("field", null);
$this->render($this->plugin()->view("admin/editField"));
}
开发者ID:ZerGabriel,项目名称:Profiles,代码行数:25,代码来源:ProfilesAdminController.class.php
示例3: init
/**
* Initialize the admin controller. Construct a menu to show all admin panels.
*
* @return void
*/
public function init()
{
// If the user isn't an administrator, kick them out.
if (!ET::$session->isAdmin()) {
$this->redirect(URL("user/login?return=" . urlencode($this->selfURL)));
}
parent::init();
// Construct the menus for the side bar.
$this->defaultMenu = ETFactory::make("menu");
$this->menu = ETFactory::make("menu");
$this->defaultMenu->add("dashboard", "<a href='" . URL("admin/dashboard") . "'><i class='icon-dashboard'></i> " . T("Dashboard") . "</a>");
$this->defaultMenu->add("settings", "<a href='" . URL("admin/settings") . "'><i class='icon-cog'></i> " . T("Forum Settings") . "</a>");
$this->defaultMenu->add("appearance", "<a href='" . URL("admin/appearance") . "'><i class='icon-eye-open'></i> " . T("Appearance") . "</a>");
$this->defaultMenu->add("channels", "<a href='" . URL("admin/channels") . "'><i class='icon-tags'></i> " . T("Channels") . "</a>");
$this->defaultMenu->add("members", "<a href='" . URL("members") . "'><i class='icon-group'></i> " . T("Members") . "</a>");
$this->defaultMenu->add("plugins", "<a href='" . URL("admin/plugins") . "'><i class='icon-puzzle-piece'></i> " . T("Plugins") . "</a>");
$this->defaultMenu->highlight(ET::$controllerName);
$this->menu->highlight(ET::$controllerName);
// If new registrations require admin approval, add the 'unapproved' admin page with a count.
if (C("esoTalk.registration.requireConfirmation") == "approval") {
$count = ET::SQL()->select("COUNT(1)")->from("member")->where("confirmed", 0)->exec()->result();
$this->menu->add("unapproved", "<a href='" . URL("admin/unapproved") . "'><i class='icon-lock'></i> " . T("Unapproved") . " <span class='badge'>" . $count . "</span></a>");
}
if ($this->responseType === RESPONSE_TYPE_DEFAULT) {
$this->pushNavigation("admin", "administration", URL($this->selfURL));
}
$this->addJSFile("core/js/admin.js");
$this->addCSSFile("core/skin/admin.css");
$this->trigger("initAdmin", array($this->menu, $this->defaultMenu));
}
开发者ID:19eighties,项目名称:esoTalk,代码行数:35,代码来源:ETAdminController.class.php
示例4: settings
/**
* Construct and process the settings form for this skin, and return the path to the view that should be
* rendered.
*
* @param ETController $sender The page controller.
* @return string The path to the settings view to render.
*/
public function settings($sender)
{
// Set up the settings form.
$form = ETFactory::make("form");
$form->action = URL("admin/plugins");
$form->setValue("server", C("plugin.SMTP.server"));
$form->setValue("username", C("plugin.SMTP.username"));
$form->setValue("password", C("plugin.SMTP.password"));
$form->setValue("port", C("plugin.SMTP.port"));
$form->setValue("auth", C("plugin.SMTP.auth"));
// If the form was submitted...
if ($form->validPostBack("save")) {
// Construct an array of config options to write.
$config = array();
$config["plugin.SMTP.server"] = $form->getValue("server");
$config["plugin.SMTP.username"] = $form->getValue("username");
$config["plugin.SMTP.password"] = $form->getValue("password");
$config["plugin.SMTP.port"] = $form->getValue("port");
$config["plugin.SMTP.auth"] = $form->getValue("auth");
if (!$form->errorCount()) {
// Write the config file.
ET::writeConfig($config);
$sender->message(T("message.changesSaved"), "success");
$sender->redirect(URL("admin/plugins"));
}
}
$sender->data("smtpSettingsForm", $form);
return $this->getView("settings");
}
开发者ID:nowaym,项目名称:esoTalk,代码行数:36,代码来源:plugin.php
示例5: settings
/**
* Construct and process the settings form for this skin, and return the path to the view that should be
* rendered.
*
* @param ETController $sender The page controller.
* @return string The path to the settings view to render.
*/
public function settings($sender)
{
// Set up the settings form.
$form = ETFactory::make("form");
$form->action = URL("admin/appearance");
$form->setValue("headerColor", C("skin.Default.headerColor"));
$form->setValue("bodyColor", C("skin.Default.bodyColor"));
$form->setValue("noRepeat", (bool) C("skin.Default.noRepeat"));
$form->setValue("bodyImage", (bool) C("skin.Default.bodyImage"));
// If the form was submitted...
if ($form->validPostBack("save")) {
// Construct an array of config options to write.
$config = array();
$config["skin.Default.headerColor"] = $form->getValue("headerColor");
$config["skin.Default.bodyColor"] = $form->getValue("bodyColor");
// Upload a body bg image if necessary.
if ($form->getValue("bodyImage") and !empty($_FILES["bodyImageFile"]["tmp_name"])) {
$config["skin.Default.bodyImage"] = $this->uploadBackgroundImage($form);
} elseif (!$form->getValue("bodyImage")) {
$config["skin.Default.bodyImage"] = false;
}
$config["skin.Default.noRepeat"] = (bool) $form->getValue("noRepeat");
if (!$form->errorCount()) {
// Write the config file.
ET::writeConfig($config);
$sender->message(T("message.changesSaved"), "success");
$sender->redirect(URL("admin/appearance"));
}
}
$sender->data("skinSettingsForm", $form);
$sender->addCSSFile("core/js/lib/farbtastic/farbtastic.css");
$sender->addJSFile("core/js/lib/farbtastic/farbtastic.js");
return $this->getView("settings");
}
开发者ID:AlexandrST,项目名称:esoTalk,代码行数:41,代码来源:skin.php
示例6: __construct
public function __construct($rootDirectory)
{
parent::__construct($rootDirectory);
// Register the profile_field model which provides convenient methods to
// manage profile data.
ETFactory::register("profileFieldModel", "ProfileFieldModel", dirname(__FILE__) . "/ProfileFieldModel.class.php");
// Register the profiles admin controller which provides an interface for
// administrators to manage custom profile fields.
ETFactory::registerAdminController("profiles", "ProfilesAdminController", dirname(__FILE__) . "/ProfilesAdminController.class.php");
}
开发者ID:ky0ncheng,项目名称:esotalk-for-sae,代码行数:10,代码来源:plugin.php
示例7: settings
public function settings($sender)
{
$sender->addCSSFile($this->resource("sitemap.css"));
// Set up the settings form.
$form = ETFactory::make("form");
$form->action = URL("admin/plugins/settings/Sitemap");
// Add the section for the restore element.
$form->addSection("channels");
// Add the field for the restore select element.
$form->addField("channels", "channels", array($this, "renderChannelsField"), array($this, "processChannelsField"));
$form->setValue("channels[]", C("plugin.Sitemap.channels"));
// Set the values for the sitemap options.
$form->setValue("cache", C("plugin.Sitemap.cache", "24"));
$form->setValue("prio1", C("plugin.Sitemap.priority1", "0.5"));
$form->setValue("prio2", C("plugin.Sitemap.priority2", "0.6"));
$form->setValue("prio3", C("plugin.Sitemap.priority3", "0.7"));
$form->setValue("freq1", C("plugin.Sitemap.frequency1", "daily"));
$form->setValue("freq2", C("plugin.Sitemap.frequency2", "daily"));
$form->setValue("freq3", C("plugin.Sitemap.frequency3", "hourly"));
$form->setValue("auto1", C("plugin.Sitemap.google", true));
$form->setValue("auto2", C("plugin.Sitemap.bing", true));
// If the form was submitted...
if ($form->validPostBack()) {
// Get the value from the dynamically created "compress" field.
$form->runFieldCallbacks($data);
// Construct an array of config options to write.
$config = array();
$config["plugin.Sitemap.cache"] = $form->getValue("cache");
$config["plugin.Sitemap.channels"] = array_combine($data["channels"], $data["channels"]);
$config["plugin.Sitemap.priority1"] = $form->getValue("prio1");
$config["plugin.Sitemap.priority2"] = $form->getValue("prio2");
$config["plugin.Sitemap.priority3"] = $form->getValue("prio3");
$config["plugin.Sitemap.frequency1"] = $form->getValue("freq1");
$config["plugin.Sitemap.frequency2"] = $form->getValue("freq2");
$config["plugin.Sitemap.frequency3"] = $form->getValue("freq3");
$config["plugin.Sitemap.google"] = $form->getValue("auto1");
$config["plugin.Sitemap.bing"] = $form->getValue("auto2");
// Write the config file.
ET::writeConfig($config);
$this->action_create();
$sender->message(T("The sitemap has been regenerated!"), "success autoDismiss");
if (!C("plugin.Sitemap.google") && !C("plugin.Sitemap.bing")) {
$sender->message(T("Please submit <strong><i>" . C("esoTalk.baseURL") . "sitemap-index.xml</i></strong> to <a href='https://support.google.com/sites/answer/100283?hl=en' target='_blank'>Google Webmaster Tools</a> and <a href='http://www.bing.com/webmaster/help/how-to-submit-sitemaps-82a15bd4' target='_blank'>Bing Webmaster Tools</a>."), "success");
}
$this->autoSubmit();
$sender->redirect(URL("admin/plugins"));
}
$sender->data("SitemapSettingsForm", $form);
return $this->view("settings");
}
开发者ID:ZerGabriel,项目名称:Sitemap,代码行数:50,代码来源:plugin.php
示例8: settings
/**
* Construct and process the settings form for this skin, and return the path to the view that should be
* rendered.
*
* @param ETController $sender The page controller.
* @return string The path to the settings view to render.
*/
public function settings($sender)
{
// Set up the settings form.
$form = ETFactory::make("form");
$form->action = URL("admin/appearance");
$form->setValue("primaryColor", C("skin.Doragon.primaryColor"));
// If the form was submitted...
if ($form->validPostBack("save")) {
$this->writeColors($form->getValue("primaryColor"));
$sender->message(T("message.changesSaved"), "success autoDismiss");
$sender->redirect(URL("admin/appearance"));
}
$sender->data("skinSettingsForm", $form);
$sender->addJSFile("core/js/lib/farbtastic.js");
return $this->view("settings");
}
开发者ID:ZerGabriel,项目名称:Doragon-Skin,代码行数:23,代码来源:skin.php
示例9: settings
public function settings($sender)
{
// Set up the settings form.
$form = ETFactory::make("form");
$form->action = URL("admin/plugins/settings/GoogleAnalytics");
$form->setValue("trackingId", C("GoogleAnalytics.trackingId"));
// If the form was submitted...
if ($form->validPostBack()) {
// Construct an array of config options to write.
$config = array();
$config["GoogleAnalytics.trackingId"] = $form->getValue("trackingId");
// Write the config file.
ET::writeConfig($config);
$sender->message(T("message.changesSaved"), "success autoDismiss");
$sender->redirect(URL("admin/plugins"));
}
$sender->data("googleAnalyticsSettingsForm", $form);
return $this->view("settings");
}
开发者ID:m-mori,项目名称:forum,代码行数:19,代码来源:plugin.php
示例10: settings
public function settings($sender)
{
// Set up the settings form.
$form = ETFactory::make("form");
$form->action = URL("admin/plugins/settings/Signature");
// Set the values for the sitemap options.
$form->setValue("characters", C("plugin.Signature.characters", "150"));
// If the form was submitted...
if ($form->validPostBack()) {
// Construct an array of config options to write.
$config = array();
$config["plugin.Signature.characters"] = $form->getValue("characters");
// Write the config file.
ET::writeConfig($config);
$sender->redirect(URL("admin/plugins"));
}
$sender->data("SignatureSettingsForm", $form);
return $this->view("settings");
}
开发者ID:jpearman,项目名称:Signature,代码行数:19,代码来源:plugin.php
示例11: settings
public function settings($sender)
{
// Expand the filters array into a string that will go in the textarea.
$filters = C("plugin.WordFilter.filters", array());
$filterText = "";
foreach ($filters as $word => $replacement) {
$filterText .= $word . ($replacement ? "|{$replacement}" : "") . "\n";
}
$filterText = trim($filterText);
// Set up the settings form.
$form = ETFactory::make("form");
$form->action = URL("admin/plugins");
$form->setValue("filters", $filterText);
// If the form was submitted...
if ($form->validPostBack("wordFilterSave")) {
// Create an array of word filters from the contents of the textarea.
// Each line is a new element in the array; keys and values are separated by a | character.
$filters = array();
$lines = explode("\n", strtr($form->getValue("filters"), array("\r\n" => "\n", "\r" => "\n")));
foreach ($lines as $line) {
if (!$line) {
continue;
}
$parts = explode("|", $line, 2);
if (!$parts[0]) {
continue;
}
$filters[$parts[0]] = @$parts[1];
}
// Construct an array of config options to write.
$config = array();
$config["plugin.WordFilter.filters"] = $filters;
if (!$form->errorCount()) {
// Write the config file.
ET::writeConfig($config);
$sender->message(T("message.changesSaved"), "success");
$sender->redirect(URL("admin/plugins"));
}
}
$sender->data("wordFilterSettingsForm", $form);
return $this->getView("settings");
}
开发者ID:AlexandrST,项目名称:esoTalk,代码行数:42,代码来源:plugin.php
示例12: init
/**
* Initialize the admin controller. Construct a menu to show all admin panels.
*
* @return void
*/
public function init()
{
// If the user isn't an administrator, kick them out.
if (!ET::$session->isAdmin()) {
$this->redirect(URL("user/login?return=" . urlencode($this->selfURL)));
}
parent::init();
// Construct the menus for the side bar.
$this->defaultMenu = ETFactory::make("menu");
$this->menu = ETFactory::make("menu");
$this->defaultMenu->add("dashboard", "<a href='" . URL("admin/dashboard") . "'>" . T("Dashboard") . "</a>");
$this->defaultMenu->add("settings", "<a href='" . URL("admin/settings") . "'>" . T("Forum Settings") . "</a>");
$this->defaultMenu->add("appearance", "<a href='" . URL("admin/appearance") . "'>" . T("Appearance") . "</a>");
$this->defaultMenu->add("channels", "<a href='" . URL("admin/channels") . "'>" . T("Channels") . "</a>");
$this->defaultMenu->add("plugins", "<a href='" . URL("admin/plugins") . "'>" . T("Plugins") . "</a>");
$this->defaultMenu->highlight(ET::$controllerName);
$this->menu->highlight(ET::$controllerName);
$this->addJSFile("js/admin.js");
$this->addCSSFile("skins/base/admin.css");
}
开发者ID:nowaym,项目名称:esoTalk,代码行数:25,代码来源:ETAdminController.class.php
示例13: index
/**
* Show and process the settings form.
*
* @return void
*/
public function index()
{
// Make an array of languages for the default forum language select.
$languages = array();
foreach (ET::getLanguages() as $v) {
$languages[$v] = ET::$languageInfo[$v]["name"];
}
// Get a list of member groups.
$groups = ET::groupModel()->getAll();
// Set up the form.
$form = ETFactory::make("form");
$form->action = URL("admin/settings");
// Set the default values for the forum inputs.
$form->setValue("forumTitle", C("esoTalk.forumTitle"));
$form->setValue("language", C("esoTalk.language"));
$form->setValue("forumHeader", C("esoTalk.forumLogo") ? "image" : "title");
$form->setValue("defaultRoute", C("esoTalk.defaultRoute"));
$form->setValue("registrationOpen", C("esoTalk.registration.open"));
$form->setValue("memberListVisibleToGuests", C("esoTalk.members.visibleToGuests"));
$form->setValue("requireAdminApproval", C("esoTalk.registration.requireAdminApproval"));
$form->setValue("requireEmailConfirmation", C("esoTalk.registration.requireEmailConfirmation"));
// If the save button was clicked...
if ($form->validPostBack("save")) {
// Construct an array of config options to write.
$config = array("esoTalk.forumTitle" => $form->getValue("forumTitle"), "esoTalk.language" => $form->getValue("language"), "esoTalk.forumLogo" => $form->getValue("forumHeader") == "image" ? $this->uploadHeaderImage($form) : false, "esoTalk.defaultRoute" => $form->getValue("defaultRoute"), "esoTalk.registration.open" => $form->getValue("registrationOpen"), "esoTalk.registration.requireEmailConfirmation" => $form->getValue("requireEmailConfirmation"), "esoTalk.members.visibleToGuests" => $form->getValue("memberListVisibleToGuests"));
// Make sure a forum title is present.
if (!strlen($config["esoTalk.forumTitle"])) {
$form->error("forumTitle", T("message.empty"));
}
if (!$form->errorCount()) {
ET::writeConfig($config);
$this->message(T("message.changesSaved"), "success");
$this->redirect(URL("admin/settings"));
}
}
$this->data("form", $form);
$this->data("languages", $languages);
$this->data("groups", $groups);
$this->title = T("Forum Settings");
$this->render("admin/settings");
}
开发者ID:nowaym,项目名称:esoTalk,代码行数:46,代码来源:ETSettingsAdminController.class.php
示例14: create
public function create()
{
$form = ETFactory::make("form");
$form->action = URL("admin/pages/create");
if ($form->isPostBack("cancel")) {
$this->redirect(URL("admin/pages"));
}
if ($form->validPostBack("save")) {
$model = $this->model();
$data = array("title" => $form->getValue("title"), "content" => $form->getValue("content"), "slug" => slug($form->getValue("slug")), "hideFromGuests" => (bool) $form->getValue("hideFromGuests"), "menu" => $form->getValue("menu"), "position" => $model->count());
$model->create($data);
if ($model->errorCount()) {
$form->errors($model->errors());
} else {
$this->redirect(URL("admin/pages"));
}
}
$this->data("form", $form);
$this->data("page", null);
$this->render($this->plugin()->getView("admin/editPage"));
}
开发者ID:ZerGabriel,项目名称:Pages,代码行数:21,代码来源:PagesAdminController.class.php
示例15: settings
public function settings($sender)
{
// Set up the settings form. Set some default values for the first time.
$form = ETFactory::make("form");
$form->action = URL("admin/plugins/settings/Reputation");
$form->setValue("showReputationPublic", C("plugin.Reputation.showReputationPublic", "0"));
$form->setValue("conversationStartRP", C("plugin.Reputation.conversationStartRP", "10"));
$form->setValue("getReplyRP", C("plugin.Reputation.getReplyRP", "5"));
$form->setValue("viewsRP", C("plugin.Reputation.viewsRP", "0"));
$form->setValue("likesRP", C("plugin.Reputation.likesRP", "5"));
$form->setValue("replyRP", C("plugin.Reputation.replyRP", "5"));
$form->setValue("newReputationUpdate", C("plugin.Reputation.newReputationUpdate", "0"));
// If the form was submitted...
if ($form->validPostBack("reputationSave")) {
// Construct an array of config options to write.
$config = array();
$config["plugin.Reputation.showReputationPublic"] = $form->getValue("showReputationPublic");
$config["plugin.Reputation.conversationStartRP"] = $form->getValue("conversationStartRP");
$config["plugin.Reputation.getReplyRP"] = $form->getValue("getReplyRP");
$config["plugin.Reputation.replyRP"] = $form->getValue("replyRP");
$config["plugin.Reputation.viewsRP"] = $form->getValue("viewsRP");
$config["plugin.Reputation.likesRP"] = $form->getValue("likesRP");
$config["plugin.Reputation.newReputationUpdate"] = $form->getValue("newReputationUpdate");
// Update reputatoin ponits in databse according to new formula
if (C("plugin.Reputation.newReputationUpdate") == 1) {
$this->updateNewReputation(C("plugin.Reputation.replyRP"), C("plugin.Reputation.conversationStartRP"), C("plugin.Reputation.viewsRP"), C("plugin.Reputation.likesRP"), C("plugin.Reputation.getReplyRP"));
$config["plugin.Reputation.newReputationUpdate"] = 0;
}
if (!$form->errorCount()) {
// Write the config file.
ET::writeConfig($config);
$sender->message(T("message.changesSaved"), "success autoDismiss");
$sender->redirect(URL("admin/plugins"));
}
}
$sender->data("reputationSettingsForm", $form);
return $this->view("settings");
}
开发者ID:ZerGabriel,项目名称:Reputation,代码行数:38,代码来源:plugin.php
示例16: settings
/**
* Setting form on admin panel
*/
public function settings($sender)
{
$form = ETFactory::make('form');
$form->action = URL('admin/plugins');
$form->setValue('linksBottomMenu', $this->c['linksBottomMenu']);
$form->setValue('linksTopMenu', $this->c['linksTopMenu']);
$form->setValue('beforeBody', $this->c['beforeBody']);
$form->setValue('headSection', $this->c['headSection']);
if ($form->validPostBack("MenuLinksSave")) {
$config = array();
$config['plugin.MenuLinks.linksBottomMenu'] = $form->getValue('linksBottomMenu');
$config['plugin.MenuLinks.linksTopMenu'] = $form->getValue('linksTopMenu');
$config['plugin.MenuLinks.beforeBody'] = $form->getValue('beforeBody');
$config['plugin.MenuLinks.headSection'] = $form->getValue('headSection');
if (!$form->errorCount()) {
ET::writeConfig($config);
$sender->message(T("message.changesSaved"), "success autoDismiss");
$sender->redirect(URL("admin/plugins"));
}
}
$sender->data("MenuLinks", $form);
return $this->getView("settings");
}
开发者ID:ZerGabriel,项目名称:MenuLinks,代码行数:26,代码来源:plugin.php
示例17: action_create
/**
* Show a sheet to create a new group.
*
* @return void
*/
public function action_create()
{
// Set up the form.
$form = ETFactory::make("form");
$form->action = URL("admin/groups/create");
// Was the cancel button pressed?
if ($form->isPostBack("cancel")) {
$this->redirect(URL("admin/groups"));
}
// Was the save button pressed?
if ($form->validPostBack("save")) {
$data = array("name" => $form->getValue("name"), "canSuspend" => (bool) $form->getValue("canSuspend"), "private" => (bool) $form->getValue("private"));
$model = ET::groupModel();
$groupId = $model->create($data);
// If there were errors, pass them on to the form.
if ($model->errorCount()) {
$form->errors($model->errors());
} else {
// Do we want to give this group the moderate permission on all existing channels?
if ($form->getValue("giveModeratePermission")) {
// Go through all the channels and construct an array of rows to insert into the channel_group table.
$channels = ET::channelModel()->getAll();
$inserts = array();
foreach ($channels as $id => $channel) {
$inserts[] = array($id, $groupId, 1, 1, 1, 1);
}
// Insert them!
ET::SQL()->insert("channel_group")->setMultiple(array("channelId", "groupId", "view", "reply", "start", "moderate"), $inserts)->setOnDuplicateKey("moderate", 1)->exec();
}
// Redirect back to the groups page.
$this->redirect(URL("admin/groups"));
}
}
$this->data("form", $form);
$this->data("group", null);
$this->render("admin/editGroup");
}
开发者ID:19eighties,项目名称:esoTalk,代码行数:42,代码来源:ETGroupsAdminController.class.php
示例18: settings
public function settings($sender)
{
// Set up the settings form.
$form = ETFactory::make("form");
$form->action = URL("admin/plugins/settings/reCAPTCHA");
$form->setValue("secretkey", C("plugin.reCAPTCHA.secretkey"));
$form->setValue("sitekey", C("plugin.reCAPTCHA.sitekey"));
$form->setValue("language", C("plugin.reCAPTCHA.language"));
$form->setValue("language", C("plugin.reCAPTCHA.language", "en"));
// If the form was submitted...
if ($form->validPostBack()) {
// Construct an array of config options to write.
$config = array();
$config["plugin.reCAPTCHA.secretkey"] = $form->getValue("secretkey");
$config["plugin.reCAPTCHA.sitekey"] = $form->getValue("sitekey");
$config["plugin.reCAPTCHA.language"] = $form->getValue("language");
// Write the config file.
ET::writeConfig($config);
$sender->message(T("message.changesSaved"), "success autoDismiss");
$sender->redirect(URL("admin/plugins"));
}
$sender->data("reCAPTCHASettingsForm", $form);
return $this->view("settings");
}
开发者ID:jgknight,项目名称:reCAPTCHA,代码行数:24,代码来源:plugin.php
示例19: getInstance
/**
* Get an instance of the class specified by $factoryName. So that we don't constantly get new instances and
* increase overhead, we store instances in ET::$instances and reuse them as needed.
*
* @return mixed An instance of the specified class.
*/
public static function getInstance($factoryName)
{
if (!isset(self::$instances[$factoryName])) {
self::$instances[$factoryName] = ETFactory::make($factoryName);
}
return self::$instances[$factoryName];
}
开发者ID:m-mori,项目名称:forum,代码行数:13,代码来源:ET.class.php
示例20: addToMenu
/**
* Add an item to one of the master view's menus.
*
* @param string $menu The name of the menu.
* @param string $id The name of this menu item.
* @param string $html The content of this menu item.
* @param mixed $position Where to put this menu item relative to the others.
* @see addToArray()
* @return void
*/
public function addToMenu($menu, $id, $html, $position = false)
{
if (empty($this->menus[$menu])) {
$this->menus[$menu] = ETFactory::make("menu");
}
$this->menus[$menu]->add($id, $html, $position);
}
开发者ID:davchezt,项目名称:fireside,代码行数:17,代码来源:ETController.class.php
注:本文中的ETFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论