當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ET::define方法代碼示例

本文整理匯總了PHP中ET::define方法的典型用法代碼示例。如果您正苦於以下問題:PHP ET::define方法的具體用法?PHP ET::define怎麽用?PHP ET::define使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ET的用法示例。


在下文中一共展示了ET::define方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 public function init()
 {
     ET::define("gambit.bookmarked", "bookmarked");
     ET::define("label.bookmarked", "Bookmarked");
     ET::conversationModel();
     ETConversationModel::addLabel("bookmarked", "IF(s.bookmarked=1,1,0)", "icon-bookmark");
 }
開發者ID:ZerGabriel,項目名稱:Bookmarks,代碼行數:7,代碼來源:plugin.php

示例2: init

 public function init()
 {
     // Add the postChannel activity type.
     ET::activityModel();
     ETActivityModel::addType("postChannel", array("notification" => array(__CLASS__, "postChannelNotification"), "email" => array(__CLASS__, "postChannelEmail")));
     ET::define("email.postChannel.body", "<p><strong>%1\$s</strong> has posted in a conversation in a channel which you followed: <strong>%2\$s</strong></p><hr>%3\$s<hr><p>To view the new activity, check out the following link:<br>%4\$s</p>");
     ET::define("email.postChannel.subject", "[%1\$s] %2\$s");
 }
開發者ID:ZerGabriel,項目名稱:ChannelNotifications,代碼行數:8,代碼來源:plugin.php

示例3: init

 public function init()
 {
     // Include the Google reCAPTCHA library via autoload (composer style).
     require_once PATH_PLUGINS . "/reCAPTCHA/autoload.php";
     // Define default settings text.
     ET::define("message.reCAPTCHA.settings", "Enter your reCAPTCHA Keys (<a href='https://www.google.com/recaptcha/admin#whyrecaptcha' target='_blank'>Don't have any keys yet? Get them here!</a>)");
     ET::define("message.invalidCAPTCHA", "The CAPTCHA is invalid. Please try again.");
 }
開發者ID:jgknight,項目名稱:reCAPTCHA,代碼行數:8,代碼來源:plugin.php

示例4: handler_init

 public function handler_init($sender)
 {
     //If reputation points is not enabled by Admin, break
     if (!C("plugin.Reputation.showReputationPublic")) {
         return;
     }
     ET::define("message.reputationConversationStarted", "Way to go! You just earned reputation for starting a conversation!");
     ET::define("message.reputationReplyToConversation", "Hurray! You just earned reputation for posting a reply! <br> Start an interesting converstion for more.");
     //Add reputation points to the header (top bar)
     $reputationMenu = "+ " . T(number_format(ET::$session->user["reputationPoints"]) . " RP");
     $reputationMenu = "<a href='" . URL("reputation") . "'>{$reputationMenu}</a>";
     $sender->addToMenu("user", "reputation", $reputationMenu, 1);
     return;
 }
開發者ID:ZerGabriel,項目名稱:Reputation,代碼行數:14,代碼來源:plugin.php

