本文整理汇总了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");
}
示例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");
}
示例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.");
}
示例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;
}
示例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>";
}
}
示例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");
}
示例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);
}
}
示例8: init
public function init()
{
ET::define("gambit.order by views", "order by views");
}
示例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);
}
}
示例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.");
}