本文整理汇总了PHP中EasyTemplate::html方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyTemplate::html方法的具体用法?PHP EasyTemplate::html怎么用?PHP EasyTemplate::html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyTemplate
的用法示例。
在下文中一共展示了EasyTemplate::html方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
function execute()
{
global $wgOut, $wgRequest;
require_once 'dedupQuery.php';
$action = $wgRequest->getVal('act');
if ($action == NULL) {
EasyTemplate::set_path(dirname(__FILE__));
$wgOut->addHTML(EasyTemplate::html('CommunityExpert.tmpl.php'));
} elseif ($action == "get") {
$url = $wgRequest->getVal('url');
$query = $this->getQueryFromUrl($url);
if ($query) {
dedupQuery::addQuery($query);
dedupQuery::matchQueries(array($query));
$dbr = wfGetDB(DB_SLAVE);
$sql = "select user_name,tq.tq_title as title, sum(ct) as score from firstedit join dedup.title_query tq on tq.tq_page_id=fe_page join dedup.query_match on tq.tq_query=query2 join wiki_shared.user on fe_user=user_id where query1=" . $dbr->addQuotes($query) . " group by fe_user order by score desc";
$dbr = wfGetDB(DB_SLAVE);
$res = $dbr->query($sql, __METHOD__);
header("Content-Type: text/tsv");
header('Content-Disposition: attachment; filename="Dedup.xls"');
print "User page\tRelated title\n";
foreach ($res as $row) {
print "http://www.wikihow.com/User:" . $row->user_name . "\thttp://www.wikihow.com/" . str_replace(" ", "-", $row->title) . "\n";
}
exit;
} else {
print "NO URL";
exit;
}
}
}
示例2: execute
function execute($par)
{
global $wgUser, $wgOut, $wgRequest, $wgServer, $isDevServer;
$userGroups = $wgUser->getGroups();
if ($wgUser->isBlocked() || !in_array('staff', $userGroups)) {
$wgOut->setRobotpolicy('noindex,nofollow');
$wgOut->showErrorPage('nosuchspecialpage', 'nospecialpagetext');
return;
}
if ($wgRequest->wasPosted()) {
$this->action = $wgRequest->getVal('a');
$this->slowQuery = $wgRequest->getVal('alts') == 'true';
$this->introOnly = $wgRequest->getVal('intonly') == 'true';
switch ($this->action) {
case 'cats':
$this->outputCategoryReport();
break;
case 'articles':
$this->outputArticleReport();
break;
case 'ids':
$this->outputArticleIdReport();
break;
}
return;
}
$this->action = empty($par) ? 'cats' : strtolower($par);
$wgOut->addScript(HtmlSnips::makeUrlTags('js', array('download.jQuery.js'), 'extensions/wikihow/common', false));
EasyTemplate::set_path(dirname(__FILE__) . '/');
$vars = array();
$this->setVars($vars);
$html = EasyTemplate::html('ArticleData', $vars);
$wgOut->setPageTitle('Article Stats');
$wgOut->addHTML($html);
}
示例3: execute
public function execute()
{
global $wgRequest, $wgOut, $wgUser;
$userGroups = $wgUser->getGroups();
if ($wgUser->isBlocked() || !in_array('staff', $userGroups)) {
$wgOut->setRobotpolicy('noindex,nofollow');
$wgOut->errorpage('nosuchspecialpage', 'nospecialpagetext');
return;
}
if ($wgRequest->wasPosted()) {
$query = $wgRequest->getVal('query');
ini_set('memory_limit', '1024M');
//Take up to 4 minutes to download big queries
set_time_limit(240);
$this->getQuery();
} else {
EasyTemplate::set_path(dirname(__FILE__) . '/');
$vars = array('fields' => $this->getFields());
$wgOut->addScript(HtmlSnips::makeUrlTags('js', array('download.jQuery.js'), 'extensions/wikihow/common', false));
$wgOut->addScript(HtmlSnips::makeUrlTags('js', array('jquery.sqlbuilder-0.06.js'), 'extensions/wikihow/titus', false));
$html = EasyTemplate::html('flaviusquerytool.tmpl.php', $vars);
$wgOut->addHTML($html);
}
return $html;
}
示例4: showAdminForm
private function showAdminForm()
{
global $wgOut;
EasyTemplate::set_path(dirname(__FILE__));
$vars['ts'] = wfTimestampNow();
$wgOut->addHtml(EasyTemplate::html('imagefeedback_admin'));
}
示例5: onCustomEdit
/**
* Called when the user goes to an edit page
* Override the functionality of the edit to require a URL to translate
*/
static function onCustomEdit()
{
global $wgRequest, $wgOut;
$draft = $wgRequest->getVal('draft', null);
$target = $wgRequest->getVal('title', null);
$action = $wgRequest->getVal('action', null);
$section = $wgRequest->getVal('section', $wgRequest->getVal('wpSection', null));
$save = $wgRequest->getVal('wpSave', null);
$title = Title::newFromURL($target);
// We have the dialog to enter the URL when we are adding a new article, and have no existing draft.
if (self::isTranslatorUser()) {
if ($draft == null && !$title->exists() && $action == 'edit') {
EasyTemplate::set_path(dirname(__FILE__) . '/');
// Templates to remove from tranlsation
$remove_templates = array("{{FA}}", "\\[\\[Category:[^\\]]+\\]\\]");
// Words or things to automatically translate
$translations = array(array('from' => self::getSectionRegex('Steps'), 'to' => self::getSectionWikitext(wfMsg('Steps'))), array('from' => self::getSectionRegex('Tips'), 'to' => self::getSectionWikitext(wfMsg('Tips'))), array('from' => self::getSectionRegex('Warnings'), 'to' => self::getSectionWikitext(wfMsg('Warnings'))), array('from' => self::getSectionRegex('Ingredients'), 'to' => self::getSectionWikitext(wfMsg('Ingredients'))), array('from' => self::getSectionRegex("Things You'll need"), 'to' => self::getSectionWikitext(wfMsg('Thingsyoullneed'))), array('from' => self::getSectionRegex("Related wikiHows"), 'to' => self::getSectionWikitext(wfMsg('Related'))), array('from' => self::getSectionRegex("Sources and Citations"), 'to' => self::getSectionWikitext(wfMsg('Sources'))));
$vars = array('title' => $target, 'checkForLL' => true, 'translateURL' => true, 'translations' => json_encode($translations), 'remove_templates' => array_map(preg_quote, $remove_templates));
$html = EasyTemplate::html('TranslateEditor.tmpl.php', $vars);
$wgOut->addHTML($html);
QuickEdit::showEditForm($title);
return false;
} elseif ($section == null && $save == null) {
EasyTemplate::set_path(dirname(__FILE__) . '/');
$vars = array('title' => $target, 'checkForLL' => true, 'translateURL' => false);
$html = EasyTemplate::html('TranslateEditor.tmpl.php', $vars);
$wgOut->addHTML($html);
QuickEdit::showEditForm($title);
return false;
}
}
return true;
}
示例6: beforeHeaderDisplay
static function beforeHeaderDisplay($isMobile)
{
global $whEditRedirectSave, $wgOut, $wgRequest, $wgUser, $wgTitle;
/*
* We only want to display the edit redirect page on desktop after the first edit on a main namespace page. We check a bunch of criteria to ensure this is he case.
* criteria to ensure this is indeed the first edit
*/
if (!$isMobile && isset($_SESSION[self::OUR_SESSION_NAME]) && $_SESSION[self::OUR_SESSION_NAME] && Hydra::isEnabled(self::EXPERIMENT_NAME) || $wgRequest->getVal("abtest_test2") == "1") {
// Turn off cache because this is a onetime thing
$wgOut->enableClientCache(false);
unset($_SESSION[self::OUR_SESSION_NAME]);
$cats = $wgTitle->getParentCategories();
if (sizeof($cats) == 0) {
return true;
}
$catkeys = array_keys($cats);
$cat = false;
foreach ($catkeys as $k) {
if (preg_match('@Category:(.+)@i', $k, $matches) && $matches[1] != 'Featured-Articles') {
$cat = $matches[1];
break;
}
}
// We only display the edit redirect dialog for main namespace edits
if ($wgTitle->getNamespace() == NS_MAIN && $wgRequest->getText('action', 'view') == 'view' && $cat) {
EasyTemplate::set_path(dirname(__FILE__));
$catText = str_replace('-', ' ', $cat);
$vars = array('cat' => $cat, 'catText' => $catText);
$tmpl = EasyTemplate::html("CatRedirect.tmpl.php", $vars);
$wgOut->addScript($tmpl);
}
}
return true;
}
示例7: execute
function execute($par)
{
global $wgUser, $wgOut, $wgRequest;
$userGroups = $wgUser->getGroups();
if ($wgUser->isBlocked() || !in_array('staff', $userGroups)) {
$wgOut->setRobotpolicy('noindex,nofollow');
$wgOut->showErrorPage('nosuchspecialpage', 'nospecialpagetext');
return;
}
if ($wgRequest->wasPosted()) {
$wgOut->disable();
$result = array();
$result['debug'][] = "posted to apiappadmin";
if ($wgRequest->getVal("action") == "default") {
$this->testQuery(&$result);
} else {
if ($wgRequest->getVal("action") == "getpage") {
//nothing yet
}
}
echo json_encode($result);
return;
}
$wgOut->setPageTitle('APIAppAdmin');
EasyTemplate::set_path(dirname(__FILE__) . '/');
$vars['css'] = HtmlSnips::makeUrlTags('css', array('apiappadmin.css'), 'extensions/wikihow/apiappsupport', true);
$wgOut->addScript(HtmlSnips::makeUrlTags('js', array('apiappadmin.js'), 'extensions/wikihow/apiappsupport', true));
$html = EasyTemplate::html('APIAppAdmin', $vars);
$wgOut->addHTML($html);
}
示例8: execute
public function execute()
{
global $wgOut;
EasyTemplate::set_path(dirname(__FILE__));
$wgOut->setPageTitle("Welcome to wikiHow!");
$wgOut->addHTML(EasyTemplate::html('NewUserPage.tmpl.php'));
return true;
}
示例9: showTemplate
/**
* Show the HTML template for adding images to URLs
*/
private function showTemplate()
{
global $wgOut, $wgActiveLangs;
EasyTemplate::set_path(dirname(__FILE__));
$tmpl = EasyTemplate::html("Alfredo.tmpl.php", array('langs' => $this->langs));
$wgOut->addScript(HtmlSnips::makeUrlTags('js', array('download.jQuery.js'), 'extensions/wikihow/common', false));
$wgOut->addHTML($tmpl);
}
示例10: execute
public function execute()
{
require_once 'YBSuggestions.php';
require_once 'KeywordIdeasCSV.php';
global $wgOut, $wgRequest, $wgUser;
if ($wgUser->isBlocked()) {
throw new PermissionsError('Leonard');
}
$userGroups = $wgUser->getGroups();
if (!in_array('staff', $userGroups)) {
$wgOut->setRobotpolicy('noindex,nofollow');
$wgOut->showErrorPage('nosuchspecialpage', 'nospecialpagetext');
return;
}
$csvFieldName = 'csvfile';
$action = $wgRequest->getVal('act');
$avg_gad_keyword_search_thresh = $wgRequest->getVal('thresh');
if (empty($avg_gad_keyword_search_thresh)) {
$avg_gad_keyword_search_thresh = self::AVG_GAD_KEYWORD_MONTHLY_SEARCH_THRESH;
} else {
$avg_gad_keyword_search_thresh = (int) $avg_gad_keyword_search_thresh;
}
$groupTitles = $wgRequest->getVal('groupTitles');
$groupTitles = empty($groupTitles) ? false : true;
$this->queriesR = $wgRequest->getVal('seed');
$file = $wgRequest->getVal($csvFieldName);
if ($action == NULL) {
EasyTemplate::set_path(dirname(__FILE__));
$wgOut->addHTML(EasyTemplate::html('Leonard.tmpl.php'));
} elseif ($action == 'getTitles' && $_FILES && !empty($_FILES["csvfile"]["name"])) {
list($err, $filename) = $this->uploadFile($csvFieldName, $this->allowedFileExts, $this->allowedCsvFileSize, $this->allowedFileTypes, true);
if ($err) {
$wgOut->addHTML($err);
} else {
list($err, $seed, $rows) = Yboss::fetchQueries($filename, $avg_gad_keyword_search_thresh, $groupTitles);
unlink($filename);
if ($err) {
$wgOut->addHTML($err);
} else {
$xlsFileName = "";
if ($seed) {
$xlsFileName = $seed[KeywordIdeasCSV::KEY_KEYWORD];
if (!empty($xlsFileName)) {
$xlsFileName = str_replace(' ', '-', $xlsFileName);
}
}
$this->printCSVRows($rows, $xlsFileName);
}
}
} elseif ($action == 'getTitles' && $this->queriesR) {
$internalDedup = $wgRequest->getVal('internalDedup');
if ($internalDedup) {
$this->getTopMatchBatch();
} else {
$this->getBatch();
}
}
}
示例11: generateHtml
private function generateHtml()
{
global $wgOut;
$me = Title::makeTitle(NS_SPECIAL, 'ImageUploadHandler');
$vars = array();
$vars['submitUrl'] = $me->getFullUrl() . '?viapage=' . $this->t->getPartialURL();
$vars['loadingWheel'] = wfGetPad('/extensions/wikihow/rotate.gif');
return EasyTemplate::html('mobile-image-upload.tmpl.php', $vars);
}
示例12: printReport
function printReport()
{
global $wgOut, $wgRequest;
$vars['results'] = $this->getEdits();
$vars['days'] = $wgRequest->getVal("days", 30);
$vars['css'] = HtmlSnips::makeUrlTags('css', array('adminmethodeditor.css'), 'extensions/wikihow/altmethodadder', true);
$html = EasyTemplate::html('AdminMethodEditor', $vars);
$wgOut->addHTML($html);
}
示例13: execute
function execute($par)
{
global $wgOut, $wgRequest, $wgUser, $wgParser;
wfLoadExtensionMessages("TipsPatrol");
if ($wgUser->isBlocked()) {
$wgOut->blockedPage();
return;
}
if ($wgUser->isAnon() || self::isBlockedFromTipsPatrol($wgUser)) {
$wgOut->setRobotpolicy('noindex,nofollow');
$wgOut->errorpage('nosuchspecialpage', 'nospecialpagetext');
return;
}
$this->skipTool = new ToolSkip("tiptool", "tipsandwarnings", "tw_checkout", "tw_checkout_user", "tw_id");
if ($wgRequest->wasPosted()) {
$wgOut->disable();
$result = array();
$tipId = $wgRequest->getVal('tipId');
if ($wgRequest->getVal('coachTip')) {
$this->coachResult($tipId, &$result);
} elseif ($tipId != null && $wgRequest->getVal('skipTip')) {
$this->logTip($tipId, self::TIP_ACTION_SKIP);
$this->skipTool->skipItem($tipId);
$this->skipTool->unUseItem($tipId);
} elseif ($wgRequest->getVal('deleteTip')) {
$articleId = $wgRequest->getVal('articleId');
$tip = $wgRequest->getVal('tip');
$this->deleteTip($tipId, $articleId, $tip);
} elseif ($wgRequest->getVal('keepTip')) {
//used to send to keepTip, but now we have an extra step: QG
$articleId = $wgRequest->getVal('articleId');
$tip = $wgRequest->getVal('tip');
$this->logTip($tipId, self::TIP_ACTION_QG, '', $tip);
$this->addToQG($tipId, $articleId, $tip, $result);
}
$this->getNextTip(&$result);
echo json_encode($result);
return;
}
$wgOut->setHTMLTitle(wfMsg('tipspatrol'));
$wgOut->setPageTitle(wfMsg('tipspatrol'));
$wgOut->addHTML(HtmlSnips::makeUrlTags('css', array('tipspatrol.css'), 'extensions/wikihow/tipsandwarnings', false));
$wgOut->addScript(HtmlSnips::makeUrlTags('js', array('tipspatrol.js'), 'extensions/wikihow/tipsandwarnings', false));
$wgOut->addScript(HtmlSnips::makeUrlTags('js', array('mousetrap.min.js,jquery.cookie.js'), 'extensions/wikihow/common', false));
EasyTemplate::set_path(dirname(__FILE__));
$vars = array();
$vars['tip_skip_title'] = wfMsg('tip_skip_title');
$vars['tip_keep_title'] = wfMsg('tip_keep_title');
$vars['tip_delete_title'] = wfMsg('tip_delete_title');
$wgOut->addHTML(EasyTemplate::html('TipsPatrol.tmpl.php', $vars));
$bubbleText = "Only publish this tip if you can make it helpful, clear, and grammatically correct. Most tips should get deleted.";
InterfaceElements::addBubbleTipToElement('tip_tip', 'tptrl', $bubbleText);
$this->displayLeaderboards();
}
示例14: parserFunction
public static function parserFunction($parser, $arrowText, $grayText, $scrollText)
{
global $wgTitle, $wgContLang;
$scrollText = self::prepareText($scrollText);
$grayText = self::prepareText($grayText);
$arrowText = self::prepareText($arrowText);
$vars = array('arrowText' => $arrowText, 'grayText' => $grayText, 'scrollText' => $scrollText, 'id' => 'scrl-' . hash("md5", $scrollText . mt_rand(1, 1000)));
EasyTemplate::set_path(dirname(__FILE__) . '/');
$html = EasyTemplate::html('textscroller', $vars);
$html = preg_replace("@\n@", "", $html);
return $parser->insertStripItem($html);
}
示例15: getHtml
public function getHtml()
{
global $wgTitle;
$html = "";
if (self::isValidArticle()) {
$this->setTemplatePath();
$vars['ar_css'] = "";
$vars['ar_js'] .= "";
$html = EasyTemplate::html('rating_desktop.tmpl.php', $vars);
}
return $html;
}