示例5: init

 public function init()
 {
     ET::define("message.attachmentNotFound", "For some reason this attachment cannot be viewed. It may not exist, or you may not have permission to view it.");
     /**
      * Format an attachment to be outputted on the page, either in the attachment list
      * at the bottom of the post or embedded inside the post.
      *
      * @param array $attachment The attachment details.
      * @param bool $expanded Whether or not the attachment should be displayed in its
      * 		full form (i.e. whether or not the attachment is embedded in the post.)
      * @return string The HTML to output.
      */
     function formatAttachment($attachment, $expanded = false)
     {
         // TODO: 出力時フォーマット編集
         $extension = strtolower(pathinfo($attachment["filename"], PATHINFO_EXTENSION));
         $url = URL("attachment/" . $attachment["attachmentId"] . "_" . $attachment["filename"]);
         $filename = sanitizeHTML($attachment["filename"]);
         $displayFilename = ET::formatter()->init($filename)->highlight(ET::$session->get("highlight"))->get();
         // For images, either show them directly or show a thumbnail.
         // TODO: サムネイル出力確認
         if (in_array($extension, array("jpg", "jpeg", "png", "gif"))) {
             if ($expanded) {
                 return "<span class='attachment attachment-image'><img src='" . $url . "' alt='" . $filename . "' title='" . $filename . "'></span>";
             } else {
                 return "<a href='" . $url . "' class='attachment attachment-image' target='_blank'><img src='" . URL("attachment/thumb/" . $attachment["attachmentId"]) . "' alt='" . $filename . "' title='" . $filename . "'><span class='filename'>" . $displayFilename . "</span></a>";
             }
         }
         // Embed video.
         if (in_array($extension, array("mp4", "mov", "mpg", "avi", "m4v")) and $expanded) {
             return "<video width='400' height='225' controls><source src='" . $url . "'></video>";
         }
         // Embed audio.
         if (in_array($extension, array("mp3", "mid", "wav")) and $expanded) {
             return "<audio controls><source src='" . $url . "'></video>";
         }
         $icons = array("pdf" => "file-text-alt", "doc" => "file-text-alt", "docx" => "file-text-alt", "zip" => "archive", "rar" => "archive", "gz" => "archive");
         $icon = isset($icons[$extension]) ? $icons[$extension] : "file";
         return "<a href='" . $url . "' class='attachment' target='_blank'><i class='icon-{$icon}'></i><span class='filename'>" . $displayFilename . "</span></a>";
     }
 }
開發者ID:m-mori,項目名稱:forum,代碼行數:41,代碼來源:plugin.php

示例6: init

 public function init()
 {
     ET::conversationModel();
     ETConversationModel::addLabel("none", "IF(c.status = NULL,1,0)");
     ETConversationModel::addLabel("added", "IF(c.status = 1,1,0)", "icon-check");
     ETConversationModel::addLabel("considered", "IF(c.status = 2,1,0)", "icon-question-sign");
     ETConversationModel::addLabel("rejected", "IF(c.status = 3,1,0)", "icon-thumbs-down");
     ETConversationModel::addLabel("fixed", "IF(c.status = 4,1,0)", "icon-cogs");
     ETConversationModel::addLabel("inprogress", "IF(c.status = 5,1,0)", "icon-wrench");
     ETConversationModel::addLabel("nobug", "IF(c.status = 6,1,0)", "icon-thumbs-up");
     ETConversationModel::addLabel("highpriority", "IF(c.status = 7,1,0)", "icon-circle");
     ETConversationModel::addLabel("lowpriority", "IF(c.status = 8,1,0)", "icon-circle-blank");
     ET::define("label.none", "No Status");
     ET::define("label.added", "Added");
     ET::define("label.considered", "Considered");
     ET::define("label.rejected", "Rejected");
     ET::define("label.fixed", "Fixed");
     ET::define("label.inprogress", "In Progress");
     ET::define("label.nobug", "Not a Bug");
     ET::define("label.highpriority", "High Priority");
     ET::define("label.lowpriority", "Low Priority");
 }
開發者ID:ZerGabriel,項目名稱:ConversationStatus,代碼行數:22,代碼來源:plugin.php

