本文整理汇总了PHP中mosMakeHtmlSafe函数的典型用法代码示例。如果您正苦于以下问题:PHP mosMakeHtmlSafe函数的具体用法?PHP mosMakeHtmlSafe怎么用?PHP mosMakeHtmlSafe使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mosMakeHtmlSafe函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editPoll
public static function editPoll(&$row, &$options, &$lists)
{
mosMakeHtmlSafe($row, ENT_QUOTES);
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// do field validation
if (form.title.value == "") {
alert( "Poll must have a title" );
} else if( isNaN( parseInt( form.lag.value ) ) ) {
alert( "Poll must have a non-zero lag time" );
//} else if (form.menu.options.value == ""){
// alert( "Poll must have pages." );
//} else if (form.adminForm.textfieldcheck.value == 0){
// alert( "Poll must have options." );
} else {
submitform( pressbutton );
}
}
</script>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th>
Poll:
<small>
<?php
echo $row->id ? 'Edit' : 'New';
?>
</small>
</th>
</tr>
</table>
<table class="adminform">
<tr>
<th colspan="4">
Details
</th>
</tr>
<tr>
<td width="10%">
Title:
</td>
<td>
<input class="inputbox" type="text" name="title" size="60" value="<?php
echo $row->title;
?>
" />
</td>
<td width="20px">
</td>
<td width="100%" rowspan="20" valign="top">
Show on menu items:
<br />
<?php
echo $lists['select'];
?>
</td>
</tr>
<tr>
<td>
Lag:
</td>
<td>
<input class="inputbox" type="text" name="lag" size="10" value="<?php
echo $row->lag;
?>
" /> (seconds between votes)
</td>
</tr>
<tr>
<td valign="top">
Published:
</td>
<td>
<?php
echo $lists['published'];
?>
</td>
</tr>
<tr>
<td colspan="3">
Options:
</td>
</tr>
<?php
for ($i = 0, $n = count($options); $i < $n; $i++) {
?>
<tr>
<td>
<?php
echo $i + 1;
?>
//.........这里部分代码省略.........
示例2: edit
static function edit(&$row, $section, &$lists, $redirect)
{
global $my, $mosConfig_live_site, $mainframe, $option, $doc;
// for J 1.6
$doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/booklibrary.css');
$doc->addScript($mosConfig_live_site . '/components/com_booklibrary/includes/functions.js');
$aa = $row->id ? _BOOKLIBRARY_HEADER_EDIT : _BOOKLIBRARY_HEADER_ADD;
$a = $aa . " " . _BOOKLIBRARY_CATEGORY . " " . $row->name;
$html = '<div class="book_manager_caption"><img src="./components/com_booklibrary/images/cfg.png"/>' . $a . '</div>';
$app = JFactory::getApplication();
$app->JComponentTitle = $html;
if ($row->image == "") {
$row->image = 'blank.png';
}
mosMakeHtmlSafe($row, ENT_QUOTES, 'description');
?>
<script language="javascript" type="text/javascript">
Joomla.submitbutton = function(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
/* [inserted by]: Wonderer */
alias = document.getElementById('alias'); alias = trim(alias.value);
cat_name = document.getElementById('cat_name'); cat_name = trim(cat_name.value);
title = document.getElementById('title'); title.value = cat_name;
if ( alias == '' ) { alert( "<?php
echo _BOOKLIBRARY_ADMIN_INFOTEXT_CAT_CHECK_ERR_ALIAS;
?>
" );return;}
if ( cat_name == '' ) { alert( "<?php
echo _BOOKLIBRARY_ADMIN_INFOTEXT_CAT_CHECK_ERR_NAME;
?>
" );return;}
if ( title == '' ) { alert( "<?php
echo _BOOKLIBRARY_ADMIN_INFOTEXT_CAT_CHECK_ERR_TITLE;
?>
" );return;}
// --
if ( form.name.value == "" ) {
alert('<?php
echo _BOOKLIBRARY_DML_CAT_MUST_SELECT_NAME;
?>
');
} else {
<?php
getEditorContents('editor1', 'description');
?>
submitform(pressbutton);
}
}
function trim(string)
{
return string.replace(/(^\s+)|(\s+$)/g, "");
}
</script>
<?php
global $database;
//my !!!!! -------- langdescription ----------------------------------------------------------------------------------------------
$lg = JFactory::getLanguage();
$installed = $lg->getKnownLanguages();
$languages_row[] = mosHTML::makeOption('*', 'All');
foreach ($installed as $installang) {
$langname = $installang['name'];
$languages_row[] = mosHTML::makeOption($langname, $langname);
}
$langlistshow = mosHTML::selectList($languages_row, 'langshow', 'class="inputbox" size="1"', 'value', 'text', $row->langshow);
$lists['langshow'] = $langlistshow;
//end of my langdecription --------- !!!! ---------------------------------------------------------------------------------------
?>
<form id="adminForm" action="index.php" method="post" name="adminForm">
<table width="100%" class="my_table bl_admin_categories_category">
<tr>
<td valign="top">
<table class="adminform my_table bl_admin_edit_category" width="100%">
<tr>
<th colspan="3"><h1><?php
echo _BOOKLIBRARY_CATEGORIES__DETAILS;
?>
</h1></th>
</tr>
<tr>
<td width="20%"><?php
echo "ID";
?>
:</td>
<td colspan="2" width="80%">
<input readonly="readonly" class="text_area id" type="text" name="catid" id="catid" value="<?php
echo $row->id;
?>
" size="50" maxlength="50" title="" />
</td>
//.........这里部分代码省略.........
示例3: showMenusections
//.........这里部分代码省略.........
<th width="5%">
Published
</th>
<th colspan="2" width="5%">
Reorder
</th>
<th width="2%">
Order
</th>
<th width="1%">
<a href="javascript: saveorder( <?php
echo count($rows) - 1;
?>
)"><img src="images/filesave.png" border="0" width="16" height="16" alt="Save Order" /></a>
</th>
<th width="10%">
Access
</th>
<th>
Itemid
</th>
<th width="35%" align="left">
Type
</th>
<th>
CID
</th>
</tr>
<?php
$k = 0;
$i = 0;
$n = count($rows);
foreach ($rows as $row) {
mosMakeHtmlSafe($row, ENT_QUOTES, 'treename');
$access = mosCommonHTML::AccessProcessing($row, $i);
$checked = mosCommonHTML::CheckedOutProcessing($row, $i);
$published = mosCommonHTML::PublishedProcessing($row, $i);
?>
<tr class="<?php
echo "row{$k}";
?>
">
<td>
<?php
echo $i + 1 + $pageNav->limitstart;
?>
</td>
<td>
<?php
echo $checked;
?>
</td>
<td nowrap="nowrap">
<?php
if ($row->checked_out && $row->checked_out != $my->id) {
echo $row->treename;
} else {
$link = 'index2.php?option=com_menus&menutype=' . $row->menutype . '&task=edit&id=' . $row->id . '&hidemainmenu=1';
?>
<a href="<?php
echo $link;
?>
">
<?php
echo $row->treename;
?>
示例4: userSave
function userSave($option, $uid)
{
global $database, $my, $mosConfig_frontend_userparams;
$user_id = intval(mosGetParam($_POST, 'id', 0));
// do some security checks
if ($uid == 0 || $user_id == 0 || $user_id != $uid) {
mosNotAuth();
return;
}
// simple spoof check security
josSpoofCheck();
$row = new mosUser($database);
$row->load((int) $user_id);
$orig_password = $row->password;
$orig_username = $row->username;
if (!$row->bind($_POST, 'gid usertype')) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
$row->name = trim($row->name);
$row->email = trim($row->email);
$row->username = trim($row->username);
mosMakeHtmlSafe($row);
if (isset($_POST['password']) && $_POST['password'] != '') {
if (isset($_POST['verifyPass']) && $_POST['verifyPass'] == $_POST['password']) {
$row->password = trim($row->password);
$salt = mosMakePassword(16);
$crypt = md5($row->password . $salt);
$row->password = $crypt . ':' . $salt;
} else {
echo "<script> alert(\"" . addslashes(_PASS_MATCH) . "\"); window.history.go(-1); </script>\n";
exit;
}
} else {
// Restore 'original password'
$row->password = $orig_password;
}
if ($mosConfig_frontend_userparams == '1' || $mosConfig_frontend_userparams == 1 || $mosConfig_frontend_userparams == NULL) {
// save params
$params = mosGetParam($_POST, 'params', '');
if (is_array($params)) {
$txt = array();
foreach ($params as $k => $v) {
$txt[] = "{$k}={$v}";
}
$row->params = implode("\n", $txt);
}
}
if (!$row->check()) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
if (!$row->store()) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
// check if username has been changed
if ($orig_username != $row->username) {
// change username value in session table
$query = "UPDATE #__session" . "\n SET username = " . $database->Quote($row->username) . "\n WHERE username = " . $database->Quote($orig_username) . "\n AND userid = " . (int) $my->id . "\n AND gid = " . (int) $my->gid . "\n AND guest = 0";
$database->setQuery($query);
$database->query();
}
mosRedirect('index.php', _USER_DETAILS_SAVE);
}
示例5: showMambots
/**
* Writes a list of the defined modules
* @param array An array of category objects
*/
function showMambots(&$rows, $client, &$pageNav, $option, &$lists, $search)
{
global $my;
mosCommonHTML::loadOverlib();
?>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th class="modules">
Administrar Plugins <small><small>[ <?php
echo $client == 'admin' ? 'Administração' : 'Site';
?>
]</small></small>
</th>
<td>
Filtro:
</td>
<td>
<input type="text" name="search" value="<?php
echo htmlspecialchars($search);
?>
" class="text_area" onChange="document.adminForm.submit();" />
</td>
<td width="right">
<?php
echo $lists['type'];
?>
</td>
</tr>
</table>
<table class="adminlist">
<tr>
<th width="20">nº</th>
<th width="20">
<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php
echo count($rows);
?>
);" />
</th>
<th class="title">
Nome do Plugin
</th>
<th nowrap="nowrap" width="10%">
Publicado
</th>
<th colspan="2" nowrap="nowrap" width="5%">
Reordenar
</th>
<th width="2%">
Ordem
</th>
<th width="1%">
<a href="javascript: saveorder( <?php
echo count($rows) - 1;
?>
)"><img src="images/filesave.png" border="0" width="16" height="16" alt="Salvar Ordem" /></a>
</th>
<th nowrap="nowrap" width="10%">
Acessos
</th>
<th nowrap="nowrap" align="left" width="10%">
Tipo
</th>
<th nowrap="nowrap" align="left" width="10%">
Arquivo
</th>
</tr>
<?php
$k = 0;
for ($i = 0, $n = count($rows); $i < $n; $i++) {
$row =& $rows[$i];
mosMakeHtmlSafe($row);
$link = 'index2.php?option=com_mambots&client=' . $client . '&task=editA&hidemainmenu=1&id=' . $row->id;
$access = mosCommonHTML::AccessProcessing($row, $i);
$checked = mosCommonHTML::CheckedOutProcessing($row, $i);
$published = mosCommonHTML::PublishedProcessing($row, $i);
?>
<tr class="<?php
echo "row{$k}";
?>
">
<td align="right"><?php
echo $pageNav->rowNumber($i);
?>
</td>
<td>
<?php
echo $checked;
?>
</td>
<td>
<?php
if ($row->checked_out && $row->checked_out != $my->id) {
echo $row->name;
//.........这里部分代码省略.........
示例6: editComment
/**
* @param option
* @param rows - article id, or 0 for new comment
* @param clist - article list to enable comments to be moved
* @param puplist - yes/no publish selection box
* @return article comments to edit/move or new article comments box
*/
function editComment($option, &$row, &$clist, &$puplist)
{
mosMakeHtmlSafe($row, ENT_QUOTES, 'comments');
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// validation
if (form.comments.value == ""){
alert( "<?php
echo T_('You must add a comment');
?>
" );
} else if (form.articleid.value == "0"){
alert( "<?php
echo T_('You must select a content item.');
?>
" );
} else {
submitform( pressbutton );
}
}
</script>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td width="100%"><span class="sectionname"><?php
echo $row->id ? 'Edit' : 'Add';
?>
<?php
echo T_('Comments');
?>
</span></td>
</tr>
</table>
<table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
<form action="index2.php" method="post" name="adminForm" id="adminForm">
<tr>
<td width="20%" align="right"><?php
echo T_('Name');
?>
:</td>
<td width="80%">
<input class="inputbox" type="text" name="name" size="50" maxlength="30" value="<?php
echo $row->name;
?>
" />
</td>
</tr>
<tr>
<td valign="top" align="right"><?php
echo T_('Comments');
?>
:</td>
<td>
<textarea class="inputbox" cols="50" rows="5" name="comments"><?php
echo $row->comments;
?>
</textarea>
</td>
</tr>
<tr>
<td valign="top" align="right"><?php
echo T_('Published');
?>
:</td>
<td>
<?php
echo $puplist;
?>
</td>
</tr>
<tr>
<td valign="top" align="right"><?php
echo T_('Content Item');
?>
:</td>
<td>
<?php
echo $clist;
?>
</td>
</tr>
//.........这里部分代码省略.........
示例7: editDocument
function editDocument(&$row, &$lists, $last, $created, &$params)
{
global $database, $mosConfig_offset, $mosConfig_live_site, $mosConfig_locale, $mosConfig_absolute_path;
$tabs = new mosTabs(1);
mosMakeHtmlSafe($row);
DOCMAN_Compat::calendarJS();
?>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
<script language="JavaScript" src="<?php
echo $mosConfig_live_site;
?>
/includes/js/overlib_mini.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// do field validation
<?php
dmHTML::docEditFieldsJS();
/* Include all edits at once */
?>
if ( $msg != "" ){
$msghdr = "<?php
echo _DML_ENTRY_ERRORS;
?>
";
$msghdr += '\n=================================';
alert( $msghdr+$msg+'\n' );
}else {
<?php
getEditorContents('editor1', 'dmdescription');
?>
submitform( pressbutton );
}
}
//--> end submitbutton
</script>
<style>
select option.label { background-color: #EEE; border: 1px solid #DDD; color : #333; }
</style>
<?php
$tmp = ($row->id ? _DML_EDIT : _DML_ADD) . ' ' . _DML_DOCUMENT;
dmHTML::adminHeading($tmp, 'documents');
?>
<form action="index2.php" method="post" name="adminForm" class="adminform" id="dm_formedit">
<table class="adminform">
<tr>
<th colspan="3"><?php
echo _DML_TITLE_DOCINFORMATION;
?>
</th>
</tr>
<?php
HTML_DMDocuments::_showTabBasic($row, $lists, $last, $created);
?>
<tr>
<td colspan="2">
<?php
$tabs->startPane("content-pane");
$tabs->startTab(_DML_DOC, "document-page");
HTML_DMDocuments::_showTabDocument($row, $lists, $last, $created);
$tabs->endTab();
$tabs->startTab(_DML_TAB_PERMISSIONS, "ownership-page");
HTML_DMDocuments::_showTabPermissions($row, $lists, $last, $created);
$tabs->endTab();
$tabs->startTab(_DML_TAB_LICENSE, "license-page");
HTML_DMDocuments::_showTabLicense($row, $lists, $last, $created);
if (isset($params)) {
$tabs->endTab();
$tabs->startTab(_DML_TAB_DETAILS, "details-page");
HTML_DMDocuments::_showTabDetails($row, $lists, $last, $created, $params);
}
$tabs->endTab();
$tabs->endPane();
?>
</td>
</tr>
</table>
<input type="hidden" name="original_dmfilename" value="<?php
echo $lists['original_dmfilename'];
?>
" />
<input type="hidden" name="dmsubmitedby" value="<?php
echo $row->dmsubmitedby;
?>
" />
<input type="hidden" name="id" value="<?php
echo $row->id;
?>
" />
<input type="hidden" name="option" value="com_docman" />
//.........这里部分代码省略.........
示例8: edit
public static function edit(&$row, &$images, &$lists, &$params, $option, &$menus)
{
global $database;
mosMakeHtmlSafe($row);
$create_date = null;
$mod_date = null;
$nullDate = $database->getNullDate();
if ($row->created != $nullDate) {
$create_date = mosFormatDate($row->created, '%A, %d %B %Y %H:%M', '0');
}
if ($row->modified != $nullDate) {
$mod_date = mosFormatDate($row->modified, '%A, %d %B %Y %H:%M', '0');
}
$tabs = new mosTabs(1);
// used to hide "Reset Hits" when hits = 0
if (!$row->hits) {
$visibility = "style='display: none; visibility: hidden;'";
} else {
$visibility = "";
}
mosCommonHTML::loadOverlib();
mosCommonHTML::loadCalendar();
?>
<script language="javascript" type="text/javascript">
var folderimages = new Array;
<?php
$i = 0;
foreach ($images as $k => $items) {
foreach ($items as $v) {
echo "folderimages[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );\t";
}
}
?>
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
if ( pressbutton ==' resethits' ) {
if (confirm('Are you sure you want to reset the Hits to Zero? \nAny unsaved changes to this content will be lost.')){
submitform( pressbutton );
return;
} else {
return;
}
}
if ( pressbutton == 'menulink' ) {
if ( form.menuselect.value == "" ) {
alert( "Please select a Menu" );
return;
} else if ( form.link_name.value == "" ) {
alert( "Please enter a Name for this menu item" );
return;
}
}
var temp = new Array;
for (var i=0, n=form.imagelist.options.length; i < n; i++) {
temp[i] = form.imagelist.options[i].value;
}
form.images.value = temp.join( '\n' );
try {
document.adminForm.onsubmit();
}
catch(e){}
if (trim(form.title.value) == ""){
alert( "Content item must have a title" );
} else if (trim(form.name.value) == ""){
alert( "Content item must have a name" );
} else {
if ( form.reset_hits.checked ) {
form.hits.value = 0;
} else {
}
<?php
getEditorContents('editor1', 'introtext');
?>
submitform( pressbutton );
}
}
</script>
<table class="adminheading">
<tr>
<th class="edit">
Static Content Item:
<small>
<?php
echo $row->id ? 'Edit' : 'New';
?>
</small>
</th>
</tr>
</table>
<form action="index2.php" method="post" name="adminForm">
//.........这里部分代码省略.........
示例9: editContact
public static function editContact(&$row, &$lists, $option, &$params)
{
global $mosConfig_live_site;
if ($row->image == '') {
$row->image = 'blank.png';
}
$tabs = new mosTabs(0);
mosMakeHtmlSafe($row, ENT_QUOTES, 'misc');
?>
<script language="javascript" type="text/javascript">
<!--
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// do field validation
if ( form.name.value == "" ) {
alert( "You must provide a name." );
} else if ( form.catid.value == 0 ) {
alert( "Please select a Category." );
} else {
submitform( pressbutton );
}
}
//-->
</script>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th>
Contact:
<small>
<?php
echo $row->id ? 'Edit' : 'New';
?>
</small>
</th>
</tr>
</table>
<table width="100%">
<tr>
<td width="60%" valign="top">
<table width="100%" class="adminform">
<tr>
<th colspan="2">
Contact Details
</th>
<tr>
<tr>
<td width="20%" align="right">
Category:
</td>
<td width="40%">
<?php
echo $lists['catid'];
?>
</td>
</tr>
<tr>
<td width="20%" align="right">
Linked to User:
</td>
<td >
<?php
echo $lists['user_id'];
?>
</td>
</tr>
<tr>
<td width="20%" align="right">
Name:
</td>
<td >
<input class="inputbox" type="text" name="name" size="50" maxlength="100" value="<?php
echo $row->name;
?>
" />
</td>
</tr>
<tr>
<td align="right">
Contact's Position:
</td>
<td>
<input class="inputbox" type="text" name="con_position" size="50" maxlength="50" value="<?php
echo $row->con_position;
?>
" />
</td>
</tr>
<tr>
<td align="right">
E-mail:
</td>
<td>
//.........这里部分代码省略.........
示例10: showList
/**
* Writes a list of the content items
* @param array An array of content objects
*/
function showList(&$rows, $search, $pageNav, $option, $lists)
{
global $my, $acl, $database;
mosCommonHTML::loadOverlib();
$nullDate = $database->getNullDate();
?>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th class="frontpage" rowspan="2">
Administrar Página Principal
</th>
<td width="right">
<?php
echo $lists['sectionid'];
?>
</td>
<td width="right">
<?php
echo $lists['catid'];
?>
</td>
<td width="right">
<?php
echo $lists['authorid'];
?>
</td>
</tr>
<tr>
<td align="right" colspan="2">
Filtro:
</td>
<td>
<input type="text" name="search" value="<?php
echo htmlspecialchars($search);
?>
" class="text_area" onChange="document.adminForm.submit();" />
</td>
</tr>
</table>
<table class="adminlist">
<tr>
<th width="5">
nº
</th>
<th width="20">
<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php
echo count($rows);
?>
);" />
</th>
<th class="title">
Título
</th>
<th width="10%" nowrap="nowrap">
Publicado
</th>
<th colspan="2" nowrap="nowrap" width="5%">
Reordenar
</th>
<th width="2%">
Ordem
</th>
<th width="1%">
<a href="javascript: saveorder( <?php
echo count($rows) - 1;
?>
)"><img src="images/filesave.png" border="0" width="16" height="16" alt="Salvar Ordem" /></a>
</th>
<th width="8%" nowrap="nowrap">
Acesso
</th>
<th width="10%" align="left">
Seções
</th>
<th width="10%" align="left">
Categoria
</th>
<th width="10%" align="left">
Autor
</th>
</tr>
<?php
$k = 0;
for ($i = 0, $n = count($rows); $i < $n; $i++) {
$row =& $rows[$i];
mosMakeHtmlSafe($row);
$link = 'index2.php?option=com_content§ionid=0&task=edit&hidemainmenu=1&id=' . $row->id;
$row->sect_link = 'index2.php?option=com_sections&task=editA&hidemainmenu=1&id=' . $row->sectionid;
$row->cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id=' . $row->catid;
$now = _CURRENT_SERVER_TIME;
if ($now <= $row->publish_up && $row->state == '1') {
$img = 'publish_y.png';
$alt = 'Publicado';
} else {
//.........这里部分代码省略.........
示例11: edit
/**
* Writes the edit form for new and existing categories
* @param mosCategory The category object
* @param string
* @param array
*/
function edit(&$row, &$lists, $redirect, $menus)
{
if ($row->image == "") {
$row->image = 'blank.png';
}
if ($redirect == 'content') {
$component = 'Conteúdo';
} else {
$component = ucfirst(substr($redirect, 4));
if ($redirect == 'com_contact_details') {
$component = 'Contato';
}
}
mosMakeHtmlSafe($row, ENT_QUOTES, 'description');
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton, section) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
if ( pressbutton == 'menulink' ) {
if ( form.menuselect.value == "" ) {
alert( "Por favor, Selecione um menu" );
return;
} else if ( form.link_type.value == "" ) {
alert( "Por favor, selecione um tipo de menu" );
return;
} else if ( form.link_name.value == "" ) {
alert( "Por favor, informe um nome para este item do menu" );
return;
}
}
if ( form.name.value == "" ) {
alert("Categoria deve ter um nome");
} else if (form.title.value ==""){
alert("A Categoria deve ter um título");
} else {
<?php
getEditorContents('editor1', 'description');
?>
submitform(pressbutton);
}
}
</script>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th class="categories">
Categoria:
<small>
<?php
echo $row->id ? 'Editar' : 'Nova';
?>
</small>
<small><small>
[ <?php
echo $component;
?>
: <?php
echo stripslashes($row->name);
?>
]
</small></small>
</th>
</tr>
</table>
<table width="100%">
<tr>
<td valign="top" width="60%">
<table class="adminform">
<tr>
<th colspan="3">
Detalhes da Categoria
</th>
<tr>
<tr>
<td>
Título da Categoria:
</td>
<td colspan="2">
<input class="text_area" type="text" name="title" value="<?php
echo stripslashes($row->title);
?>
" size="50" maxlength="50" title="Um nome abreviado para ser utilizado nos menus" />
</td>
</tr>
<tr>
<td>
//.........这里部分代码省略.........
示例12: editWeblink
/**
* Writes the edit form for new and existing record
*
* A new record is defined when <var>$row</var> is passed with the <var>id</var>
* property set to 0.
* @param mosWeblink The weblink object
* @param array An array of select lists
* @param string The option
*/
function editWeblink(&$row, &$lists, $option)
{
global $adminLanguage;
mosMakeHtmlSafe($row, ENT_QUOTES, 'description');
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// do field validation
if (form.title.value == ""){
alert( "<?php
echo $adminLanguage->A_COMP_WEBL_MUST_TITLE;
?>
" );
} else if (form.catid.value == "0"){
alert( "<?php
echo $adminLanguage->A_COMP_WEBL_MUST_CATEG;
?>
" );
} else if (form.url.value == ""){
alert( "<?php
echo $adminLanguage->A_COMP_WEBL_MUST_URL;
?>
" );
} else {
submitform( pressbutton );
}
}
</script>
<table class="adminheading">
<tr>
<th>
<?php
echo $row->id ? $adminLanguage->A_COMP_EDIT : $adminLanguage->A_COMP_ADD;
?>
<?php
echo $adminLanguage->A_COMP_WEBL_WL;
?>
</th>
</tr>
</table>
<form action="index2.php" method="post" name="adminForm" id="adminForm">
<table class="adminform">
<tr>
<td width="20%" align="right">
<?php
echo $adminLanguage->A_COMP_NAME;
?>
:
</td>
<td width="80%">
<input class="text_area" type="text" name="title" size="50" maxlength="250" value="<?php
echo $row->title;
?>
" />
</td>
</tr>
<tr>
<td valign="top" align="right">
<?php
echo $adminLanguage->A_COMP_CATEG;
?>
:
</td>
<td>
<?php
echo $lists['catid'];
?>
</td>
</tr>
<tr>
<td valign="top" align="right">
<?php
echo $adminLanguage->A_COMP_ADMIN_URL;
?>
:
</td>
<td>
<input class="text_area" type="text" name="url" value="<?php
echo $row->url;
?>
" size="50" maxlength="250" />
</td>
//.........这里部分代码省略.........
示例13: JQ_editQuestion
//.........这里部分代码省略.........
$orders[$i]->text = $orders2[$j]->c_question;
break;
}
}
}
}
}
// Global QuestPool compatibility
$q_from_pool_gqp = array();
foreach ($orders as $rowtmp) {
if ($rowtmp->c_type == 21) {
$q_from_pool_gqp[] = $rowtmp->c_pool_gqp;
}
}
if (count($q_from_pool_gqp)) {
$qp_ids_gqp = implode(',', $q_from_pool_gqp);
$query = "SELECT a.* FROM #__lms_quiz_t_question as a" . "\n WHERE a.course_id = 0 AND a.c_id IN ({$qp_ids_gqp})";
$JLMS_DB->setQuery($query);
$orders2 = $JLMS_DB->loadObjectList();
for ($i = 0, $n = count($orders); $i < $n; $i++) {
if ($orders[$i]->c_type == 21) {
for ($j = 0, $m = count($orders2); $j < $m; $j++) {
if ($orders[$i]->c_pool_gqp == $orders2[$j]->c_id) {
$orders[$i]->text = $orders2[$j]->c_question;
break;
}
}
}
}
}
$order[] = mosHTML::makeOption(0, '0 ' . _JLMS_SB_FIRST_ITEM);
for ($i = 0, $n = count($orders); $i < $n; $i++) {
$temp_txt = $orders[$i]->text;
mosMakeHtmlSafe($temp_txt);
$temp_txt = strip_tags($temp_txt);
if (strlen($temp_txt) > $chop) {
$text = substr($temp_txt, 0, $chop) . "...";
} else {
$text = $temp_txt;
}
$order[] = mosHTML::makeOption($orders[$i]->c_id, $orders[$i]->value . ' (' . $text . ')');
}
$order[] = mosHTML::makeOption(-1, $orders[$i - 1]->value + 1 . ' ' . _JLMS_SB_LAST_ITEM);
}
###
$ordering = mosHTML::selectList($order, 'q_ordering', 'class="inputbox" size="1"', 'value', 'text', intval($row->c_id ? $row->c_id : -1));
//set ordering to last element for new questions and without changes for existent questions
}
$lists['ordering'] = $ordering;
$query = "SELECT c_id AS value, c_title AS text" . "\n FROM #__lms_quiz_t_quiz" . "\n WHERE course_id = '" . $course_id . "' " . "\n ORDER BY c_title";
$JLMS_DB->setQuery($query);
$quizzes = array();
$quizzes[] = mosHTML::makeOption('-1', _JLMS_QUIZ_QUEST_POOL);
$quizzes = array_merge($quizzes, $JLMS_DB->loadObjectList());
$quiz = mosHTML::selectList($quizzes, 'c_quiz_id', 'class="inputbox" size="1" ', 'value', 'text', intval($row->c_quiz_id));
$lists['quiz'] = $quiz;
$lists['c_wrong_message'] = '';
$lists['c_right_message'] = '';
$query = "SELECT * FROM #__lms_quiz_t_question_fb WHERE quest_id = {$id}";
$JLMS_DB->SetQuery($query);
$q_fbs = $JLMS_DB->LoadObjectList();
foreach ($q_fbs as $qfb) {
if ($qfb->choice_id == -1) {
$lists['c_wrong_message'] = $qfb->fb_text;
} elseif (!$qfb->choice_id) {
$lists['c_right_message'] = $qfb->fb_text;
示例14: saveRegistration
function saveRegistration($option)
{
global $database, $my, $acl;
global $mosConfig_sitename, $mosConfig_live_site, $mosConfig_useractivation, $mosConfig_allowUserRegistration;
global $mosConfig_mailfrom, $mosConfig_fromname, $mosConfig_mailfrom, $mosConfig_fromname;
if ($mosConfig_allowUserRegistration == '0') {
mosNotAuth();
return;
}
$row = new mosUser($database);
if (!$row->bind($_POST, 'usertype')) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
mosMakeHtmlSafe($row);
$row->id = 0;
$row->usertype = 'Registered';
$row->gid = $acl->get_group_id('Registered', 'ARO');
if ($mosConfig_useractivation == '1') {
$row->activation = md5(mosMakePassword());
$row->block = '1';
}
if (!$row->check()) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
$pwd = $row->password;
$row->password = md5($row->password);
$row->registerDate = date("Y-m-d H:i:s");
if (!$row->store()) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
$row->checkin();
$name = $row->name;
$email = $row->email;
$username = $row->username;
$subject = sprintf(T_('Account details for %s at %s'), $name, $mosConfig_sitename);
$subject = html_entity_decode($subject, ENT_QUOTES);
$mambothandler =& mosMambotHandler::getInstance();
$mambothandler->loadBotGroup('authenticator');
if ($mosConfig_useractivation == "1") {
$message = sprintf(T_('Hello %s,
Thank you for registering at %s. Your account has been created but, as a precaution, it must be activated by you before you can use it.
To activate the account click on the following link or copy and paste it in your browser:
%s
After activation you may login to %s using the following username and password:
Username - %s
Password - %s'), $name, $mosConfig_sitename, $mosConfig_live_site . "/index.php?option=com_registration&task=activate&activation=" . $row->activation, $mosConfig_live_site, $username, $pwd);
$loginfo = new mosLoginDetails($username, $pwd);
$mambothandler->trigger('userRegister', array($loginfo));
} else {
$message = sprintf(T_("Hello %s,\n\nThank you for registering at %s.\n\nYou may now login to %s using the username and password you registered with."), $name, $mosConfig_sitename, $mosConfig_live_site);
$loginfo = new mosLoginDetails($username, $pwd);
$mambothandler->trigger('userRegister', array($loginfo));
$mambothandler->trigger('userActivate', array($loginfo));
}
$message = html_entity_decode($message, ENT_QUOTES);
// Send email to user
if ($mosConfig_mailfrom != "" && $mosConfig_fromname != "") {
$adminName2 = $mosConfig_fromname;
$adminEmail2 = $mosConfig_mailfrom;
} else {
$database->setQuery("SELECT name, email FROM #__users" . "\n WHERE usertype='super administrator'");
$rows = $database->loadObjectList();
$row2 = $rows[0];
$adminName2 = $row2->name;
$adminEmail2 = $row2->email;
}
mosMail($adminEmail2, $adminName2, $email, $subject, $message);
// Send notification to all administrators
$subject2 = sprintf(T_('Account details for %s at %s'), $name, $mosConfig_sitename);
$message2 = sprintf(T_('Hello %s,
A new user has registered at %s.
This email contains their details:
Name - %s
e-mail - %s
Username - %s
Please do not respond to this message as it is automatically generated and is for information purposes only'), $adminName2, $mosConfig_sitename, $row->name, $email, $username);
$subject2 = html_entity_decode($subject2, ENT_QUOTES);
$message2 = html_entity_decode($message2, ENT_QUOTES);
// get superadministrators id
$admins = $acl->get_group_objects(25, 'ARO');
foreach ($admins['users'] as $id) {
$database->setQuery("SELECT email, sendEmail FROM #__users" . "\n WHERE id='{$id}'");
$rows = $database->loadObjectList();
$row = $rows[0];
if ($row->sendEmail) {
mosMail($adminEmail2, $adminName2, $row->email, $subject2, $message2);
}
}
if ($mosConfig_useractivation == "1") {
echo '<div class="componentheading">' . T_('Registration Complete') . '</div><br />';
echo T_('Your account has been created and an activation link has been sent to the e-mail address you entered. Note that you must activate the account by clicking on the activation link before you can login.');
//.........这里部分代码省略.........
示例15: saveRegistration
function saveRegistration($option)
{
global $database, $my, $acl;
global $mosConfig_sitename, $mosConfig_live_site, $mosConfig_useractivation, $mosConfig_allowUserRegistration;
global $mosConfig_mailfrom, $mosConfig_fromname, $mosConfig_mailfrom, $mosConfig_fromname;
if ($mosConfig_allowUserRegistration == "0") {
mosNotAuth();
return;
}
$row = new mosUser($database);
if (!$row->bind($_POST, "usertype")) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
mosMakeHtmlSafe($row);
$row->id = 0;
$row->usertype = '';
$row->gid = $acl->get_group_id('Registered', 'ARO');
if ($mosConfig_useractivation == "1") {
$row->activation = md5(mosMakePassword());
$row->block = "1";
}
if (!$row->check()) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
$pwd = $row->password;
$row->password = md5($row->password);
$row->registerDate = date("Y-m-d H:i:s");
if (!$row->store()) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
//// Begin UserExtended
include "administrator/components/com_user_extended/user_extended.class.php";
$rowExtended = new mosUser_Extended($database);
if (!$rowExtended->bind($_POST)) {
echo "<script> alert('" . $rowExtended->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
if (!$rowExtended->check()) {
echo "<script> alert('" . $rowExtended->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
if (!$rowExtended->storeExtended($row->id)) {
echo "<script> alert('" . $rowExtended->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
//// End UserExtended
$row->checkin();
$name = $row->name;
$email = $row->email;
$username = $row->username;
$subject = sprintf(_SEND_SUB, $name, $mosConfig_sitename);
$subject = html_entity_decode($subject, ENT_QUOTES);
if ($mosConfig_useractivation == "1") {
$message = sprintf(_USEND_MSG_ACTIVATE, $name, $mosConfig_sitename, $mosConfig_live_site . "/index.php?option=com_registration&task=activate&activation=" . $row->activation, $mosConfig_live_site, $username, $pwd);
} else {
$message = sprintf(_USEND_MSG, $name, $mosConfig_sitename, $mosConfig_live_site);
}
$message = html_entity_decode($message, ENT_QUOTES);
// Send email to user
if ($mosConfig_mailfrom != "" && $mosConfig_fromname != "") {
$adminName2 = $mosConfig_fromname;
$adminEmail2 = $mosConfig_mailfrom;
} else {
$database->setQuery("SELECT name, email FROM #__users" . "\n WHERE usertype='superadministrator'");
$rows = $database->loadObjectList();
$row2 = $rows[0];
$adminName2 = $row2->name;
$adminEmail2 = $row2->email;
}
mosMail($adminEmail2, $adminName2, $email, $subject, $message);
// Send notification to all administrators
$subject2 = sprintf(_SEND_SUB, $name, $mosConfig_sitename);
$message2 = sprintf(_ASEND_MSG, $adminName2, $mosConfig_sitename, $row->name, $email, $username);
$subject2 = html_entity_decode($subject2, ENT_QUOTES);
$message2 = html_entity_decode($message2, ENT_QUOTES);
// get superadministrators id
$admins = $acl->get_group_objects(25, 'ARO');
foreach ($admins['users'] as $id) {
$database->setQuery("SELECT email, sendEmail FROM #__users" . "\n WHERE id='{$id}'");
$rows = $database->loadObjectList();
$row = $rows[0];
if ($row->sendEmail) {
mosMail($adminEmail2, $adminName2, $row->email, $subject2, $message2);
}
}
if ($mosConfig_useractivation == "1") {
echo _REG_COMPLETE_ACTIVATE;
} else {
echo _REG_COMPLETE;
}
}