本文整理汇总了PHP中ewiki_t函数的典型用法代码示例。如果您正苦于以下问题:PHP ewiki_t函数的具体用法?PHP ewiki_t怎么用?PHP ewiki_t使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ewiki_t函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ewiki_edit_lock
function ewiki_edit_lock($id, &$data, $action)
{
$keep = 500;
// in seconds
$o = "";
#-- lock dir
if (!file_exists($dir = EWIKI_TMP . "/edit.d/")) {
mkdir($dir);
}
#-- check file
$lockfile = $dir . ewiki_lowercase($id) . ".lock";
$time = 0;
if (file_exists($lockfile)) {
$time = filemtime($lockfile);
}
#-- force
if ($_REQUEST["edit_unlock"]) {
unlink($lockfile);
$time = -1;
} elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
@unlink($lockfile);
} else {
if ($time + $keep > time()) {
$o = ewiki_t("<p class=\"system-message\"><b>_{Warning}</b>:" . " _{This page is currently being edited by someone else}," . " _{and therefore locked currently}." . " " . '<form action="' . $_SERVER[REQUEST_URI] . '" method="POST">' . '<input type="id" name="' . "{$action}/{$id}" . '">' . '<input type="submit" name="edit_unlock" value="_{unlock}">' . '</form>' . "</p>\n");
} elseif ($time) {
// unlink($lockfile);
touch($lockfile);
} else {
touch($lockfile);
}
}
return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:33,代码来源:lock.php
示例2: ewiki_page_liveuser_chprefs
/**
* changes user preferences based on form input
*
* @param mixed id
* @param mixed data
* @return mixed
*/
function ewiki_page_liveuser_chprefs($id, $data)
{
global $liveuser, $liveuserDB;
// if form was submitted, write
if (isset($_REQUEST['submit_prefs'])) {
return ewiki_t('CHPWFORM');
}
ob_start();
echo ewiki_make_title($id, $id, 2);
$results = $liveuserDB->getAll('SELECT * FROM ' . LW_PREFIX . '_prefs_fields');
foreach ($results as $result) {
if (isset($_REQUEST[$result['field_name']])) {
liveuser_pref_setPref($liveuser->getHandle(), $result['field_name'], $_REQUEST[$result['field_name']]);
}
}
echo '<form action="" method="post"><table border="1">';
foreach ($results as $result) {
echo '<tr><td>';
echo '<label for="' . $result['field_name'] . '">' . $result['field_name'] . '</label></td><td>';
echo '<input id="' . $result['field_name'] . '" name="' . $result['field_name'] . '" type="text" ';
echo ' value=' . liveuser_pref_getPref($liveuser->getHandle(), $result['field_name']) . '></td></tr>';
}
echo '<tr><td colspan="2"><input type="reset" text="Reset"><input type="submit"></td></tr></table></form>';
$o = ob_get_contents();
ob_end_clean();
return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:34,代码来源:pref_liveuser.php
示例3: ewiki_view_append_attachments
function ewiki_view_append_attachments($id, $data, $action)
{
$o = '<hr /><h4><a href="' . ewiki_script(EWIKI_ACTION_ATTACHMENTS, $id) . '">' . ewiki_t("ATTACHMENTS") . '</a></h4>';
$scan = 's:7:"section";' . serialize($id);
$result = ewiki_database("SEARCH", array("meta" => $scan));
#### BEGIN MOODLE CHANGES - show attachments link only if there are attachments.
#### - don't show the attachments on the content page.
if (count($result->entries) <= 0) {
$o = '';
}
// $ord = array();
// while ($row = $result->get()) {
// $ord[$row["id"]] = $row["created"];
// }
// arsort($ord);
//
// foreach ($ord as $id => $uu) {
// $row = ewiki_database("GET", array("id"=>$id));
// if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $row, "view")) {
// continue;
// }
// $o .= ewiki_entry_downloads($row, "*");
// }
#### END MOODLE CHANGES
return $o;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:26,代码来源:downloads.php
示例4: ewiki_extract
function ewiki_extract($id, $data, $action)
{
global $ewiki_links, $ewiki_config, $ewiki_plugins, $ewiki_ring, $ewiki_title;
$extracttypes = $ewiki_config["extracttypes"][$action];
$o = ewiki_make_title($id, ewiki_t(strtoupper($action) . "FROM") . $ewiki_title, 2, $action, "", "_MAY_SPLIT=1");
//ignore any number of list markup tags in front of an @@{todotype},
//extract only the @@, the types, and their message
//or
//extract any header line
//1 2 3 4-Class 5 6
preg_match_all("/^(([-;:#\\* ]*)(@@(" . implode("|", $extracttypes) . ")(.*))|(!+.*))\$/im", $data["content"], $matches);
for ($index = 0; $index < sizeof($matches[0]); $index++) {
//a line will be either header or todo, concatenate the two sub expressions
$extractedContent .= $matches[3][$index] . $matches[6][$index] . "\n\n";
}
//Render extracted lines as a wiki page, this code extracted from ewiki_page
#-- render requested wiki page <-- goal !!!
$o .= "<div class='ewiki_page_todolist'>" . $ewiki_plugins["render"][0]($extractedContent . ewiki_t(strtoupper($action) . "POSTSCRIPT"), 1, EWIKI_ALLOW_HTML || @$data["flags"] & EWIKI_DB_F_HTML) . "</div>";
#-- control line + other per-page info stuff
if ($pf_a = $ewiki_plugins["view_append"]) {
ksort($pf_a);
foreach ($pf_a as $n => $pf) {
$o .= $pf($id, $data, $action);
}
}
if ($pf_a = $ewiki_plugins["view_final"]) {
ksort($pf_a);
foreach ($pf_a as $n => $pf) {
if (!preg_match('/_title/', $pf)) {
$pf($o, $id, $data, $action);
}
}
}
return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:35,代码来源:extract.php
示例5: ewiki_addpage
function ewiki_addpage($id, &$data, $version)
{
$o = ewiki_make_title($id, $id, 2);
#-- output page creation dialog
if (empty($_REQUEST["new_id"])) {
$o .= ewiki_t('<form action="' . ewiki_script("", $id) . '" method="POST" enctype="multipart/formdata"> ' . '_{name of the new page} <input type="text" name="new_id" size="26" value="">' . '<br />' . '<input type="submit" value="_{create}">' . '<br /><br />' . '<input type="checkbox" name="add_link_from" value="1" checked="checked">' . ' _{link it from} ' . '<input type="text" name="link_from" size="20" value="_{AddedPages}">' . '</form>');
} else {
$new_id = trim($_REQUEST["new_id"]);
#-- add a link to new page
if ($_REQUEST["add_link_from"] && ($from = $_REQUEST["link_from"])) {
$row = ewiki_db::GET($from);
if ($row && $row["version"]) {
if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
$row["version"]++;
$row["content"] .= "\n* [{$new_id}]";
ewiki_scan_wikiwords($row["content"], $row["refs"], "_STRIP_EMAIL=1");
$row["refs"] = "\n\n" . implode("\n", array_keys($row["refs"])) . "\n\n";
} else {
$row = false;
}
} else {
$row = array("id" => $from, "version" => 1, "flags" => EWIKI_DB_F_TEXT, "created" => time(), "lastmodified" => time(), "hits" => 0, "meta" => "", "content" => "\n* [{$new_id}]", "refs" => "\n\n{$new_id}\n\n");
}
if ($row) {
ewiki_db::WRITE($row);
}
}
#-- call edit <form>
$o = ewiki_page($new_id);
}
return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:32,代码来源:addnewpage.php
示例6: ewiki_page_wiki_dump_tarball
function ewiki_page_wiki_dump_tarball($id, $data, $action)
{
#-- return legacy page
if (empty($_REQUEST["download_tarball"])) {
$url = ewiki_script("", $id);
return ewiki_make_title($id, $id, 2) . ewiki_t(<<<END
_{WIKIDUMP}
<br /><br />
<form action="{$url}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="id" value="{$id}">
<input type="submit" name="download_tarball" value="_{download tarball}">
<br /><br />
<input type="checkbox" name="dump_images" value="1"> _{with images}<br />
<input type="checkbox" name="dump_virtual" value="1"> _{include virtual pages}<br />
<input type="checkbox" name="dump_fullhtml" value="1" checked> _{complete .html files}<br />
<input type="checkbox" name="dump_linksto" value="1"> _{with backlink pages}<br />
</form>
END
);
} else {
$di = $_REQUEST["dump_images"];
$fh = $_REQUEST["dump_fullhtml"];
$bl = $_REQUEST["dump_linksto"];
$vp = $_REQUEST["dump_virtual"];
$_REQUEST = $_GET = $_POST = array();
set_time_limit(180);
ewiki_page_wiki_dump_send($di, $fh, $vp, $bl);
}
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:29,代码来源:wikidump.php
示例7: ewiki_auth_query_http
function ewiki_auth_query_http(&$data, $force_query = 0)
{
global $ewiki_plugins, $ewiki_errmsg, $ewiki_author, $ewiki_ring;
#-- fetch user:password
if ($uu = trim($_SERVER["HTTP_AUTHORIZATION"])) {
$auth_method = strtolower(strtok($uu, " "));
if ($auth_method == "basic") {
$uu = strtok(" ;,");
$uu = base64_decode($uu);
list($_a_u, $_a_p) = explode(":", $uu, 2);
} else {
#-- invalid response, ignore
}
} elseif (strlen($_a_u = trim($_SERVER["PHP_AUTH_USER"]))) {
$_a_p = trim($_SERVER["PHP_AUTH_PW"]);
}
#-- check password
$_success = ewiki_auth_user($_a_u, $_a_p);
#-- request HTTP Basic authentication otherwise
if (!$_success && $force_query || $force_query >= 2) {
$realm = ewiki_t("RESTRICTED_ACCESS");
$addmethod = "";
if ($uu = $ewiki_config["login_notice"]) {
$realm .= " " . $uu;
}
if ($uu = $ewiki_config["http_auth_add"]) {
$addmethod = ", {$uu} realm=\"{$realm}\"";
}
header('HTTP/1.1 401 Authentication Required');
header('Status: 401 Authentication Required');
header('WWW-Authenticate: Basic realm="' . $realm . '"' . $addmethod);
}
#-- fin
return $_success;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:35,代码来源:auth_method_http.php
示例8: ewiki_createpage
function ewiki_createpage($id, &$data, $version)
{
$o = ewiki_make_title($id, $id, 2);
#-- output page creation dialog
$o .= ewiki_t('<form action="' . ewiki_script("", "") . '" method="POST" enctype="multipart/formdata"> ' . '_{name of the new page} <input type="text" name="id" size="26" value="">' . '<br />' . '<input type="submit" value="_{create}">' . '</form>');
return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:7,代码来源:createnewpage.php
示例9: ewiki_edit_form_append_updFormat
function ewiki_edit_form_append_updFormat($id, $data, $action)
{
global $ewiki_ring;
if (!ewiki_auth_perm_liveuser($id, $data, 'manage', $ewiki_ring, 0)) {
return '';
}
return ' <a href="' . ewiki_script('updformatheader', $id) . '">' . ewiki_t("UPDHEADERFORMAT") . '</a>';
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:8,代码来源:update_format.php
示例10: ewiki_edit_save_antibot_checkbox
function ewiki_edit_save_antibot_checkbox(&$save, &$data)
{
global $ewiki_errmsg;
if (!$_REQUEST["antibot_check"] && !isset($GLOBALS["ewiki_no_bot"])) {
$save = NULL;
$ewiki_errmsg = ewiki_t("ANTIBOT_FAILED");
}
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:8,代码来源:antibot_checkbox.php
示例11: ewiki_password_status
function ewiki_password_status($id, &$data, $action)
{
global $liveuser;
$passwd_status = ewiki_get_uservar("passwdstatus", 'expired');
if ($passwd_status != 'good' && $id != "Logout" && $id != "ChangePassword" && $liveuser->isLoggedIn()) {
return ewiki_make_title($id, "Change Password:") . "<p>You password has expired</p>" . ewiki_t("CHPW_FORM");
}
return 0;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:9,代码来源:passwd_expire.php
示例12: ewiki_edit_user_flags
function ewiki_edit_user_flags($id, &$data, $action)
{
global $ewiki_config;
$o = "";
foreach ($ewiki_config as $FLAG => $str) {
$o .= '<input type="checkbox" name="page_user_flag[' . dechex($FLAG) . ']" value="1"' . ($FLAG != EWIKI_DB_F_MINOR && $data["flags"] & $FLAG ? " checked" : "") . ' id="page_user_flag_' . $FLAG . '"><label for="page_user_flag_' . $FLAG . '"> ' . ewiki_t($str) . '</label><br />' . "\n";
}
return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:9,代码来源:flags.php
示例13: ewiki_builtin_categories
function ewiki_builtin_categories($id, &$data, $action)
{
global $ewiki_categories;
$cat = array_merge(array("" => "-"), $ewiki_categories);
$current = @$data["meta"]["meta"][EWIKI_BULTINCAT_METAID];
$o = "<br /> \n " . ewiki_t("category") . ": ";
$o .= ewiki_htm_select(EWIKI_UP_SET_CATEGORY, $cat, $current);
return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:9,代码来源:builtincategories.php
示例14: ewiki_view_append_subpages
function ewiki_view_append_subpages($id, $data, $action, $title = "SUBPAGES", $class = "subpages")
{
$pages = ewiki_subpage_list($id);
if (0 == count($pages)) {
return "";
}
$o = '<div class="' . $class . '"><small>' . ewiki_t($title) . ":</small><br />";
$o .= ewiki_list_pages($pages) . "</div>\n";
return $o;
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:10,代码来源:subpages.php
示例15: ewiki_aedit_authorname
function ewiki_aedit_authorname($id, &$data, $action)
{
$var = EWIKI_UP_AUTHOR_NAME;
return ewiki_t(<<<EOT
<br />
_{set the AuthorName to} <input size="20" name="{$var}" value="{$GLOBALS['ewiki_author']}">
<br />
EOT
);
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:10,代码来源:authorname.php
示例16: ewiki_add_thread
function ewiki_add_thread($id, $data, $action)
{
global $ewiki_plugins;
$id = $id . EWIKI_THREAD_SEPARATOR . $_REQUEST['threadname'];
$save = array("id" => $id, "version" => 1, "flags" => '', "content" => " ", "author" => ewiki_author(), "lastmodified" => time(), "created" => time(), "meta" => array('isThread' => '1'), "hits" => 0, "refs" => "");
if (!ewiki_db::WRITE($save)) {
return ewiki_t("ERRORSAVING");
}
return ewiki_add_post($id, array(), 'addpost');
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:10,代码来源:threads.php
示例17: ewiki_edit_save_antibot_delay
function ewiki_edit_save_antibot_delay(&$save, &$data)
{
global $ewiki_errmsg;
if (!isset($GLOBALS["ewiki_no_bot"])) {
if (time() < $_REQUEST[EWIKI_UP_SAVE_DELAY] + EWIKI_EDIT_SAVE_DELAY) {
$save = NULL;
$ewiki_errmsg = ewiki_t("Too hasty saving rejected. Please go back, wait 3 seconds and hit [save] again.");
}
}
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:10,代码来源:antibot_delay.php
示例18: ewiki_aedit_changelog
function ewiki_aedit_changelog($id, &$data, $action)
{
$var = EWIKI_UP_CHANGELOG;
$val = $_REQUEST[EWIKI_UP_CHANGELOG];
return ewiki_t(<<<EOT
<br />
_{CHANGELOG}:<br /><input size="50" name="{$var}" value="{$val}">
<br />
EOT
);
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:11,代码来源:log.php
示例19: ewiki_page_sitemap
function ewiki_page_sitemap($id = 0, $data = 0, $action = 0)
{
global $ewiki_config;
//**code hijacked from page_pageindex.php**
//creates a list of all of the valid wiki pages in the site
$str_null = NULL;
$a_validpages = ewiki_valid_pages(0, 1);
//**end of hijacked code**
//$time_end=getmicrotime();
//creates the title bar on top of page
if ($id == EWIKI_PAGE_SITEMAP) {
$o = ewiki_make_title($id, ewiki_t($id), 2);
foreach ($ewiki_config["SiteMap"]["RootList"] as $root) {
if (isset($a_validpages[$root])) {
$valid_root = TRUE;
$str_rootid = $root;
break;
}
}
} else {
$o = ewiki_make_title($id, ewiki_t("SMFOR") . " " . $id, 2);
if (isset($a_validpages[$id])) {
$valid_root = TRUE;
$str_rootid = $id;
}
}
$o .= "<p>" . ewiki_t("VIEWSMFOR") . " ";
foreach ($ewiki_config["SiteMap"]["RootList"] as $root) {
if (isset($a_validpages[$root])) {
$o .= '<a href="' . ewiki_script('sitemap/', $root) . '">' . $root . '</a> ';
}
}
$o .= "</p>";
//checks to see if the user is allowed to view the root page
if (!isset($a_validpages[$str_rootid])) {
$o .= ewiki_t("INVALIDROOT");
return $o;
}
//$timesitemap=getmicrotime();
$a_sitemap = ewiki_sitemap_create($str_rootid, $a_validpages, EWIKI_SITEMAP_DEPTH);
$timer = array();
$level = -1;
$fordump = 0;
$str_formatted = "<ul>\n<li><a href=\"" . EWIKI_SCRIPT . $str_rootid . "\">" . $str_rootid . "</a></li>";
$fin_level = format_sitemap($a_sitemap, $str_rootid, $str_formatted, $level, $timer, $fordump);
$str_formatted .= "</ul>" . str_pad("", $fin_level * 6, "</ul>\n");
$o .= $str_formatted;
//$timesitemap_end=getmicrotime();
//$o.="GetAll: ".($time_end-$time)."\n";
//$o.="SiteMap: ".($timesitemap_end-$timesitemap)."\n";
//$o.="Total: ".($timesitemap_end-$time);
return $o;
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:53,代码来源:sitemap.php
示例20: ewiki_handler_jump
function ewiki_handler_jump(&$id, &$data, &$action)
{
global $ewiki_config;
static $redirect_count = 5;
$jump_markup = array("jump", "goto", "redirect", "location");
#-- we only care about "view" action
if ($action != "view") {
return;
}
#-- escape from loop
if (isset($_REQUEST[EWIKI_UP_REDIRECT_COUNT])) {
$redirect_count = $_REQUEST[EWIKI_UP_REDIRECT_COUNT];
}
if ($redirect_count-- <= 0) {
return ewiki_t("REDIRECTION_LOOP", array("id" => $id));
}
#-- search for [jump:...]
if ($links = explode("\n", trim($data["refs"]))) {
foreach ($links as $link) {
if (strlen($link) && strpos($link, ":") && in_array(strtolower(strtok($link, ":")), $jump_markup) && ($dest = trim(strtok("\n")))) {
#-- URL
$url = "";
if (strpos($dest, "://")) {
$url = $dest;
} else {
$url = ewiki_interwiki($dest, $uu, $uu2);
}
#-- Location:
if (EWIKI_JUMP_HTTP && EWIKI_HTTP_HEADERS && !headers_sent()) {
#-- simple PageLink
if (empty($url)) {
$url = ewiki_script("", $dest, array(EWIKI_UP_REDIRECT_COUNT => $redirect_count), 0, 0, ewiki_script_url());
$url .= defined("SID") ? EWIKI_ADDPARAMDELIM . SID : "";
}
header("Location: {$url}");
die;
} elseif ($url) {
return "";
# the rendering kernel will just show up the [jump:]!
# (without the jump: of course)
} else {
#-- we'll just restart ewiki
$data = array();
$id = $dest;
return ewiki_page("view/" . $id);
}
}
}
}
#-search
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:51,代码来源:jump.php
注:本文中的ewiki_t函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论