示例7: loadLanguage

 /**
  * Load a language and its definition files, depending on what plugins are enabled.
  *
  * @param string $language The name of the language.
  * @return void
  */
 public static function loadLanguage($language = "")
 {
     // Clear the currently loaded definitions.
     self::$definitions = array();
     // If the specified language doesn't exist, use the default language.
     self::$language = file_exists(PATH_LANGUAGES . "/" . sanitizeFileName($language) . "/definitions.php") ? $language : C("esoTalk.language");
     // Load the main definitions file.
     $languagePath = PATH_LANGUAGES . "/" . sanitizeFileName(self::$language);
     self::loadDefinitions("{$languagePath}/definitions.php");
     // Set the locale.
     if (isset(ET::$languageInfo[self::$language]["locale"])) {
         setlocale(LC_ALL, ET::$languageInfo[self::$language]["locale"]);
     }
     // Loop through the loaded plugins and include their definition files, if they exist.
     foreach (C("esoTalk.enabledPlugins") as $plugin) {
         if (file_exists($file = "{$languagePath}/definitions." . sanitizeFileName($plugin) . ".php")) {
             self::loadDefinitions($file);
         }
     }
     // Re-define runtime definitions.
     foreach (self::$runtimeDefinitions as $k => $v) {
         ET::define($k, $v);
     }
 }
開發者ID:m-mori,項目名稱:forum,代碼行數:30,代碼來源:ET.class.php

示例8: init

 public function init()
 {
     ET::define("gambit.order by views", "order by views");
 }
開發者ID:ZerGabriel,項目名稱:Views,代碼行數:4,代碼來源:plugin.php

示例9: loadLanguage

 /**
  * Load a language and its definition files, depending on what plugins are enabled.
  *
  * @param string $language The name of the language.
  * @return void
  */
 public static function loadLanguage($language = "")
 {
     if (isset(ET::$languageInfo[$language])) {
         return;
     }
     $narr = ET::$cache->filenames;
     if ($narr !== false && isset($narr["language_filename"])) {
         self::$language_filename = $narr["language_filename"];
     }
     //while $narr is empty create an new array
     if (empty($narr)) {
         $narr = array();
     }
     // Clear the currently loaded definitions.
     self::$definitions = array();
     // If the specified language doesn't exist, use the default language.
     self::$language = file_exists(PATH_LANGUAGES . "/" . sanitizeFileName($language) . "/definitions.php") ? $language : C("esoTalk.language");
     // Load the main definitions file.
     $languagePath = PATH_LANGUAGES . "/" . sanitizeFileName(self::$language);
     self::loadDefinitions("{$languagePath}/definitions.php");
     // Set the locale.
     if (isset(ET::$languageInfo[self::$language]["locale"])) {
         setlocale(LC_ALL, ET::$languageInfo[self::$language]["locale"]);
     }
     // Loop through the loaded plugins and include their definition files, if they exist.
     foreach (C("esoTalk.enabledPlugins") as $plugin) {
         if (empty(self::$language_filename) || self::$language_filename[$plugin] == false) {
             if (file_exists($file = "{$languagePath}/definitions." . sanitizeFileName($plugin) . ".php")) {
                 self::loadDefinitions($file);
                 self::$language_filename[$plugin] = $file;
                 $narr["language_filename"] = self::$language_filename;
                 //ET::$cache->store("language_filename" , self::$language_filename);
                 //ET::$cache->store(ET::$cache->fname_key , $narr);
                 ET::$cache->filenames = $narr;
                 ET::$cache->fnamechanged = true;
             }
         } else {
             $file = self::$language_filename[$plugin];
             self::loadDefinitions($file);
         }
     }
     //var_dump($narr);//exit();
     unset($narr);
     // Re-define runtime definitions.
     foreach (self::$runtimeDefinitions as $k => $v) {
         ET::define($k, $v);
     }
 }
開發者ID:ky0ncheng,項目名稱:esotalk-for-sae,代碼行數:54,代碼來源:ET.class.php

示例10: init

 public function init()
 {
     // Define default language definitions.
     ET::define("message.Sitemap.cache", "To reduse server load, the sitemap will be cached for some time. After this time it will be recreated. Enter the number of hours for which the sitemap will be cached. Or enter 0 for disabling caching.");
     ET::define("message.Sitemap.exclude", "Channels selected here and topics inside them will be excluded from the Sitemap.");
 }
開發者ID:ZerGabriel,項目名稱:Sitemap,代碼行數:6,代碼來源:plugin.php


注:本文中的ET::define方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。