コード例 #1
0
ファイル: plugin.php プロジェクト: ZerGabriel/Bookmarks
 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");
 }
コード例 #2
0
 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");
 }
コード例 #3
0
ファイル: plugin.php プロジェクト: jgknight/reCAPTCHA
 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.");
 }
コード例 #4
0
ファイル: plugin.php プロジェクト: AlexandrST/esoTalk
 public function init()
 {
     // Add the postMember activity type.
     ET::activityModel();
     ETActivityModel::addType("postMember", array("notification" => array(__CLASS__, "postMemberNotification"), "email" => array(__CLASS__, "postMemberEmail")));
     // Define the postMember email language text.
     ET::define("email.postMember.body", "<p><strong>%1\$s</strong> has posted in a conversation: <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.postMember.subject", "There is a new post by %1\$s");
 }
コード例 #5
0
ファイル: plugin.php プロジェクト: ZerGabriel/Reputation
 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;
 }
コード例 #6
0
ファイル: plugin.php プロジェクト: m-mori/forum
 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>";
     }
 }
コード例 #7
0
 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");
 }
コード例 #8
0
ファイル: plugin.php プロジェクト: AlexandrST/esoTalk
 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.");
 }
コード例 #9
0
ファイル: ET.class.php プロジェクト: m-mori/forum
 /**
  * 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);
     }
 }
コード例 #10
0
ファイル: plugin.php プロジェクト: ZerGabriel/Views
 public function init()
 {
     ET::define("gambit.order by views", "order by views");
 }
コード例 #11
0
 /**
  * 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);
     }
 }
コード例 #12
0
ファイル: plugin.php プロジェクト: m-mori/forum
 public function init()
 {
     ET::define("message.trackingIdHelp", "Get your Tracking ID by going into the <em>Administration</em> section for your Google Analytics Property and selecting <em>Property Settings</em>.");
 }
コード例 #13
0
ファイル: plugin.php プロジェクト: ZerGabriel/Sitemap
 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.");
 }
コード例 #14
0
ファイル: plugin.php プロジェクト: m-mori/forum
 public function init()
 {
     ET::conversationModel();
     ETConversationModel::addLabel("answered", "IF(c.answered > 0,1,0)", "icon-ok-sign");
     ET::define("label.answered", "Answered");
 }