本文整理汇总了PHP中HTML::br方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::br方法的具体用法?PHP HTML::br怎么用?PHP HTML::br使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML
的用法示例。
在下文中一共展示了HTML::br方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PurgePage
function PurgePage(&$request)
{
global $WikiTheme;
$page = $request->getPage();
$pagelink = WikiLink($page);
if ($request->getArg('cancel')) {
$request->redirect(WikiURL($page));
// noreturn
}
$current = $page->getCurrentRevision();
if (!$current or !($version = $current->getVersion())) {
$html = HTML::p(array('class' => 'error'), _("Sorry, this page does not exist."));
} elseif (!$request->isPost() || !$request->getArg('verify')) {
$purgeB = Button('submit:verify', _("Purge Page"), 'wikiadmin');
$cancelB = Button('submit:cancel', _("Cancel"), 'button');
// use generic wiki button look
$fieldset = HTML::fieldset(HTML::p(fmt("You are about to purge '%s'!", $pagelink)), HTML::form(array('method' => 'post', 'action' => $request->getPostURL()), HiddenInputs(array('currentversion' => $version, 'pagename' => $page->getName(), 'action' => 'purge')), HTML::div(array('class' => 'toolbar'), $purgeB, $WikiTheme->getButtonSeparator(), $cancelB)));
$sample = HTML::div(array('class' => 'transclusion'));
// simple and fast preview expanding only newlines
foreach (explode("\n", firstNWordsOfContent(100, $current->getPackedContent())) as $s) {
$sample->pushContent($s, HTML::br());
}
$html = HTML($fieldset, HTML::div(array('class' => 'wikitext'), $sample));
} elseif ($request->getArg('currentversion') != $version) {
$html = HTML(HTML::p(array('class' => 'error'), _("Someone has edited the page!")), HTML::p(fmt("Since you started the purge process, someone has saved a new version of %s. Please check to make sure you still want to permanently purge the page from the database.", $pagelink)));
} else {
// Real purge.
$pagename = $page->getName();
$dbi = $request->getDbh();
$dbi->purgePage($pagename);
$dbi->touch();
$html = HTML::div(array('class' => 'feedback'), fmt("Purged page '%s' successfully.", $pagename));
}
GeneratePage($html, _("Purge Page"));
}
示例2: run
function run($dbi, $argstr, &$request, $basepage)
{
/* plugin not yet has arguments - save for later (copied from UpLoad)
$args = $this->getArgs($argstr, $request);
extract($args);
*/
$form = HTML::form(array('action' => $request->getPostURL(), 'enctype' => 'multipart/form-data', 'method' => 'post'));
$contents = HTML::div(array('class' => 'wikiaction'));
$contents->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'MAX_FILE_SIZE', 'value' => MAX_UPLOAD_SIZE)));
$contents->pushContent(HTML::input(array('name' => 'userfile', 'type' => 'file', 'size' => '50')));
$contents->pushContent(HTML::raw(" "));
$contents->pushContent(HTML::input(array('value' => _("Convert"), 'type' => 'submit')));
$form->pushContent($contents);
$message = HTML();
$userfile = $request->getUploadedFile('userfile');
if ($userfile) {
$userfile_name = $userfile->getName();
$userfile_name = basename($userfile_name);
$userfile_tmpname = $userfile->getTmpName();
if (!preg_match("/(\\.html|\\.htm)\$/i", $userfile_name)) {
$message->pushContent(_("Only files with extension HTML are allowed"), HTML::br(), HTML::br());
} else {
$message->pushContent(_("Processed {$userfile_name}"), HTML::br(), HTML::br());
$message->pushContent(_("Copy the output below and paste it into your Wiki page."), HTML::br());
$message->pushContent($this->_process($userfile_tmpname));
}
} else {
$message->pushContent(HTML::br(), HTML::br());
}
$result = HTML();
$result->pushContent($form);
$result->pushContent($message);
return $result;
}
示例3: RemovePage
function RemovePage(&$request)
{
global $WikiTheme;
$page = $request->getPage();
$pagelink = WikiLink($page);
if ($request->getArg('cancel')) {
$request->redirect(WikiURL($page));
// noreturn
}
$current = $page->getCurrentRevision();
if (!$current or !($version = $current->getVersion())) {
$html = HTML(HTML::h2(_("Already deleted")), HTML::p(_("Sorry, this page is not in the database.")));
} elseif (!$request->isPost() || !$request->getArg('verify')) {
$removeB = Button('submit:verify', _("Remove Page"), 'wikiadmin');
$cancelB = Button('submit:cancel', _("Cancel"), 'button');
// use generic wiki button look
$html = HTML(HTML::h2(fmt("You are about to remove '%s'!", $pagelink)), HTML::form(array('method' => 'post', 'action' => $request->getPostURL()), HiddenInputs(array('currentversion' => $version, 'pagename' => $page->getName(), 'action' => 'remove')), HTML::div(array('class' => 'toolbar'), $removeB, $WikiTheme->getButtonSeparator(), $cancelB)), HTML::hr());
$sample = HTML::div(array('class' => 'transclusion'));
// simple and fast preview expanding only newlines
foreach (explode("\n", firstNWordsOfContent(100, $current->getPackedContent())) as $s) {
$sample->pushContent($s, HTML::br());
}
$html->pushContent(HTML::div(array('class' => 'wikitext'), $sample));
} elseif ($request->getArg('currentversion') != $version) {
$html = HTML(HTML::h2(_("Someone has edited the page!")), HTML::p(fmt("Since you started the deletion process, someone has saved a new version of %s. Please check to make sure you still want to permanently remove the page from the database.", $pagelink)));
} else {
// Codendi specific: remove the deleted wiki page from ProjectWantedPages
$projectPageName = 'ProjectWantedPages';
$pagename = $page->getName();
$dbi = $request->getDbh();
require_once PHPWIKI_DIR . "/lib/loadsave.php";
$pagehandle = $dbi->getPage($projectPageName);
if ($pagehandle->exists()) {
// don't replace default contents
$current = $pagehandle->getCurrentRevision();
$version = $current->getVersion();
$text = $current->getPackedContent();
$meta = $current->_data;
}
$text = str_replace("* [{$pagename}]", "", $text);
$meta['summary'] = $GLOBALS['Language']->getText('wiki_lib_wikipagewrap', 'page_added', array($pagename));
$meta['author'] = user_getname();
$pagehandle->save($text, $version + 1, $meta);
//Codendi specific: remove permissions for this page @codenditodo: may be transferable otherwhere.
require_once 'common/wiki/lib/WikiPage.class.php';
$wiki_page = new WikiPage(GROUP_ID, $_REQUEST['pagename']);
$wiki_page->resetPermissions();
// Real delete.
//$pagename = $page->getName();
$dbi = $request->getDbh();
$dbi->deletePage($pagename);
$dbi->touch();
$link = HTML::a(array('href' => 'javascript:history.go(-2)'), _("Back to the previous page."));
$html = HTML(HTML::h2(fmt("Removed page '%s' successfully.", $pagename)), HTML::div($link), HTML::hr());
}
GeneratePage($html, _("Remove Page"));
}
示例4: redirect_to_action
static function redirect_to_action($r, $time = 0, $parameters = null)
{
$p = null;
if (is_array($parameters)) {
foreach ($parameters as $param => $value) {
$p .= "&{$param}={$value}";
}
}
echo "<meta http-equiv='Refresh' content='{$time}; url=index.php?ruta=" . $r . "" . $p . "'/>";
echo HTML::br(2);
echo MESSAGE_REDIRECT;
//header("location: index.php?ruta=".$r."".$p."");
}
示例5: run
function run($dbi, $argstr, &$request, $basepage)
{
/* ignore fatal on loading */
/*
global $ErrorManager;
$ErrorManager->pushErrorHandler(new WikiMethodCb($this,'_error_handler'));
*/
// Require the XML_FOAF_Parser class. This is a pear library not included with phpwiki.
// see doc/README.foaf
if (findFile('XML/FOAF/Parser.php', 'missing_ok')) {
require_once 'XML/FOAF/Parser.php';
}
//$ErrorManager->popErrorHandler();
if (!class_exists('XML_FOAF_Parser')) {
return $this->error(_("required pear library XML/FOAF/Parser.php not found in include_path"));
}
extract($this->getArgs($argstr, $request));
// Get our FOAF File from the foaf plugin argument or $_GET['foaf']
if (empty($foaf)) {
$foaf = $request->getArg('foaf');
}
$chooser = HTML::form(array('method' => 'get', 'action' => $request->getURLtoSelf()), HTML::h4(_("FOAF File URI")), HTML::input(array('id' => 'foaf', 'name' => 'foaf', 'type' => 'text', 'size' => '80', 'value' => $foaf)), HTML::br(), HTML::input(array('id' => 'pretty', 'name' => 'pretty', 'type' => 'radio', 'checked' => 'checked'), _("Pretty HTML")), HTML::input(array('id' => 'original', 'name' => 'original', 'type' => 'radio'), _("Original URL (Redirect)")), HTML::br(), HTML::input(array('type' => 'submit', 'value' => _("Parse FOAF"))));
if (empty($foaf)) {
return $chooser;
} else {
//Error Checking
if (substr($foaf, 0, 7) != "http://") {
return $this->error(_("foaf must be a URI starting with http://"));
}
// Start of output
if (!empty($original)) {
$request->redirect($foaf);
} else {
$foaffile = url_get_contents($foaf);
if (!$foaffile) {
//TODO: get errormsg
return HTML(HTML::p("Resource isn't available: Something went wrong, probably a 404!"));
}
// Create new Parser object
$parser = new XML_FOAF_Parser();
// Parser FOAF into $foaffile
$parser->parseFromMem($foaffile);
$a = $parser->toArray();
$html = HTML(HTML::h1(@$a[0]["name"]), HTML::table(HTML::thead(), HTML::tbody(@$a[0]["title"] ? HTML::tr(HTML::td(_("Title")), HTML::td($a[0]["title"])) : null, @$a[0]["homepage"][0] ? $this->iterateHTML($a[0], "homepage", $a["dc"]) : null, @$a[0]["weblog"][0] ? $this->iterateHTML($a[0], "weblog", $a["dc"]) : null, HTML::tr(HTML::td("Full Name"), @$a[0]["name"][0] ? HTML::td(@$a[0]["name"]) : null), @$a[0]["nick"][0] ? $this->iterateHTML($a[0], "nick", $a["dc"]) : null, @$a[0]["mboxsha1sum"][0] ? $this->iterateHTML($a[0], "mboxsha1sum", $a["dc"]) : null, @$a[0]["depiction"][0] ? $this->iterateHTML($a[0], "depiction", $a["dc"]) : null, @$a[0]["seealso"][0] ? $this->iterateHTML($a[0], "seealso", $a["dc"]) : null, HTML::tr(HTML::td("Source"), HTML::td(HTML::a(array('href' => @$foaf), "RDF"))))));
if (DEBUG) {
$html->pushContent(HTML::hr(), $chooser);
}
return $html;
}
}
}
示例6: showForm
function showForm(&$dbi, &$request, $args, $allrelations)
{
global $WikiTheme;
$action = $request->getPostURL();
$hiddenfield = HiddenInputs($request->getArgs(), '', array('action', 'page', 's'));
$pagefilter = HTML::input(array('name' => 'page', 'value' => $args['page'], 'title' => _("Search only in these pages. With autocompletion."), 'class' => 'dropdown', 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'false', 'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'), '');
$help = Button('submit:semsearch[help]', "?", false);
$svalues = empty($allrelations) ? "" : join("','", $allrelations);
$reldef = JavaScript("var semsearch_relations = new Array('" . $svalues . "')");
$querybox = HTML::textarea(array('name' => 's', 'title' => _("Enter a valid query expression"), 'rows' => 4, 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_assoc' => 'false', 'autocomplete_matchsubstring' => 'true', 'autocomplete_list' => 'array:semsearch_relations'), $args['s']);
$submit = Button('submit:semsearch[relations]', _("Search"), false, array('title' => 'Move to help page. No seperate window'));
$instructions = _("Search in all specified pages for the expression.");
$form = HTML::form(array('action' => $action, 'method' => 'post', 'accept-charset' => $GLOBALS['charset']), $reldef, $hiddenfield, HiddenInputs(array('attribute' => '')), $instructions, HTML::br(), HTML::table(array('border' => '0', 'width' => '100%'), HTML::tr(HTML::td(_("Pagename(s): "), $pagefilter), HTML::td(array('align' => 'right'), $help)), HTML::tr(HTML::td(array('colspan' => 2), $querybox))), HTML::br(), HTML::div(array('align' => 'center'), $submit));
return $form;
}
示例7: run
function run($dbi, $argstr, &$request, $basepage)
{
$args = $this->getArgs($argstr, $request);
extract($args);
$output = HTML(HTML::h1("Group Info"));
$group = WikiGroup::getGroup();
$allGroups = $group->getAllGroupsIn();
foreach ($allGroups as $g) {
$members = $group->getMembersOf($g);
$output->pushContent(HTML::h3($g . " - members: " . sizeof($members) . " - isMember: " . ($group->isMember($g) ? "yes" : "no")));
foreach ($members as $m) {
$output->pushContent($m);
$output->pushContent(HTML::br());
}
}
$output->pushContent(HTML::p("--- the end ---"));
return $output;
}
示例8: showForm
function showForm(&$dbi, &$request, $args)
{
$action = $request->getPostURL();
$hiddenfield = HiddenInputs($request->getArgs(), '', array('action', 'page', 's', 'direction'));
$pagefilter = HTML::input(array('name' => 'page', 'value' => $args['page'], 'title' => _("Search only in these pages. With autocompletion."), 'class' => 'dropdown', 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'false', 'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'), '');
$query = HTML::input(array('name' => 's', 'value' => $args['s'], 'title' => _("Filter by this link. These are pagenames. With autocompletion."), 'class' => 'dropdown', 'acdropdown' => 'true', 'autocomplete_complete' => 'true', 'autocomplete_matchsubstring' => 'true', 'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'), '');
$dirsign_switch = JavaScript("\nfunction dirsign_switch() {\n var d = document.getElementById('dirsign')\n d.innerHTML = (d.innerHTML == ' => ') ? ' <= ' : ' => '\n}\n");
$dirsign = " => ";
$in = $out = array('name' => 'direction', 'type' => 'radio', 'onChange' => 'dirsign_switch()');
$out['value'] = 'out';
$out['id'] = 'dir_out';
if ($args['direction'] == 'out') {
$out['checked'] = 'checked';
}
$in['value'] = 'in';
$in['id'] = 'dir_in';
if ($args['direction'] == 'in') {
$in['checked'] = 'checked';
$dirsign = " <= ";
}
$direction = HTML(HTML::input($out), HTML::label(array('for' => 'dir_out'), _("outgoing")), HTML::input($in), HTML::label(array('for' => 'dir_in'), _("incoming")));
/*
$direction = HTML::select(array('name'=>'direction',
'onChange' => 'dirsign_switch()'));
$out = array('value' => 'out');
if ($args['direction']=='out') $out['selected'] = 'selected';
$in = array('value' => 'in');
if ($args['direction']=='in') {
$in['selected'] = 'selected';
$dirsign = " <= ";
}
$direction->pushContent(HTML::option($out, _("outgoing")));
$direction->pushContent(HTML::option($in, _("incoming")));
*/
$submit = Button('submit:search', _("LinkSearch"), false);
$instructions = _("Search in pages for links with the matching name.");
$form = HTML::form(array('action' => $action, 'method' => 'GET', 'accept-charset' => $GLOBALS['charset']), $dirsign_switch, $hiddenfield, $instructions, HTML::br(), $pagefilter, HTML::strong(HTML::tt(array('id' => 'dirsign'), $dirsign)), $query, HTML::raw(' '), $direction, HTML::raw(' '), $submit);
return $form;
}
示例9: _do_syncwiki
function _do_syncwiki(&$request, $args)
{
global $charset;
longer_timeout(240);
if (!function_exists('wiki_xmlrpc_post')) {
include_once "lib/XmlRpcClient.php";
}
$userid = $request->_user->_userid;
$dbh = $request->getDbh();
$merge_point = $dbh->get('mergepoint');
if (empty($merge_point)) {
$page = $dbh->getPage("ReleaseNotes");
// this is usually the latest official page
$last = $page->getCurrentRevision(false);
$merge_point = $last->get("mtime");
// for testing: 1160396075
$dbh->set('mergepoint', $merge_point);
}
//TODO: remote auth, set session cookie
$pagelist = wiki_xmlrpc_post('wiki.getRecentChanges', iso8601_encode($merge_point, 1), $args['url'], $args);
$html = HTML();
//$html->pushContent(HTML::div(HTML::em("check RPC2 interface...")));
if (gettype($pagelist) === "array") {
//$request->_deferredPageChangeNotification = array();
$request->discardOutput();
StartLoadDump($request, _("Syncing this PhpWiki"));
PrintXML(HTML::strong(fmt("Download all externally changed sources.")));
echo "<br />\n";
PrintXML(fmt("Retrieving from external url %s wiki.getRecentChanges(%s)...", $args['url'], iso8601_encode($merge_point, 1)));
echo "<br />\n";
$ouriter = $dbh->mostRecent(array('since' => $merge_point));
//$ol = HTML::ol();
$done = array();
foreach ($pagelist as $ext) {
$reaction = _("<unknown>");
// compare existance and dates with local page
$extdate = iso8601_decode($ext['lastModified']->scalar, 1);
// TODO: urldecode ???
$name = utf8_decode($ext['name']);
$our = $dbh->getPage($name);
$done[$name] = 1;
$ourrev = $our->getCurrentRevision(false);
$rel = '<=>';
if (!$our->exists()) {
// we might have deleted or moved it on purpose?
// check date of latest revision if there's one, and > mergepoint
if ($ourrev->getVersion() > 1 and $ourrev->get('mtime') > $merge_point) {
// our was deleted after sync, and changed after last sync.
$this->_addConflict('delete', $args, $our, $extdate);
$reaction = _(" skipped") . " (" . "locally deleted or moved" . ")";
} else {
$reaction = $this->_import($args, $our, $extdate);
}
} else {
$ourdate = $ourrev->get('mtime');
if ($extdate > $ourdate and $ourdate < $merge_point) {
$rel = '>';
$reaction = $this->_import($args, $our, $extdate);
} elseif ($extdate > $ourdate and $ourdate >= $merge_point) {
$rel = '>';
// our is older then external but newer than last sync
$reaction = $this->_addConflict('import', $args, $our, $extdate);
} elseif ($extdate < $ourdate and $extdate < $merge_point) {
$rel = '>';
$reaction = $this->_export($args, $our);
} elseif ($extdate < $ourdate and $extdate >= $merge_point) {
$rel = '>';
// our is newer and external is also newer
$reaction = $this->_addConflict('export', $args, $our, $extdate);
} else {
$rel = '==';
$reaction = _("same date");
}
}
/*$ol->pushContent(HTML::li(HTML::strong($name)," ",
$extdate,"<=>",$ourdate," ",
HTML::strong($reaction))); */
PrintXML(HTML::strong($name), " ", $extdate, " {$rel} ", $ourdate, " ", HTML::strong($reaction), HTML::br());
$request->chunkOutput();
}
//$html->pushContent($ol);
} else {
$html->pushContent("xmlrpc error: wiki.getRecentChanges returned " . "(" . gettype($pagelist) . ") " . $pagelist);
trigger_error("xmlrpc error: wiki.getRecentChanges returned " . "(" . gettype($pagelist) . ") " . $pagelist, E_USER_WARNING);
EndLoadDump($request);
return $this->error($html);
}
if (empty($args['noexport'])) {
PrintXML(HTML::strong(fmt("Now upload all locally newer pages.")));
echo "<br />\n";
PrintXML(fmt("Checking all local pages newer than %s...", iso8601_encode($merge_point, 1)));
echo "<br />\n";
while ($our = $ouriter->next()) {
$name = $our->getName();
if ($done[$name]) {
continue;
}
$reaction = _(" skipped");
$ext = wiki_xmlrpc_post('wiki.getPageInfo', $name, $args['url']);
if (is_array($ext)) {
//.........这里部分代码省略.........
示例10: setaclForm
function setaclForm(&$header, $post_args, $pagehash)
{
$acl = $post_args['acl'];
//FIXME: find intersection of all pages perms, not just from the last pagename
$pages = array();
foreach ($pagehash as $name => $checked) {
if ($checked) {
$pages[] = $name;
}
}
$perm_tree = pagePermissions($name);
$table = pagePermissionsAclFormat($perm_tree, !empty($pages));
$header->pushContent(HTML::strong(_("Selected Pages: ")), HTML::tt(join(', ', $pages)), HTML::br());
$first_page = $GLOBALS['request']->_dbi->getPage($name);
$owner = $first_page->getOwner();
list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
//if (DEBUG) $header->pushContent(HTML::pre("Permission tree for $name:\n",print_r($perm_tree,true)));
if ($type == 'inherited') {
$type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
} elseif ($type == 'page') {
$type = _("individual page permission");
} elseif ($type == 'default') {
$type = _("default page permission");
}
$header->pushContent(HTML::strong(_("Type") . ': '), HTML::tt($type), HTML::br());
$header->pushContent(HTML::strong(_("ACL") . ': '), HTML::tt($perm->asAclLines()), HTML::br());
$header->pushContent(HTML::p(HTML::strong(_("Description") . ': '), _("Selected Grant checkboxes allow access, unselected checkboxes deny access."), _("To ignore delete the line."), _("To add check 'Add' near the dropdown list.")));
$header->pushContent($table);
//
// display array of checkboxes for existing perms
// and a dropdown for user/group to add perms.
// disabled if inherited,
// checkbox to disable inheritance,
// another checkbox to progate new permissions to all childs (if there exist some)
//Todo:
// warn if more pages are selected and they have different perms
//$header->pushContent(HTML::input(array('name' => 'admin_setacl[acl]',
// 'value' => $post_args['acl'])));
$header->pushContent(HTML::br());
if (!empty($pages) and defined('EXPERIMENTAL') and EXPERIMENTAL) {
$checkbox = HTML::input(array('type' => 'checkbox', 'name' => 'admin_setacl[updatechildren]', 'value' => 1));
if (!empty($post_args['updatechildren'])) {
$checkbox->setAttr('checked', 'checked');
}
$header->pushContent($checkbox, _("Propagate new permissions to all subpages?"), HTML::raw(" "), HTML::em(_("(disable individual page permissions, enable inheritance)?")), HTML::br(), HTML::em(_("(Currently not working)")));
}
$header->pushContent(HTML::hr());
return $header;
}
示例11: usuarioEdit
public function usuarioEdit($usuario_id, $usuario_tipo)
{
$getDataDB = new DB();
$login = new ModelLogin();
$image = new ModelImage();
switch ($usuario_tipo) {
case "musico":
if (isset($_POST['form_edit_account'])) {
if (empty($_POST['usuario_nombre'])) {
echo MESSAGE_FORM_NOMBRE_EMPTY;
echo HTML::br(2);
echo "<a href='javascript:history.back()'> Volver Atrás</a>";
} elseif (!preg_match('/^[a-z\\d]{2,64}$/i', $_POST['usuario_telefono'])) {
echo MESSAGE_FORM_TELEFONO_EMPTY;
echo HTML::br(2);
echo "<a href='javascript:history.back()'> Volver Atrás</a>";
} elseif (strlen($_POST['usuario_telefono']) != 9) {
echo MESSAGE_FORM_TELEFONO_INVALID;
echo HTML::br(2);
echo "<a href='javascript:history.back()'> Volver Atrás</a>";
} elseif ($_POST['usuario_idioma'] == "") {
$_POST['usuario_idioma'] == $login->getUserDataCampo($usuario_id, "usuario_idioma");
} elseif ($_POST['usuario_idioma'] != "ca" && $_POST['usuario_idioma'] != "en" && $_POST['usuario_idioma'] != "es") {
echo MESSAGE_FORM_IDIOMA;
echo HTML::br(2);
echo "<a href='javascript:history.back()'> Volver Atrás</a>";
} elseif ($_POST['usuario_idioma'] != "ca" && $_POST['usuario_idioma'] != "en" && $_POST['usuario_idioma'] != "es") {
echo MESSAGE_FORM_IDIOMA;
echo HTML::br(2);
echo "<a href='javascript:history.back()'> Volver Atrás</a>";
} else {
$query_mod_account = DB::connect()->prepare("UPDATE `uqfhhbcn_whymusic`.`wm_usuarios` SET `usuario_nombre` = :usuario_nombre,\n `usuario_telefono` = :usuario_telefono,\n `usuario_idioma` = :usuario_idioma,\n `usuario_descripcion` = :usuario_descripcion,\n `estilo_id` = :estilo_id WHERE `wm_usuarios`.`usuario_id` = :usuario_id;");
$query_mod_account->bindValue(':usuario_id', $usuario_id, PDO::PARAM_STR);
$query_mod_account->bindValue(':usuario_nombre', $_POST['usuario_nombre'], PDO::PARAM_STR);
$query_mod_account->bindValue(':usuario_idioma', $_POST['usuario_idioma'], PDO::PARAM_STR);
$query_mod_account->bindValue(':usuario_telefono', $_POST['usuario_telefono'], PDO::PARAM_STR);
$query_mod_account->bindValue(':usuario_descripcion', $_POST['usuario_descripcion'], PDO::PARAM_STR);
$query_mod_account->bindValue(':estilo_id', $_POST['estilo_nombre'], PDO::PARAM_STR);
$query_mod_account->execute();
if ($query_mod_account) {
echo MESSAGE_CORRECT_MOD;
if ($login->getTypeOfUser() == "administrador") {
ROUTER::redirect_to_action("admin/admin", 2);
} else {
ROUTER::redirect_to_action("account/edit", 2);
}
} else {
echo MESSAGE_ERROR_SQL;
echo HTML::br(2);
echo "<a href='javascript:history.back()'> Volver Atrás</a>";
}
}
} else {
echo HTML::title("h3", "Editar foto de perfil");
echo HTML::open_form(ROUTER::create_action_url("account/edit"), "POST", "fileToUpload", array("enctype" => "multipart/form-data"));
echo HTML::label("fileToUpload", "Sube tu foto");
echo HTML::input("file", "fileToUpload", null, array("id" => "fileToUpload"));
echo HTML::br(1);
echo HTML::input("submit", "usuario_foto", "Subir foto");
echo HTML::close_form();
echo HTML::open_form(ROUTER::create_action_url('account/edit'), "POST", "form_edit_account");
/*Guarrada provisional*/
$_SESSION['usuario_id_edit'] = $login->getUserDataCampo($usuario_id, "usuario_id");
$_SESSION['usuario_tipo_edit'] = $login->getUserDataCampo($usuario_id, "usuario_tipo");
/*Fin de la gurrada*/
echo HTML::title("h3", "Editar foto de perfil");
echo HTML::open_form(ROUTER::create_action_url("account/edit"), "POST", "usuario_foto", array("enctype" => "multipart/form-data"));
echo HTML::label("usuario_foto", "Sube tu foto");
echo HTML::input("file", "fileToUpload", null, array("id" => "fileToUpload"));
echo HTML::input("submit", "usuario_foto", "Subir foto");
echo HTML::close_form();
echo HTML::label("usuario_nombre", WORDING_NOMBRE_MUSICO);
echo HTML::input("text", "usuario_nombre", $login->getUserDataCampo($usuario_id, "usuario_nombre"), array("placeholder" => "Su nombre"));
echo HTML::br(2);
echo HTML::label("usuario_idioma", WORDING_IDIOMA);
echo HTML::select("usuario_idioma", array("Idioma por defecto" => $login->getUserDataCampo($usuario_id, 'usuario_idioma'), "Inglés" => "en", "Castellano" => "es", "Catalán" => "ca"));
echo HTML::br(2);
echo HTML::label("usuario_telefono", WORDING_TELEFON);
echo HTML::input("text", "usuario_telefono", $login->getUserDataCampo($usuario_id, "usuario_telefono"), array("placeholder" => "9XXXXXXXX"));
echo HTML::br(2);
echo HTML::label("usuario_descripcion", "Descripción grupo:");
echo HTML::textArea("4", "50", $login->getUserDataCampo($usuario_id, "usuario_descripcion"), "usuario_descripcion");
echo HTML::br(2);
echo HTML::label("estilo_nombre", "Estilo de música:");
echo HTML::selectArray("estilo_nombre", $getDataDB->getFieldSQL("wm_estilo", "estilo_nombre , estilo_id", ""));
echo HTML::br(2);
echo HTML::button_HTML5("submit", BUTTON_MOD_DATA, "form_edit_account");
echo HTML::close_form();
}
break;
case "local":
if (isset($_POST['form_edit_account'])) {
if (empty($_POST['usuario_nombre'])) {
echo MESSAGE_FORM_NOMBRE_EMPTY;
echo HTML::br(2);
echo "<a href='javascript:history.back()'> Volver Atrás</a>";
} elseif (!preg_match('/^[a-z\\d]{2,64}$/i', $_POST['usuario_telefono'])) {
echo MESSAGE_FORM_TELEFONO_EMPTY;
echo HTML::br(2);
echo "<a href='javascript:history.back()'> Volver Atrás</a>";
//.........这里部分代码省略.........
示例12: run
function run($dbi, $argstr, &$request, $basepage)
{
$this->allowed_extensions = explode("\n", "7z\navi\nbmp\nbz2\nc\ncfg\ndiff\ndoc\ndocx\nflv\ngif\nh\nics\nini\njpeg\njpg\nkmz\nmp3\nodg\nodp\nods\nodt\nogg\npatch\npdf\npng\nppt\npptx\nrar\nsvg\ntar\ntar.gz\ntxt\nxls\nxlsx\nxml\nxsd\nzip");
$this->disallowed_extensions = explode("\n", "ad[ep]\nasd\nba[st]\nchm\ncmd\ncom\ncgi\ncpl\ncrt\ndll\neml\nexe\nhlp\nhta\nin[fs]\nisp\njse?\nlnk\nmd[betw]\nms[cipt]\nnws\nocx\nops\npcd\np[ir]f\nphp\\d?\nphtml\npl\npy\nreg\nsc[frt]\nsh[bsm]?\nswf\nurl\nvb[esx]?\nvxd\nws[cfh]");
//removed "\{[[:xdigit:]]{8}(?:-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}\}"
$args = $this->getArgs($argstr, $request);
extract($args);
$file_dir = getUploadFilePath();
$file_dir .= "/";
$form = HTML::form(array('action' => $request->getPostURL(), 'enctype' => 'multipart/form-data', 'method' => 'post'));
$contents = HTML::div(array('class' => 'wikiaction'));
$contents->pushContent(HTML::input(array('type' => 'hidden', 'name' => 'MAX_FILE_SIZE', 'value' => MAX_UPLOAD_SIZE)));
$contents->pushContent(HTML::input(array('name' => 'userfile', 'type' => 'file', 'size' => $size)));
if ($mode == 'edit') {
$contents->pushContent(HTML::input(array('name' => 'action', 'type' => 'hidden', 'value' => 'edit')));
$contents->pushContent(HTML::raw(" "));
$contents->pushContent(HTML::input(array('value' => _("Upload"), 'name' => 'edit[upload]', 'type' => 'submit')));
} else {
$contents->pushContent(HTML::raw(" "));
$contents->pushContent(HTML::input(array('value' => _("Upload"), 'type' => 'submit')));
}
$form->pushContent($contents);
$message = HTML();
if ($request->isPost() and $this->only_authenticated) {
// Make sure that the user is logged in.
$user = $request->getUser();
if (!$user->isAuthenticated()) {
if (defined('FUSIONFORGE') and FUSIONFORGE) {
$message->pushContent(HTML::div(array('class' => 'error'), HTML::p(_("You cannot upload files.")), HTML::ul(HTML::li(_("Check you are logged in.")), HTML::li(_("Check you are in the right project.")), HTML::li(_("Check you are a member of the current project.")))));
} else {
$message->pushContent(HTML::div(array('class' => 'error'), HTML::p(_("ACCESS DENIED: You must log in to upload files."))));
}
$result = HTML();
$result->pushContent($form);
$result->pushContent($message);
return $result;
}
}
$userfile = $request->getUploadedFile('userfile');
if ($userfile) {
$userfile_name = $userfile->getName();
$userfile_name = trim(basename($userfile_name));
if (UPLOAD_USERDIR) {
$file_dir .= $request->_user->_userid;
if (!file_exists($file_dir)) {
mkdir($file_dir, 0775);
}
$file_dir .= "/";
$u_userfile = $request->_user->_userid . "/" . $userfile_name;
} else {
$u_userfile = $userfile_name;
}
$u_userfile = preg_replace("/ /", "%20", $u_userfile);
$userfile_tmpname = $userfile->getTmpName();
$err_header = HTML::div(array('class' => 'error'), HTML::p(fmt("ERROR uploading '%s'", $userfile_name)));
if (preg_match("/(\\." . join("|\\.", $this->disallowed_extensions) . ")(\\.|\$)/i", $userfile_name)) {
$message->pushContent($err_header);
$message->pushContent(HTML::p(fmt("Files with extension %s are not allowed.", join(", ", $this->disallowed_extensions))));
} elseif (!DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS and !preg_match("/(\\." . join("|\\.", $this->allowed_extensions) . ")\$/i", $userfile_name)) {
$message->pushContent($err_header);
$message->pushContent(HTML::p(fmt("Only files with the extension %s are allowed.", join(", ", $this->allowed_extensions))));
} elseif (preg_match("/[^._a-zA-Z0-9- ]/", strip_accents($userfile_name))) {
$message->pushContent($err_header);
$message->pushContent(HTML::p(_("Invalid filename. File names may only contain alphanumeric characters and dot, underscore, space or dash.")));
} elseif (file_exists($file_dir . $userfile_name)) {
$message->pushContent($err_header);
$message->pushContent(HTML::p(fmt("There is already a file with name %s uploaded.", $u_userfile)));
} elseif ($userfile->getSize() > MAX_UPLOAD_SIZE) {
$message->pushContent($err_header);
$message->pushContent(HTML::p(_("Sorry but this file is too big.")));
} elseif (move_uploaded_file($userfile_tmpname, $file_dir . $userfile_name) or IsWindows() and rename($userfile_tmpname, $file_dir . $userfile_name)) {
$interwiki = new PageType_interwikimap();
$link = $interwiki->link("Upload:{$u_userfile}");
$message->pushContent(HTML::div(array('class' => 'feedback'), HTML::p(_("File successfully uploaded.")), HTML::p($link)));
// the upload was a success and we need to mark this event in the "upload log"
if ($logfile) {
$upload_log = $file_dir . basename($logfile);
$this->log($userfile, $upload_log, $message);
}
if ($autolink) {
require_once "lib/loadsave.php";
$pagehandle = $dbi->getPage($page);
if ($pagehandle->exists()) {
// don't replace default contents
$current = $pagehandle->getCurrentRevision();
$version = $current->getVersion();
$text = $current->getPackedContent();
$newtext = $text . "\n* Upload:{$u_userfile}";
// don't inline images
$meta = $current->_data;
$meta['summary'] = sprintf(_("uploaded %s"), $u_userfile);
$pagehandle->save($newtext, $version + 1, $meta);
}
}
} else {
$message->pushContent($err_header);
$message->pushContent(HTML::br(), _("Uploading failed."), HTML::br());
}
} else {
$message->pushContent(HTML::br(), _("No file selected. Please select one."), HTML::br());
//.........这里部分代码省略.........
示例13: run
function run($dbi, $argstr, &$request, $basepage)
{
global $WikiTheme;
//$this->_request = & $request;
//$this->_dbi = & $dbi;
$user = $request->getUser();
//FIXME: fails on test with DumpHtml:RateIt
if (!is_object($user)) {
return HTML::raw('');
}
$this->userid = $user->getId();
if (!$this->userid) {
return HTML::raw('');
}
$args = $this->getArgs($argstr, $request);
$this->dimension = $args['dimension'];
$this->imgPrefix = $args['imgPrefix'];
if ($this->dimension == '') {
$this->dimension = 0;
$args['dimension'] = 0;
}
if ($args['pagename']) {
// Expand relative page names.
$page = new WikiPageName($args['pagename'], $basepage);
$args['pagename'] = $page->name;
}
if (empty($args['pagename'])) {
return $this->error(_("no page specified"));
}
$this->pagename = $args['pagename'];
$rdbi = RatingsDb::getTheRatingsDb();
$this->_rdbi =& $rdbi;
if ($args['mode'] === 'add') {
//if (!$user->isSignedIn()) return $this->error(_("You must sign in"));
$this->rating = $request->getArg('rating');
$rdbi->addRating($this->rating, $this->userid, $this->pagename, $this->dimension);
$this->displayActionImg('add');
} elseif ($args['mode'] === 'delete') {
//if (!$user->isSignedIn()) return $this->error(_("You must sign in"));
$rdbi->deleteRating($this->userid, $this->pagename, $this->dimension);
unset($this->rating);
$this->displayActionImg('delete');
} elseif (!$args['show']) {
return $this->RatingWidgetHtml($args['pagename'], $args['version'], $args['imgPrefix'], $args['dimension'], $args['small']);
} else {
//if (!$user->isSignedIn()) return $this->error(_("You must sign in"));
//extract($args);
$this->rating = $rdbi->getRating($this->userid, $this->pagename, $this->dimension);
$this->avg = $rdbi->getAvg($this->pagename, $this->dimension);
$this->numusers = $rdbi->getNumUsers($this->pagename, $this->dimension);
// Update this text on rateit in javascript. needed: NumUsers, Avg
$html = HTML::div(HTML::span(array('class' => 'rateit'), sprintf(_("Rating: %.1f (%d votes)"), $this->avg, $this->numusers)));
if ($args['show'] == 'top') {
if (ENABLE_PAGE_PUBLIC) {
$page = $dbi->getPage($this->pagename);
if ($page->get('public')) {
$html->setAttr('class', "public");
}
}
$html->setAttr('id', "rateit-widget-top");
$html->pushContent(HTML::br(), $this->RatingWidgetHtml($args['pagename'], $args['version'], $args['imgPrefix'], $args['dimension'], $args['small']));
} elseif ($args['show'] == 'text') {
if (!$WikiTheme->DUMP_MODE) {
$html->pushContent(HTML::br(), sprintf(_("Your rating was %.1f"), $this->rating));
}
} elseif ($this->rating) {
$html->pushContent(HTML::br(), sprintf(_("Your rating was %.1f"), $this->rating));
} else {
$this->pred = $rdbi->getPrediction($this->userid, $this->pagename, $this->dimension);
if (is_string($this->pred)) {
$html->pushContent(HTML::br(), sprintf(_("Prediction: %s"), $this->pred));
} elseif ($this->pred) {
$html->pushContent(HTML::br(), sprintf(_("Prediction: %.1f"), $this->pred));
}
}
//$html->pushContent(HTML::p());
//$html->pushContent(HTML::em("(Experimental: This might be entirely bogus data)"));
return $html;
}
}
示例14: ModelLogin
<?php
$login = new ModelLogin();
$concert = new Concert();
foreach ($concert->getConciertoAll(null, "aceptado") as $row) {
echo HTML::open_div(array("class" => "col-lg-6"));
echo HTML::title("h3", "Concierto de " . $login->getUserDataCampo($row['musico_id'], "usuario_nombre") . " en " . $login->getUserDataCampo($row['local_id'], "usuario_nombre"));
echo HTML::label("concierto_fecha", "Fecha:");
echo $row['concierto_fecha'];
echo HTML::br(2);
echo HTML::label("concierto_precio", "Precio entrada:");
echo $row['concierto_precio'] . "€";
echo HTML::br(2);
echo HTML::label("concierto_duracion", "Duración concierto:");
echo $row['concierto_duracion'] . " min";
echo HTML::br(2);
echo HTML::label("concierto_asistentes", "Aforo:");
echo $row['concierto_asistentes'];
echo HTML::close_div();
}
示例15: getDocumentPath
function getDocumentPath($id, $group_id, $referrer_id = null)
{
$parents = array();
$html = HTML();
$hp =& Codendi_HTMLPurifier::instance();
$item_factory =& $this->_getItemFactory($group_id);
$item =& $item_factory->getItemFromDb($id);
$reference =& $item;
if ($reference && $referrer_id != $id) {
while ($item && $item->getParentId() != 0) {
$item =& $item_factory->getItemFromDb($item->getParentId());
$parents[] = array('id' => $item->getId(), 'title' => $item->getTitle());
}
$parents = array_reverse($parents);
$item_url = '/plugins/docman/?group_id=' . $group_id . '&sort_update_date=0&action=show&id=';
foreach ($parents as $parent) {
$html->pushContent(HTML::a(array('href' => $item_url . $parent['id'], 'target' => '_blank'), HTML::strong($parent['title'])));
$html->pushContent(' / ');
}
$md_uri = '/plugins/docman/?group_id=' . $group_id . '&action=details&id=' . $id;
//Add a pen icon linked to document properties.
$pen_icon = HTML::a(array('href' => $md_uri), HTML::img(array('src' => util_get_image_theme("ic/edit.png"))));
$html->pushContent(HTML::a(array('href' => $item_url . $reference->getId()), HTML::strong($reference->getTitle())));
$html->pushContent($pen_icon);
$html->pushContent(HTML::br());
}
return $html;
}