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; ?> </td> <td> <input class="inputbox" type="text" name="polloption[<?php echo $options[$i]->id; ?> ]" value="<?php echo htmlspecialchars(stripslashes($options[$i]->text)); ?> " size="60" /> </td> </tr> <?php } for (; $i < 12; $i++) { ?> <tr> <td> <?php echo $i + 1; ?> </td> <td> <input class="inputbox" type="text" name="polloption[]" value="" size="60"/> </td> </tr> <?php } ?> </table> <input type="hidden" name="task" value=""> <input type="hidden" name="option" value="com_poll" /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="textfieldcheck" value="<?php echo $n; ?> " /> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
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> </tr> <tr> <td><?php echo _BOOKLIBRARY_CATEGORIES_HEADER_NAME; ?> :</td> <td colspan="2"> <input class="text_area" type="hidden" name="title" id="title" value="<?php echo $row->title; ?> " maxlength="50" title="" /> <input class="text_area" type="text" name="name" id="cat_name" value="<?php echo $row->name; ?> " size="50" maxlength="255" title="" /> </td> </tr> <tr> <td><?php echo _BOOKLIBRARY_CATEGORIES_HEADER_ALIAS; ?> :</td> <td colspan="2"> <input class="text_area" type="text" name="alias" id="alias" value="<?php echo $row->alias; ?> " size="50" maxlength="255" title="A short name to appear in menus" /> </td> </tr> <tr> <td><?php echo _BOOKLIBRARY_LABEL_LANGUAGEDESCRIPTION; ?> :</td> <td colspan="2"><?php echo $lists['langshow']; ?> </td> </tr> <tr> <td><?php echo _BOOKLIBRARY_VIEW_BOOK; ?> :</td> <td colspan="2"><?php echo $lists['view_book']; ?> </td> </tr> <tr> <td align="right"><?php echo _BOOKLIBRARY_CATEGORIES__PARENTITEM; ?> :</td> <td colspan="2"><?php echo $lists['parent']; ?> </td> </tr> <tr> <td><?php echo _BOOKLIBRARY_CATEGORIES_HEADER_IMAGE; ?> :</td> <td><?php echo $lists['image']; ?> </td> <td rowspan="4" width="50%"> <script language="javascript" type="text/javascript"> if (document.forms[0].image.options.value!='') { jsimg='../images/stories/' + getSelectedValue( 'adminForm', 'image' ); } else { jsimg='../images/M_images/blank.png'; } document.write('<img src=' + jsimg + ' name="imagelib" width="80" height="80" border="2" alt="<?php echo _BOOKLIBRARY_CATEGORIES__IMAGEPREVIEW; ?> " />'); </script> </td> </tr> <tr> <td><?php echo _BOOKLIBRARY_CATEGORIES_HEADER_IMAGEPOS; ?> :</td> <td><?php echo $lists['image_position']; ?> </td> </tr> <tr> <td><?php echo _BOOKLIBRARY_CATEGORIES_HEADER_ORDER; ?> :</td> <td><?php echo $lists['ordering']; ?> </td> </tr> <tr> <td align = "center"><?php echo _BOOKLIBRARY_HEADER_ACCESS; ?> :</td> <td><input value="Everyone" disabled /></td> </tr> <tr> <td><?php echo _BOOKLIBRARY_HEADER_PUBLISHED; ?> :</td> <td colspan="2"><?php echo $lists['published']; ?> </td> </tr> <tr> <td valign="top"><?php echo _BOOKLIBRARY_CATEGORIES__DETAILS; ?> :</td> <td colspan="2"> <?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor1', $row->description, 'description', '500', '200', '50', '5'); ?> </td> </tr> </table> </td> </tr> </table> <input type="hidden" name="option" value="com_booklibrary" /> <input type="hidden" name="section" value="categories" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="sectionid" value="com_booklibrary" /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?> " /> </form> <?php }
public static function showMenusections($rows, $pageNav, $search, $levellist, $menutype, $option) { global $my; mosCommonHTML::loadOverlib(); ?> <form action="index2.php" method="post" name="adminForm"> <table class="adminheading"> <tr> <th class="menus"> Menu Manager <small><small>[ <?php echo $menutype; ?> ]</small></small> </th> <td nowrap="nowrap"> Max Levels </td> <td> <?php echo $levellist; ?> </td> <td> Filter: </td> <td> <input type="text" name="search" value="<?php echo htmlspecialchars($search); ?> " class="inputbox" onChange="document.adminForm.submit();" /> </td> </tr> <?php if ($menutype == 'mainmenu') { ?> <tr> <td align="right" nowrap="nowrap" style="color: red; font-weight: normal;" colspan="5"> <?php echo _MAINMENU_DEL; ?> <br/> <span style="color: black;"> <?php echo _MAINMENU_HOME; ?> </span> </td> </tr> <?php } ?> </table> <table class="adminlist"> <tr> <th width="20"> # </th> <th width="20"> <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?> );" /> </th> <th class="title" width="40%"> Menu Item </th> <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; ?> </a> <?php } ?> </td> <td width="10%" align="center"> <?php echo $published; ?> </td> <td> <?php echo $pageNav->orderUpIcon($i); ?> </td> <td> <?php echo $pageNav->orderDownIcon($i, $n); ?> </td> <td align="center" colspan="2"> <input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?> " class="text_area" style="text-align: center" /> </td> <td align="center"> <?php echo $access; ?> </td> <td align="center"> <?php echo $row->id; ?> </td> <td align="left"> <span class="editlinktip"> <?php echo mosToolTip($row->descrip, '', 280, 'tooltip.png', $row->type, $row->edit); ?> </span> </td> <td align="center"> <?php echo $row->componentid; ?> </td> </tr> <?php $k = 1 - $k; $i++; } ?> </table> <?php echo $pageNav->getListFooter(); ?> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="menutype" value="<?php echo $menutype; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="hidemainmenu" value="0" /> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
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 = "******"\n WHERE 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); }
/** * 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; } else { ?> <a href="<?php echo $link; ?> "> <?php echo $row->name; ?> </a> <?php } ?> </td> <td align="center"> <?php echo $published; ?> </td> <td> <?php echo $pageNav->orderUpIcon($i, $row->folder == @$rows[$i - 1]->folder && $row->ordering > -10000 && $row->ordering < 10000); ?> </td> <td> <?php echo $pageNav->orderDownIcon($i, $n, $row->folder == @$rows[$i + 1]->folder && $row->ordering > -10000 && $row->ordering < 10000); ?> </td> <td align="center" colspan="2"> <input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?> " class="text_area" style="text-align: center" /> </td> <td align="center"> <?php echo $access; ?> </td> <td align="left" nowrap="nowrap"> <?php echo $row->folder; ?> </td> <td align="left" nowrap="nowrap"> <?php echo $row->element; ?> </td> </tr> <?php $k = 1 - $k; } ?> </table> <?php echo $pageNav->getListFooter(); ?> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="client" value="<?php echo $client; ?> " /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="hidemainmenu" value="0" /> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
/** * @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> </table> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="task" value="" /> </form> <?php }
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" /> <input type="hidden" name="section" value="documents" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="dmcounter" value="<?php echo $row->dmcounter; ?> " /> <?php echo DOCMAN_token::render(); ?> </form> <?php include_once $mosConfig_absolute_path . "/components/com_docman/footer.php"; }
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"> <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <td width="60%" valign="top"> <table class="adminform"> <tr> <th colspan="3"> Item Details </th> </tr> <tr> <td align="left"> Title: </td> <td> <input class="inputbox" type="text" name="title" size="30" maxlength="100" value="<?php echo $row->title; ?> " /> </td> </tr> <tr> <td align="left"> Title Alias: </td> <td> <input class="inputbox" type="text" name="title_alias" size="30" maxlength="100" value="<?php echo $row->title_alias; ?> " /> </td> </tr> <tr> <td valign="top" align="left" colspan="2"> Text: (required)<br /> <?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor1', $row->introtext, 'introtext', '100%;', '500', '75', '50'); ?> </td> </tr> </table> </td> <td width="40%" valign="top"> <?php $tabs->startPane("content-pane"); $tabs->startTab("Publishing", "publish-page"); ?> <table class="adminform"> <tr> <th colspan="2"> Publishing Info </th> </tr> <tr> <td valign="top" align="right" width="120"> State: </td> <td> <?php echo $row->state > 0 ? 'Published' : 'Draft Unpublished'; ?> </td> </tr> <tr> <td valign="top" align="right"> Published: </td> <td> <input type="checkbox" name="published" value="1" <?php echo $row->state ? 'checked="checked"' : ''; ?> /> </td> </tr> <tr> <td valign="top" align="right"> Access Level: </td> <td> <?php echo $lists['access']; ?> </td> </tr> <tr> <td valign="top" align="right"> Author Alias: </td> <td> <input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php echo $row->created_by_alias; ?> " class="inputbox" /> </td> </tr> <tr> <td valign="top" align="right"> Change Creator: </td> <td> <?php echo $lists['created_by']; ?> </td> </tr> <tr> <td valign="top" align="right"> Override Created Date </td> <td> <input class="inputbox" type="text" name="created" id="created" size="25" maxlength="19" value="<?php echo $row->created; ?> " /> <input name="reset" type="reset" class="button" onClick="return showCalendar('created', 'y-mm-dd');" value="..."> </td> </tr> <tr> <td align="right"> Start Publishing: </td> <td> <input class="inputbox" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php echo $row->publish_up; ?> " /> <input type="reset" class="button" value="..." onclick="return showCalendar('publish_up', 'y-mm-dd');"> </td> </tr> <tr> <td align="right"> Finish Publishing: </td> <td> <input class="inputbox" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php echo $row->publish_down; ?> " /> <input type="reset" class="button" value="..." onclick="return showCalendar('publish_down', 'y-mm-dd');"> </td> </tr> </table> <br /> <table class="adminform" width="100%"> <?php if ($row->id) { ?> <tr> <td> <strong>Content ID:</strong> </td> <td> <?php echo $row->id; ?> </td> </tr> <?php } ?> <tr> <td width="120" valign="top" align="right"> <strong>State</strong> </td> <td> <?php echo $row->state > 0 ? 'Published' : ($row->state < 0 ? 'Archived' : 'Draft Unpublished'); ?> </td> </tr> <tr> <td valign="top" align="right"> <strong>Hits</strong> </td> <td> <?php echo $row->hits; ?> <div <?php echo $visibility; ?> > <input name="reset_hits" type="button" class="button" value="Reset Hit Count" onClick="submitbutton('resethits');"> </div> </td> </tr> <tr> <td valign="top" align="right"> <strong>Version</strong> </td> <td> <?php echo $row->version; ?> times </td> </tr> <tr> <td valign="top" align="right"> <strong>Created</strong> </td> <td> <?php if (!$create_date) { ?> New document <?php } else { echo $create_date; } ?> </td> </tr> <tr> <td valign="top" align="right"> <strong>Last Modified</strong> </td> <td> <?php if (!$mod_date) { ?> Not modified <?php } else { echo $mod_date; ?> <br /> <?php echo $row->modifier; } ?> </td> </tr> <tr> <td valign="top" align="right"> <strong>Expires</strong> </td> <td> <?php echo "{$row->publish_down}"; ?> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab("Images", "images-page"); ?> <table class="adminform"> <tr> <th colspan="2"> MOSImage Control </th> </tr> <tr> <td colspan="2"> <table width="100%"> <tr> <td width="48%" valign="top"> <div align="center"> Gallery Images: <br /> <?php echo $lists['imagefiles']; ?> </div> </td> <td width="2%"> <input class="button" type="button" value=">>" onclick="addSelectedToList('adminForm','imagefiles','imagelist')" title="Add"/> <br/> <input class="button" type="button" value="<<" onclick="delSelectedFromList('adminForm','imagelist')" title="Remove"/> </td> <td width="48%"> <div align="center"> Content Images: <br /> <?php echo $lists['imagelist']; ?> <br /> <input class="button" type="button" value="Up" onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" /> <input class="button" type="button" value="Down" onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" /> </div> </td> </tr> </table> Sub-folder: <?php echo $lists['folders']; ?> </td> </tr> <tr valign="top"> <td> <div align="center"> Sample Image:<br/> <img name="view_imagefiles" src="../images/M_images/blank.png" width="100" /> </div> </td> <td valign="top"> <div align="center"> Active Image:<br/> <img name="view_imagelist" src="../images/M_images/blank.png" width="100" /> </div> </td> </tr> <tr> <td> Edit the image selected: <table> <tr> <td align="right"> Source </td> <td> <input type="text" name= "_source" value="" /> </td> </tr> <tr> <td align="right"> Align </td> <td> <?php echo $lists['_align']; ?> </td> </tr> <tr> <td align="right"> Alt Text </td> <td> <input type="text" name="_alt" value="" /> </td> </tr> <tr> <td align="right"> Border </td> <td> <input type="text" name="_border" value="" size="3" maxlength="1" /> </td> </tr> <tr> <td align="right"> Caption: </td> <td> <input class="text_area" type="text" name="_caption" value="" size="30" /> </td> </tr> <tr> <td align="right"> Caption Position: </td> <td> <?php echo $lists['_caption_position']; ?> </td> </tr> <tr> <td align="right"> Caption Align: </td> <td> <?php echo $lists['_caption_align']; ?> </td> </tr> <tr> <td align="right"> Width: </td> <td> <input class="text_area" type="text" name="_width" value="" size="5" maxlength="5" /> </td> </tr> <tr> <td colspan="2"> <input class="button" type="button" value="Apply" onClick="applyImageProps()" /> </td> </tr> </table> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab("Parameters", "params-page"); ?> <table class="adminform"> <tr> <th colspan="2"> Parameter Control </th> </tr> <tr> <td> <?php echo $params->render(); ?> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab("Meta Info", "metadata-page"); ?> <table class="adminform"> <tr> <th colspan="2"> Meta Data </th> </tr> <tr> <td align="left"> Description:<br /> <textarea class="inputbox" cols="40" rows="5" name="metadesc" style="width:300px"><?php echo str_replace('&', '&', $row->metadesc); ?> </textarea> </td> </tr> <tr> <td align="left"> Keywords:<br /> <textarea class="inputbox" cols="40" rows="5" name="metakey" style="width:300px"><?php echo str_replace('&', '&', $row->metakey); ?> </textarea> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab("Link to Menu", "link-page"); ?> <table class="adminform"> <tr> <th colspan="2"> Link to Menu </th> </tr> <tr> <td colspan="2"> This will create a 'Link - Static Content' in the menu you select <br /><br /> </td> </tr> <tr> <td valign="top" width="90px"> Select a Menu </td> <td> <?php echo $lists['menuselect']; ?> </td> </tr> <tr> <td valign="top" width="90px"> Menu Item Name </td> <td> <input type="text" name="link_name" class="inputbox" value="" size="30" /> </td> </tr> <tr> <td> </td> <td> <input name="menu_link" type="button" class="button" value="Link to Menu" onClick="submitbutton('menulink');" /> </td> </tr> <tr> <th colspan="2"> Existing Menu Links </th> </tr> <?php if ($menus == NULL) { ?> <tr> <td colspan="2"> None </td> </tr> <?php } else { mosCommonHTML::menuLinksContent($menus); } ?> <tr> <td colspan="2"> </td> </tr> </table> <?php $tabs->endTab(); $tabs->endPane(); ?> </td> </tr> </table> <input type="hidden" name="images" value="" /> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="hits" value="<?php echo $row->hits; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
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> <input class="inputbox" type="text" name="email_to" size="50" maxlength="100" value="<?php echo $row->email_to; ?> " /> </td> </tr> <tr> <td align="right"> Street Address: </td> <td> <input class="inputbox" type="text" name="address" size="50" value="<?php echo $row->address; ?> " /> </td> </tr> <tr> <td align="right"> Town/Suburb: </td> <td> <input class="inputbox" type="text" name="suburb" size="50" maxlength="50" value="<?php echo $row->suburb; ?> " /> </td> </tr> <tr> <td align="right"> State/County: </td> <td> <input class="inputbox" type="text" name="state" size="50" maxlength="20" value="<?php echo $row->state; ?> " /> </td> </tr> <tr> <td align="right"> Country: </td> <td> <input class="inputbox" type="text" name="country" size="50" maxlength="50" value="<?php echo $row->country; ?> " /> </td> </tr> <tr> <td align="right"> Postal Code/ZIP: </td> <td> <input class="inputbox" type="text" name="postcode" size="25" maxlength="10" value="<?php echo $row->postcode; ?> " /> </td> </tr> <tr> <td align="right"> Telephone: </td> <td> <input class="inputbox" type="text" name="telephone" size="25" maxlength="25" value="<?php echo $row->telephone; ?> " /> </td> </tr> <tr> <td align="right"> Fax: </td> <td> <input class="inputbox" type="text" name="fax" size="25" maxlength="25" value="<?php echo $row->fax; ?> " /> </td> </tr> <tr> <td align="right" valign="top"> Miscellaneous Info: </td> <td> <textarea name="misc" rows="5" cols="50" class="inputbox"><?php echo $row->misc; ?> </textarea> </td> </tr> </table> </td> <td width="40%" valign="top"> <?php $tabs->startPane("content-pane"); $tabs->startTab("Publishing", "publish-page"); ?> <table width="100%" class="adminform"> <tr> <th colspan="2"> Publishing Info </th> <tr> <tr> <td valign="top" align="right"> Published: </td> <td> <?php echo $lists['published']; ?> </td> </tr> <tr> <td valign="top" align="right"> Ordering: </td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td valign="top" align="right"> Access: </td> <td> <?php echo $lists['access']; ?> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab("Images", "images-page"); ?> <table width="100%" class="adminform"> <tr> <th colspan="2"> Image Info </th> <tr> <tr> <td align="left" width="20%"> Image: </td> <td align="left"> <?php echo $lists['image']; ?> </td> </tr> <tr> <td> </td> <td> <script language="javascript" type="text/javascript"> if (document.forms[0].image.options.value!=''){ jsimg='../images/stories/' + getSelectedValue( 'adminForm', 'image' ); } else { jsimg='../images/M_images/blank.png'; } document.write('<img src=' + jsimg + ' name="imagelib" width="100" height="100" border="2" alt="Preview" />'); </script> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab("Parameters", "params-page"); ?> <table class="adminform"> <tr> <th> Parameters </th> </tr> <tr> <td> * These Parameters only control what you see when you click to view a Contact item * <br /><br /> </td> </tr> <tr> <td> <?php echo $params->render(); ?> </td> </tr> </table> <?php $tabs->endTab(); $tabs->endPane(); ?> </td> </tr> </table> <script language="Javascript" src="<?php echo $mosConfig_live_site; ?> /includes/js/overlib_mini.js"></script> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
/** * 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 { if (($now <= $row->publish_down || $row->publish_down == $nullDate) && $row->state == '1') { $img = 'publish_g.png'; $alt = 'Publicado'; } else { if ($now > $row->publish_down && $row->state == '1') { $img = 'publish_r.png'; $alt = 'Expirado'; } elseif ($row->state == "0") { $img = "publish_x.png"; $alt = 'Despublicado'; } } } $times = ''; if (isset($row->publish_up)) { if ($row->publish_up == $nullDate) { $times .= '<tr><td>Início: Sempre</td></tr>'; } else { $times .= '<tr><td>Início: ' . $row->publish_up . '</td></tr>'; } } if (isset($row->publish_down)) { if ($row->publish_down == $nullDate) { $times .= '<tr><td>Fim: Não Expira</td></tr>'; } else { $times .= '<tr><td>Fim: ' . $row->publish_down . '</td></tr>'; } } $access = mosCommonHTML::AccessProcessing($row, $i); $checked = mosCommonHTML::CheckedOutProcessing($row, $i); if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) { if ($row->created_by_alias) { $author = $row->created_by_alias; } else { $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->created_by; $author = '<a href="' . $linkA . '" title="Editar Usuário">' . $row->author . '</a>'; } } else { if ($row->created_by_alias) { $author = $row->created_by_alias; } else { $author = $row->author; } } ?> <tr class="<?php echo "row{$k}"; ?> "> <td> <?php echo $pageNav->rowNumber($i); ?> </td> <td> <?php echo $checked; ?> </td> <td> <?php if ($row->checked_out && $row->checked_out != $my->id) { echo $row->title; } else { ?> <a href="<?php echo $link; ?> " title="Editar Conteúdo"> <?php echo $row->title; ?> </a> <?php } ?> </td> <?php if ($times) { ?> <td align="center"> <a href="javascript: void(0);" onmouseover="return overlib('<table><?php echo $times; ?> </table>', CAPTION, 'Informações da Publicação', BELOW, RIGHT);" onMouseOut="return nd();" onclick="return listItemTask('cb<?php echo $i; ?> ','<?php echo $row->state ? "despublicar" : "publicar"; ?> ')"> <img src="images/<?php echo $img; ?> " width="12" height="12" border="0" alt="<?php echo $alt; ?> " /> </a> </td> <?php } ?> <td> <?php echo $pageNav->orderUpIcon($i); ?> </td> <td> <?php echo $pageNav->orderDownIcon($i, $n); ?> </td> <td align="center" colspan="2"> <input type="text" name="order[]" size="5" value="<?php echo $row->fpordering; ?> " class="text_area" style="text-align: center" /> </td> <td align="center"> <?php echo $access; ?> </td> <td> <a href="<?php echo $row->sect_link; ?> " title="Editar Seção"> <?php echo $row->sect_name; ?> </a> </td> <td> <a href="<?php echo $row->cat_link; ?> " title="Editar Categoria"> <?php echo $row->name; ?> </a> </td> <td> <?php echo $author; ?> </td> </tr> <?php $k = 1 - $k; } ?> </table> <?php echo $pageNav->getListFooter(); mosCommonHTML::ContentLegend(); ?> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
/** * 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> Nome Categoria: </td> <td colspan="2"> <input class="text_area" type="text" name="name" value="<?php echo stripslashes($row->name); ?> " size="50" maxlength="255" title="Um nome longo para ser utilizado nos cabeçalhos" /> </td> </tr> <tr> <td> Seções: </td> <td colspan="2"> <?php echo $lists['section']; ?> </td> </tr> <tr> <td> Ordenando: </td> <td colspan="2"> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td> Imagem: </td> <td> <?php echo $lists['image']; ?> </td> <td rowspan="5" width="50%"> <script language="javascript" type="text/javascript"> if (document.forms[0].image.options.value!=''){ jsimg='../images/stories/' + getSelectedValue( 'adminForm', 'image' ); } else { jsimg='../images/M_images/blank.png'; } document.write('<img src=' + jsimg + ' name="imagelib" width="80" height="80" border="2" alt="Preview" />'); </script> </td> </tr> <tr> <td> Posição da Imagem: </td> <td> <?php echo $lists['image_position']; ?> </td> </tr> <tr> <td> Nível de Acesso: </td> <td> <?php echo $lists['access']; ?> </td> </tr> <tr> <td> Publicado: </td> <td> <?php echo $lists['published']; ?> </td> </tr> <tr> <td valign="top" colspan="2"> Descrição: </td> </tr> <tr> <td colspan="3"> <?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor1', $row->description, 'description', '100%;', '300', '60', '20'); ?> </td> </tr> </table> </td> <td valign="top" width="40%"> <?php if ($row->id > 0) { ?> <table class="adminform"> <tr> <th colspan="2"> Link to Menu </th> <tr> <tr> <td colspan="2"> Este irá criar um novo item de menu no menu que você selecionou <br /> <br /><br /> </td> <tr> <tr> <td valign="top" width="100"> Selecione um Menu </td> <td> <?php echo $lists['menuselect']; ?> </td> <tr> <tr> <td valign="top" width="100"> Tipo do Menu </td> <td> <?php echo $lists['link_type']; ?> </td> <tr> <tr> <td valign="top" width="100"> Nome do Menu </td> <td> <input type="text" name="link_name" class="inputbox" value="" size="25" /> </td> <tr> <tr> <td> </td> <td> <input name="menu_link" type="button" class="button" value="Link to Menu" onClick="submitbutton('menulink');" /> </td> <tr> <tr> <th colspan="2"> Links de menus existentes </th> </tr> <?php if ($menus == NULL) { ?> <tr> <td colspan="2"> Nenhum </td> </tr> <?php } else { mosCommonHTML::menuLinksSecCat($menus); } ?> <tr> <td colspan="2"> </td> </tr> </table> <?php } else { ?> <table class="adminform" width="40%"> <tr> <th> </th> </tr> <tr> <td> Links de menus disponíveis somente depois de salva a categoria </td> </tr> </table> <?php } // content if ($row->section > 0 || $row->section == 'content') { ?> <br /> <table class="adminform"> <tr> <th colspan="2"> Diretórios MOSImage </th> <tr> <tr> <td colspan="2"> <?php echo $lists['folders']; ?> </td> <tr> </table> <?php } ?> </td> </tr> </table> <input type="hidden" name="option" value="com_categories" /> <input type="hidden" name="oldtitle" value="<?php echo $row->title; ?> " /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="sectionid" value="<?php echo $row->section; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?> " /> <input type="hidden" name="hidemainmenu" value="0" /> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
/** * 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> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_DESCRIPTION; ?> : </td> <td> <textarea class="text_area" cols="50" rows="5" name="description" style="width:500px" width="500"><?php echo $row->description; ?> </textarea> </td> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_ORDERING; ?> : </td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_WEBL_APPROVED; ?> : </td> <td> <?php echo $lists['approved']; ?> </td> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_PUBLISHED; ?> : </td> <td> <?php echo $lists['published']; ?> </td> </tr> </table> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="task" value="" /> </form> <?php }
function JQ_editQuestion($id, $option, $qtype, $page, $course_id, $gqp = false) { global $JLMS_DB, $my, $JLMS_SESSION, $Itemid, $JLMS_CONFIG; if ($gqp && mosGetParam($_REQUEST, 'c_id')) { $query = "SELECT c_id FROM #__lms_quiz_t_question" . "\n WHERE c_id = '" . intval(mosGetParam($_REQUEST, 'c_id')) . "' AND course_id > 0 AND c_quiz_id > 0"; $JLMS_DB->setQuery($query); $c_id = $JLMS_DB->loadResult(); if ($c_id) { JLMSRedirect(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=quizzes&page=setup_gqp")); } } $row = new mos_JoomQuiz_Question($JLMS_DB); $row->load($id); $quiz_id = intval(mosGetParam($_REQUEST, 'quiz_id', $JLMS_SESSION->get('quiz_id', 0))); $JLMS_ACL =& JLMSFactory::getACL(); if (!$JLMS_ACL->CheckPermissions('quizzes', 'manage')) { if ($JLMS_ACL->CheckPermissions('quizzes', 'manage_pool')) { $quiz_id = -1; if ($id) { if ($row->c_quiz_id == 0) { } else { JLMSRedirect(sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=quizzes&id={$course_id}&page=quizzes")); } } } } if ($id) { if ($row->c_quiz_id == 0) { $row->c_quiz_id = -1; } } elseif (mosGetParam($_REQUEST, 'level_id_0')) { $row->bind($_POST); /*Fix params (Max)*/ if (isset($row->params) && count($row->params)) { $row_params = $row->params; $row->params = ''; $i = 0; if (isset($row_params) && is_array($row_params) && count($row_params)) { foreach ($row_params as $key => $item) { $row->params .= $key . '=' . $item; if ($i < count($row_params)) { $row->params .= "\n"; } $i++; } } } /*Fix params (Max)*/ } else { // do stuff for new records $row->ordering = 0; $row->c_quiz_id = $quiz_id; //intval( mosGetParam( $_REQUEST, 'quiz_id', $JLMS_SESSION->get('quiz_id', 0 )) ); $row->c_type = intval(mosGetParam($_REQUEST, 'new_qtype_id', 1)); $row->c_question = "Enter question text here"; //$row->c_qcat = 0; } $params = new JLMSParameters($row->params); $params->def('disable_quest_feedback', 0); $params->def('survey_question', 0); $params->def('case_sensivity', 0); $lists = array(); $query = "SELECT c_id as value, c_category as text FROM #__lms_quiz_t_category WHERE course_id = '" . $course_id . "' AND is_quiz_cat = 0 order by c_category"; $JLMS_DB->setQuery($query); $jq_cats = array(); $jq_cats[] = mosHTML::makeOption(0, ' - ' . _JLMS_QUIZ_CAT_TYPE_QUEST . ' - '); $jq_cats = array_merge($jq_cats, $JLMS_DB->loadObjectList()); $lists['jq_categories'] = mosHTML::selectList($jq_cats, 'c_qcat', 'class="inputbox" size="1"', 'value', 'text', $row->c_qcat); $is_pool = false; if ($row->c_quiz_id == -1) { $is_pool = true; } $query = "SELECT a.ordering AS value, a.c_question AS text, a.c_type, a.c_id, a.c_pool, a.c_pool_gqp" . "\n FROM #__lms_quiz_t_question AS a" . "\n WHERE a.course_id = '" . $course_id . "' " . ($row->c_quiz_id ? "\n AND a.c_quiz_id = " . ($is_pool ? 0 : $row->c_quiz_id) : '') . "\n ORDER BY a.ordering, a.c_id"; //$text_new_order = _C M N_NEW_ITEM_FIRST; //if ( $id ) { if (true) { ### $chop = 30; $order = array(); $JLMS_DB->setQuery($query); $orders = $JLMS_DB->loadObjectList(); if (empty($orders)) { $order[] = mosHTML::makeOption(0, _JLMS_SB_FIRST_ITEM); } else { // QuestPool compatibility $q_from_pool = array(); foreach ($orders as $rowtmp) { if ($rowtmp->c_type == 20) { $q_from_pool[] = $rowtmp->c_pool; } } if (count($q_from_pool)) { $qp_ids = implode(',', $q_from_pool); $query = "SELECT a.* FROM #__lms_quiz_t_question as a" . "\n WHERE a.course_id = '" . $course_id . "' AND a.c_id IN ({$qp_ids})"; $JLMS_DB->setQuery($query); $orders2 = $JLMS_DB->loadObjectList(); for ($i = 0, $n = count($orders); $i < $n; $i++) { if ($orders[$i]->c_type == 20) { for ($j = 0, $m = count($orders2); $j < $m; $j++) { if ($orders[$i]->c_pool == $orders2[$j]->c_id) { $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; } } $JLMS_DB->SetQuery("SELECT c_qtype FROM #__lms_quiz_t_qtypes WHERE c_id = '" . $row->c_type . "'"); $qtype_str = $JLMS_DB->LoadResult(); $str = '_JLMS_QUIZ_QTYPE_' . $row->c_type; if (defined($str)) { $qtype_str = constant($str); } if (mosGetParam($_REQUEST, 'c_type')) { $row->c_type = mosGetParam($_REQUEST, 'c_type'); } //---------------------------------------kosmos if ($row->c_type == 21) { $javascript = 'onclick="read_filter();" onchange="javascript:write_filter();form.page.value=\'add_quest\';document.adminForm.submit();"'; } else { $javascript = 'onclick="read_filter();" onchange="javascript:write_filter();form.page.value=\'edit_quest_gqp\';document.adminForm.submit();"'; } //FLMS multicategories $levels = array(); //NEW MULTICAT if ($id) { $tmp_level = array(); $last_catid = 0; $i = 0; foreach ($_REQUEST as $key => $item) { if (preg_match('#level_id_(\\d+)#', $key, $result)) { if ($item) { $tmp_level[$i] = $result; $last_catid = $item; $i++; } } } if (!$i) { $query = "SELECT c_qcat FROM #__lms_quiz_t_question WHERE c_id = '" . $id . "'"; $JLMS_DB->setQuery($query); $last_catid = $JLMS_DB->loadResult(); } $tmp = array(); $tmp = JLMS_quiz_admin_class::JLMS_multicats($last_catid, $tmp); $tmp = array_reverse($tmp); $tmp_pop = $tmp; $tmp_p = array_pop($tmp_pop); if (count($tmp) && $tmp_p->catid) { $next = count($tmp); $tmp[$next] = new stdClass(); $tmp[$next]->catid = 0; $tmp[$next]->parent = $tmp_p->catid; } } else { $tmp_level = array(); $last_catid = 0; $exist_in_request = 0; $i = 0; foreach ($_REQUEST as $key => $item) { if (preg_match('#level_id_(\\d+)#', $key, $result)) { if (isset($item)) { $exist_in_request = 1; if ($item) { $tmp_level[$i] = $result; $last_catid = intval($item); $i++; } } } } if (!$last_catid && !$exist_in_request) { $last_catid = $JLMS_SESSION->get('S_last_catid'); } $JLMS_SESSION->set('S_last_catid', $last_catid); $tmp = array(); $tmp = JLMS_quiz_admin_class::JLMS_multicats($last_catid, $tmp); $tmp = array_reverse($tmp); $tmp_pop = $tmp; $tmp_p = array_pop($tmp_pop); if (count($tmp) && $tmp_p->catid) { $next = count($tmp); $tmp[$next] = new stdClass(); $tmp[$next]->catid = 0; $tmp[$next]->parent = isset($tmp_p->catid) ? $tmp_p->catid : 0; } } /* $query = "SELECT * FROM #__lms_gqp_cats_config ORDER BY id"; $JLMS_DB->setQuery($query); $levels = $JLMS_DB->loadObjectList(); */ if (count($levels) == 0) { for ($i = 0; $i < 15; $i++) { $num = $i + 1; if ($i > 0) { // $levels[$i]->cat_name = _JLMS_COURSES_COURSES_GROUPS; $levels[$i]->cat_name = 'Level #' . $num; } else { // $levels[$i]->cat_name = _JLMS_COURSES_COURSES_GROUPS; $levels[$i]->cat_name = 'Level #' . $num; } } } $level_id = array(); for ($i = 0; $i < count($levels); $i++) { if ($i == 0) { $level_id[$i] = intval(mosGetParam($_REQUEST, 'level_id_' . $i, 0)); $_REQUEST['level_id_' . $i] = $level_id[$i]; $JLMS_SESSION->set('GQP_level_id_' . $i, $level_id[$i]); } else { $level_id[$i] = intval(mosGetParam($_REQUEST, 'level_id_' . $i, $JLMS_SESSION->get('GQP_level_id_' . $i, 0))); $_REQUEST['level_id_' . $i] = $level_id[$i]; $JLMS_SESSION->set('GQP_level_id_' . $i, $level_id[$i]); } if ($i == 0) { $parent_id[$i] = 0; } else { $parent_id[$i] = $level_id[$i - 1]; } $query = "SELECT count(id) FROM `#__lms_gqp_cats` WHERE parent = '" . $parent_id[$i] . "' ORDER BY c_category"; $JLMS_DB->setQuery($query); $groups = $JLMS_DB->loadResult(); if ($groups == 0) { $level_id[$i] = 0; $JLMS_SESSION->set('GQP_level_id_' . $i, $level_id[$i]); } } for ($i = 0; $i < count($levels); $i++) { if ($i > 0 && $level_id[$i - 1] == 0) { $level_id[$i] = 0; $_REQUEST['level_id_' . $i] = $level_id[$i]; $JLMS_SESSION->set('GQP_level_id_' . $i, $level_id[$i]); $parent_id[$i] = 0; } elseif ($i == 0 && $level_id[$i] == 0) { $level_id[$i] = 0; $_REQUEST['level_id_' . $i] = $level_id[$i]; $JLMS_SESSION->set('GQP_level_id_' . $i, $level_id[$i]); $parent_id[$i] = 0; } } for ($i = 0; $i < count($levels); $i++) { if ($i == 0 || isset($tmp[$i]->parent) && $tmp[$i]->parent) { //(Max): extra requests $query = "SELECT * FROM `#__lms_gqp_cats` WHERE parent = '" . $tmp[$i]->parent . "' ORDER BY c_category"; $JLMS_DB->setQuery($query); $groups = $JLMS_DB->loadObjectList(); if ($tmp[$i]->parent && $i > 0 && count($groups)) { $type_level[$i][] = mosHTML::makeOption(0, ' '); foreach ($groups as $group) { $type_level[$i][] = mosHTML::makeOption($group->id, $group->c_category); } $lists['level_' . $i] = mosHTML::selectList($type_level[$i], 'level_id_' . $i, 'class="inputbox" size="1" style="width:266px;" ' . $javascript, 'value', 'text', $tmp[$i]->catid); } elseif ($i == 0) { $type_level[$i][] = mosHTML::makeOption(0, ' '); foreach ($groups as $group) { $type_level[$i][] = mosHTML::makeOption($group->id, $group->c_category); } $lists['level_' . $i] = mosHTML::selectList($type_level[$i], 'level_id_' . $i, 'class="inputbox" size="1" style="width:266px;" ' . $javascript, 'value', 'text', $tmp[$i]->catid); } } } $multicat = array(); $i = 0; foreach ($lists as $key => $item) { if (substr($key, 0, 6) == 'level_') { $multicat[] = $lists['level_' . $i]; $i++; } } $data = new stdClass(); $i = 0; foreach ($multicat as $m) { if (isset($level_id[$i])) { $str_preobj = 'level_' . $i; $data->{$str_preobj} = $level_id[$i]; } $i++; } $lists['data'] = $data; //---------------------------------------------- //echo $row->c_type; die; switch ($row->c_type) { case 1: case 12: if ($row->c_type == 12) { $query = "SELECT a.*, b.imgs_name FROM #__lms_quiz_t_choice as a, #__lms_quiz_images as b WHERE a.c_question_id = '" . $row->c_id . "' AND b.imgs_id = a.c_choice ORDER BY a.ordering"; } else { $query = "SELECT * FROM #__lms_quiz_t_choice WHERE c_question_id = '" . $row->c_id . "' ORDER BY ordering"; $lists['random_answers'] = mosHTML::yesnoradioList('params[random_answers]', '', $params->get('random_answers', 0)); } $JLMS_DB->SetQuery($query); $row->choices = array(); $row->choices = $JLMS_DB->LoadObjectList(); if ($row->c_type == 12) { $query = "SELECT imgs_id, imgs_name, c_id as i_id FROM #__lms_quiz_images WHERE course_id = '" . $course_id . "'"; $JLMS_DB->SetQuery($query); $row->images = array(); $row->images = $JLMS_DB->LoadObjectList(); } $q_om_type = $row->c_type; JLMS_quiz_admin_html_class::JQ_editQuest_MChoice($row, $lists, $option, $page, $course_id, $q_om_type, $qtype_str, $params, $id, $gqp, $levels); break; case 2: case 13: if ($row->c_type == 13) { $query = "SELECT a.*, b.imgs_name FROM #__lms_quiz_t_choice as a, #__lms_quiz_images as b WHERE a.c_question_id = '" . $row->c_id . "' AND b.imgs_id = a.c_choice ORDER BY a.ordering"; } else { $query = "SELECT * FROM #__lms_quiz_t_choice WHERE c_question_id = '" . $row->c_id . "' ORDER BY ordering"; $lists['random_answers'] = mosHTML::yesnoradioList('params[random_answers]', '', $params->get('random_answers', 0)); } $JLMS_DB->SetQuery($query); $row->choices = array(); $row->choices = $JLMS_DB->LoadObjectList(); if ($row->c_type == 13) { $query = "SELECT imgs_id, imgs_name, c_id as i_id FROM #__lms_quiz_images WHERE course_id = '" . $course_id . "'"; $JLMS_DB->SetQuery($query); $row->images = array(); $row->images = $JLMS_DB->LoadObjectList(); } $q_om_type = $row->c_type; JLMS_quiz_admin_html_class::JQ_editQuest_MChoice($row, $lists, $option, $page, $course_id, $q_om_type, $qtype_str, $params, $id, $gqp, $levels); break; case 3: $query = "SELECT * FROM #__lms_quiz_t_choice WHERE c_question_id = '" . $row->c_id . "' ORDER BY ordering"; $JLMS_DB->SetQuery($query); $row->choices = array(); $row->choices = $JLMS_DB->LoadObjectList(); $row->choice_true = 1; foreach ($row->choices as $eee) { if (strtolower($eee->c_choice) == "false" && $eee->c_right == 1) { $row->choice_true = 0; } } JLMS_quiz_admin_html_class::JQ_editQuest_TrueFalse($row, $lists, $option, $page, $course_id, 3, $qtype_str, $params, $id, $gqp, $levels); break; case 4: $query = "SELECT * FROM #__lms_quiz_t_matching WHERE c_question_id = '" . $row->c_id . "' ORDER BY ordering"; $JLMS_DB->SetQuery($query); $row->matching = array(); $row->matching = $JLMS_DB->LoadObjectList(); JLMS_quiz_admin_html_class::JQ_editQuest_MDragDrop($row, $lists, $option, $page, $course_id, 4, $qtype_str, $params, $id, $gqp, $levels); break; case 5: $query = "SELECT * FROM #__lms_quiz_t_matching WHERE c_question_id = '" . $row->c_id . "' ORDER BY ordering"; $JLMS_DB->SetQuery($query); $row->matching = array(); $row->matching = $JLMS_DB->LoadObjectList(); JLMS_quiz_admin_html_class::JQ_editQuest_MDragDrop($row, $lists, $option, $page, $course_id, 5, $qtype_str, $params, $id, $gqp, $levels); break; case 6: $query = "SELECT b.*,a.c_default FROM #__lms_quiz_t_blank as a, #__lms_quiz_t_text as b WHERE a.c_question_id = '" . $row->c_id . "' and b.c_blank_id = a.c_id ORDER BY b.ordering"; $JLMS_DB->SetQuery($query); $row->blank_data = array(); $row->blank_data = $JLMS_DB->LoadObjectList(); $query = "SELECT c_default FROM #__lms_quiz_t_blank WHERE c_question_id = '" . $row->c_id . "'"; $JLMS_DB->SetQuery($query); $lists['c_def'] = $JLMS_DB->LoadResult(); JLMS_quiz_admin_html_class::JQ_editQuest_Blank($row, $lists, $option, $page, $course_id, 6, $qtype_str, $params, $id, $gqp, $levels); break; case 7: $directory_js = $JLMS_CONFIG->get('live_site') . '/images/joomlaquiz/images/'; $directory = 'images/joomlaquiz/images/'; $javascript = "onchange=\"javascript:if (document.adminForm.c_image.options[selectedIndex].value!='') {" . " document.imagelib.src='{$directory}' + document.adminForm.c_image.options[selectedIndex].value; } else {" . " document.imagelib.src='" . $JLMS_CONFIG->get('live_site') . "/images/blank.png'}\""; $imageFiles = mosReadDirectory($JLMS_CONFIG->get('absolute_path') . '/' . $directory); $images = array(mosHTML::makeOption('', '- Select Image -')); foreach ($imageFiles as $file) { if (preg_match("/bmp|gif|jpg|png/i", $file)) { $images[] = mosHTML::makeOption($file); } } $lists['images'] = mosHTML::selectList($images, 'c_image', 'class="inputbox" size="1" ' . $javascript, 'value', 'text', $row->c_image); //$lists['images'] = mosAdminMenus::images('c_image', $row->c_image, $javascript, $directory); $query = "SELECT * FROM #__lms_quiz_t_hotspot WHERE c_question_id = '" . $row->c_id . "'"; $JLMS_DB->SetQuery($query); $row->hotspot_data = array(); $row->hotspot_data = $JLMS_DB->LoadObjectList(); JLMS_quiz_admin_html_class::JQ_editQuest_HotSpot($row, $lists, $option, $page, $course_id, 7, $qtype_str, $params, $id, $gqp, $levels); break; case 8: JLMS_quiz_admin_html_class::JQ_editQuest_Survey($row, $lists, $option, $page, $course_id, 8, $qtype_str, $params, $id, $gqp, $levels); break; case 9: $query = "SELECT * FROM #__lms_quiz_t_scale WHERE c_question_id = '" . $row->c_id . "' ORDER BY ordering"; $JLMS_DB->SetQuery($query); $row->scale = array(); $row->scale = $JLMS_DB->LoadObjectList(); JLMS_quiz_admin_html_class::JQ_editQuest_Scale($row, $lists, $option, $page, $course_id, 9, $qtype_str, $params, $id, $gqp, $levels); break; case 10: JLMS_quiz_admin_html_class::JQ_editQuest_Boilerplate($row, $lists, $option, $page, $course_id, 10, $qtype_str, $params, $id, $gqp, $levels); break; case 11: $query = "SELECT a.*, b.imgs_name as left_name, c.imgs_name as right_name FROM #__lms_quiz_t_matching as a, #__lms_quiz_images as b, #__lms_quiz_images as c WHERE a.c_question_id = '" . $row->c_id . "' AND b.imgs_id = a.c_left_text AND c.imgs_id = a.c_right_text ORDER BY a.ordering"; $JLMS_DB->SetQuery($query); $row->matching = array(); $row->matching = $JLMS_DB->LoadObjectList(); $query = "SELECT imgs_id, imgs_name, c_id as i_id FROM #__lms_quiz_images WHERE course_id = '" . $course_id . "'"; $JLMS_DB->SetQuery($query); $row->images = array(); $row->images = $JLMS_DB->LoadObjectList(); JLMS_quiz_admin_html_class::JQ_editQuest_MDragDrop2($row, $lists, $option, $page, $course_id, 11, $qtype_str, $params, $id, $gqp, $levels); break; case 20: //add question from pool $query = "SELECT a.c_id AS value, a.c_question AS text" . "\n FROM #__lms_quiz_t_question AS a" . "\n WHERE a.course_id = '" . $course_id . "' " . "\n AND a.c_quiz_id = 0" . "\n ORDER BY a.ordering"; $qp_array = array(); $JLMS_DB->setQuery($query); $qp_list = $JLMS_DB->loadObjectList(); $qp_array[] = mosHTML::makeOption(0, '- Select question -'); for ($i = 0, $n = count($qp_list); $i < $n; $i++) { if (strlen(strip_tags($qp_list[$i]->text)) > 30) { $text = substr(strip_tags($qp_list[$i]->text), 0, 30) . "..."; } else { $text = strip_tags($qp_list[$i]->text); } $qp_array[] = mosHTML::makeOption($qp_list[$i]->value, $text); } $pool_quests = mosHTML::selectList($qp_array, 'c_pool', 'class="inputbox" size="1"', 'value', 'text', intval($row->c_pool)); $lists['pool_quests'] = $pool_quests; JLMS_quiz_admin_html_class::JQ_editQuest_Pool($row, $lists, $option, $page, $course_id, 20, $qtype_str); break; case 21: //add question from pool if (!$row->c_id) { $limit = intval(mosGetParam($_GET, 'limit', $JLMS_SESSION->get('list_limit', $JLMS_CONFIG->get('list_limit')))); $JLMS_SESSION->set('list_limit', $limit); $limitstart = intval(mosGetParam($_REQUEST, 'limitstart', 0)); $qtype_id = mosGetParam($_REQUEST, 'qtype_id', 0); $query = "SELECT c_pool_gqp" . "\n FROM #__lms_quiz_t_question" . "\n WHERE c_pool_gqp > 0 AND c_quiz_id = {$quiz_id}"; $JLMS_DB->setQuery($query); $result_array = $JLMS_DB->loadResultArray(); $use_ids = implode(',', $result_array); if ($use_ids) { $sql_use_ids = "\n AND a.c_id NOT IN ( {$use_ids} )"; } else { $sql_use_ids = ''; } $str = ''; //NEW MUSLTICATS /* $tmp_level = array(); $last_catid = 0; if(isset($_REQUEST['category_filter']) && $_REQUEST['category_filter']){ $last_catid = $_REQUEST['category_filter']; } else { $i=0; foreach($_REQUEST as $key=>$item){ if(preg_match('#level_id_(\d+)#', $key, $result)){ if($item){ $tmp_level[$i] = $result; $last_catid = $item; $i++; } } } } */ $query = "SELECT * FROM #__lms_gqp_cats" . "\n ORDER BY id"; $JLMS_DB->setQuery($query); $all_cats = $JLMS_DB->loadObjectList(); $tmp_cats_filter = array(); $children = array(); foreach ($all_cats as $cat) { $pt = $cat->parent; $list = @$children[$pt] ? $children[$pt] : array(); array_push($list, $cat->id); $children[$pt] = $list; } $tmp_cats_filter[0] = $last_catid; $i = 1; foreach ($children as $key => $childs) { if ($last_catid == $key) { foreach ($children[$key] as $v) { if (!in_array($v, $tmp_cats_filter)) { $tmp_cats_filter[$i] = $v; $i++; } } } } foreach ($children as $key => $childs) { if (in_array($key, $tmp_cats_filter)) { foreach ($children[$key] as $v) { if (!in_array($v, $tmp_cats_filter)) { $tmp_cats_filter[$i] = $v; $i++; } } } } $tmp_cats_filter = array_unique($tmp_cats_filter); $catids = implode(",", $tmp_cats_filter); if ($last_catid && count($tmp_cats_filter)) { $str .= "\n AND a.c_qcat IN (" . $catids . ")"; } //NEW MUSLTICATS /*Old kosmosa for ($i=count($level_id);$i>-1;$i--) { if(isset($level_id[$i]) && $level_id[$i]) { $str = "\n AND d.cat_id = ".$level_id[$i]." AND d.level = $i"; break; } } */ $qp_array = array(); $query = "SELECT a.*, b.c_qtype as qtype_full, qc1.c_category" . "\n FROM #__lms_quiz_t_question AS a" . "\n LEFT JOIN #__lms_quiz_t_qtypes b ON b.c_id = a.c_type" . "\n LEFT JOIN #__lms_quiz_t_category as qc ON a.c_qcat = qc.c_id" . "\n LEFT JOIN #__lms_gqp_cats AS qc1 ON a.c_qcat = qc1.id" . "\n WHERE a.course_id = 0 " . "\n AND a.c_quiz_id = 0" . "\n AND a.published = 1" . ($str ? $str : ' ') . ($sql_use_ids ? $sql_use_ids : ' ') . ($qtype_id ? "\n AND a.c_type = '" . $qtype_id . "'" : '') . "\n GROUP BY a.c_id" . "\n ORDER BY a.ordering"; $JLMS_DB->setQuery($query); $JLMS_DB->query(); $total = $JLMS_DB->getNumRows(); require_once _JOOMLMS_FRONT_HOME . DS . "includes" . DS . "classes" . DS . "lms.pagination.php"; $pageNav = new JLMSPageNav($total, $limitstart, $limit); $JLMS_DB->setQuery($query, $pageNav->limitstart, $pageNav->limit); $rows = $JLMS_DB->loadObjectList(); //Tooltip Right Answer (Max - 15.04.2011) for ($i = 0; $i < count($rows); $i++) { if (in_array($rows[$i]->c_type, array(1, 2, 3))) { $right_answer = ''; $query = "SELECT c_choice" . "\n FROM" . "\n #__lms_quiz_t_choice" . "\n WHERE 1" . "\n AND c_right = 1" . "\n AND c_question_id = '" . $rows[$i]->c_id . "'"; $JLMS_DB->setQuery($query); $right_answer = $JLMS_DB->loadResult(); if (strlen($right_answer)) { $rows[$i]->right_answer = $right_answer; } } else { if (in_array($rows[$i]->c_type, array(20, 21))) { if ($rows[$i]->c_type == 20) { $select_field = "c_pool"; } else { if ($rows[$i]->c_type == 21) { $select_field = "c_pool_gqp"; } } $query = "SELECT " . $select_field . "\n FROM" . "\n #__lms_quiz_t_question" . "\n WHERE 1" . "\n AND c_id = '" . $rows[$i]->c_id . "'"; $JLMS_DB->setQuery($query); $question_id = $JLMS_DB->loadResult(); $right_answer = ''; if (intval($question_id)) { $query = "SELECT b.c_choice" . "\n FROM" . "\n #__lms_quiz_t_question as a" . "\n, #__lms_quiz_t_choice as b" . "\n WHERE 1" . "\n AND a.c_id = '" . $question_id . "'" . "\n AND b.c_question_id = '" . $question_id . "'" . "\n AND a.c_type IN (" . implode(',', array(1, 2, 3)) . ")" . "\n AND b.c_right = 1"; $JLMS_DB->setQuery($query); $right_answer = $JLMS_DB->loadResult(); } if (strlen($right_answer)) { $rows[$i]->right_answer = $right_answer; } } } } //Tooltip Right Answer (Max - 15.04.2011) /*old kosmosa if(mosGetParam($_REQUEST,'filter_id_0') || isset($_SESSION['GQP_filter_id_0'])) { for($i=0;$i<count($rows);$i++) { $new_level = $rows[$i]->level+1; $query = "SELECT b.c_category FROM #__lms_gqp_levels AS a, #__lms_gqp_cats AS b WHERE a.quest_id = '".$rows[$i]->c_id."' AND a.cat_id = b.id AND a.level = '".$new_level."'"; $JLMS_DB->SetQuery($query); $cat_name = $JLMS_DB->LoadResult(); if($cat_name) { $rows[$i]->c_category = $cat_name; } } } */ // $qp_array[] = mosHTML::makeOption( 0, '- Select question -' ); // for ($i=0, $n=count( $rows ); $i < $n; $i++) { // if (strlen($rows[$i]->text) > 30) { // $text = substr($rows[$i]->text,0,30)."..."; // } else { // $text = $qp_list[$i]->text; // } // $qp_array[] = mosHTML::makeOption( $qp_list[$i]->value, $text ); // } // $pool_quests = mosHTML::selectList( $qp_array, 'c_pool', 'class="inputbox" size="1"', 'value', 'text', intval( $row->c_pool ) ); // $lists['pool_quests'] = $pool_quests; $query = "SELECT c_id AS value, c_qtype AS text" . "\n FROM #__lms_quiz_t_qtypes" . "\n ORDER BY c_id"; $JLMS_DB->setQuery($query); $qtypes_lang = $JLMS_DB->loadObjectList(); for ($i = 0; $i < count($qtypes_lang); $i++) { $j = $i + 1; $str = '_JLMS_QUIZ_QTYPE_' . $j; if (defined($str)) { $qtypes_lang[$i]->value = $j; $qtypes_lang[$i]->text = constant($str); } } $qtypes[] = mosHTML::makeOption('0', _JLMS_SB_QUIZ_SELECT_QTYPE); $qtypes = array_merge($qtypes, $qtypes_lang); $qtype = mosHTML::selectList($qtypes, 'qtype_id', 'class="inputbox" style="width:200px" size="1" ' . $javascript, 'value', 'text', $qtype_id); $lists['qtype'] = $qtype; $lists['qtype_id'] = $qtype_id; $lists['published'] = mosHTML::yesnoradioList('published', '', 1); JLMS_quiz_admin_html_class::JQ_editQuest_Pool_GQP($row, $lists, $option, $page, $course_id, 21, $qtype_str, $rows, $pageNav, $levels); } else { // $query = "SELECT a.c_id AS value, a.c_question AS text" // . "\n FROM #__lms_quiz_t_question AS a " // . "\n , #__lms_gqp_levels d, #__lms_gqp_cats qc1" // . "\n WHERE a.course_id = 0 " // . "\n AND a.c_quiz_id = 0" // . "\n AND d.quest_id = a.c_id AND d.cat_id =qc1.id " // . "\n GROUP BY d.quest_id" // . "\n ORDER BY a.ordering" // ; // // $qp_array = array(); // $JLMS_DB->setQuery( $query ); // $qp_list = $JLMS_DB->loadObjectList(); // // $qp_array[] = mosHTML::makeOption( 0, '- Select question -' ); // // for ($i=0, $n=count( $qp_list ); $i < $n; $i++) { // if (strlen($qp_list[$i]->text) > 30) { // $text = substr($qp_list[$i]->text,0,30)."..."; // } else { // $text = $qp_list[$i]->text; // } // $qp_array[] = mosHTML::makeOption( $qp_list[$i]->value, $text ); // } // // $pool_quests = mosHTML::selectList( $qp_array, 'c_pool', 'class="inputbox" size="1"', 'value', 'text', intval( $row->c_pool_gqp ) ); // $lists['pool_quests'] = $pool_quests; // JLMS_quiz_admin_html_class::JQ_editQuest_Pool_gqp_edit($row, $lists, $option, $page, $course_id, 21, $qtype_str); } break; } }
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.'); } else { echo '<div class="componentheading">' . T_('Registration Complete') . '</div><br />'; echo T_('You may now login.'); } }
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; } }
/** * Writes the edit form for new and existing categories * @param mosCategory The category object * @param string * @param array */ function edit(&$row, $section, &$lists, $redirect, $menus) { global $mosConfig_live_site, $adminLanguage; if ($row->image == "") { $row->image = 'blank.png'; } 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( "<?php echo $adminLanguage->A_COMP_SELECT_MENU; ?> " ); return; } else if ( form.link_type.value == "" ) { alert( "<?php echo $adminLanguage->A_COMP_SELECT_MENU_TYPE; ?> " ); return; } else if ( form.link_name.value == "" ) { alert( "<?php echo $adminLanguage->A_COMP_ENTER_MENU_NAME; ?> " ); return; } else if ( confirm("<?php echo $adminLanguage->A_COMP_CREATE_MENU_LINK; ?> " ) ){ submitform( pressbutton ); } else { return; } } if ( form.name.value == "" ) { alert("<?php echo $adminLanguage->A_COMP_CATEG_MUST_NAME; ?> "); } else { <?php getEditorContents('editor1', 'description'); ?> submitform(pressbutton); } } </script> <form action="index2.php" method="post" name="adminForm"> <table class="adminheading"> <tr> <th class="categories"> <?php echo $row->id ? $adminLanguage->A_COMP_EDIT : $adminLanguage->A_COMP_ADD; ?> <?php echo $adminLanguage->A_COMP_CATEG; ?> <?php echo $row->name; ?> </th> </tr> </table> <table width="100%"> <tr> <td valign="top"> <table class="adminform"> <tr> <th colspan="3"> <?php echo $adminLanguage->A_COMP_CATEG_DETAILS; ?> </th> <tr> <tr> <td> <?php echo $adminLanguage->A_COMP_CATEG_TITLE; ?> </td> <td colspan="2"> <input class="text_area" type="text" name="title" value="<?php echo $row->title; ?> " size="50" maxlength="50" title="<?php echo $adminLanguage->A_COMP_SECT_SHORT_NAME; ?> " /> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_CATEG_NAME; ?> : </td> <td colspan="2"> <input class="text_area" type="text" name="name" value="<?php echo $row->name; ?> " size="50" maxlength="255" title="<?php echo $adminLanguage->A_COMP_SECT_LONG_NAME; ?> " /> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_SECTION; ?> : </td> <td colspan="2"> <?php echo $lists['section']; ?> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_IMAGE; ?> : </td> <td> <?php echo $lists['image']; ?> </td> <td rowspan="4" width="50%"> <script language="javascript" type="text/javascript"> if (document.forms[0].image.options.value!=''){ jsimg='../images/stories/' + getSelectedValue( 'adminForm', 'image' ); } else { jsimg='../images/M_images/blank.png'; } document.write('<img src=' + jsimg + ' name="imagelib" width="80" height="80" border="2" alt="Preview" />'); </script> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_IMAGE_POSITION; ?> : </td> <td> <?php echo $lists['image_position']; ?> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_ORDERING; ?> : </td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_ACCESS_LEVEL; ?> : </td> <td> <?php echo $lists['access']; ?> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_PUBLISHED; ?> : </td> <td> <?php echo $lists['published']; ?> </td> </tr> <tr> <td valign="top"> <?php echo $adminLanguage->A_COMP_DESCRIPTION; ?> : </td> <td colspan="2"> <?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor1', $row->description, 'description', '500', '200', '50', '5'); ?> </td> </tr> </table> </td> <td valign="top"> <?php if ($row->section > 0) { ?> <table class="adminform"> <tr> <th colspan="2"> <?php echo $adminLanguage->A_COMP_LINK_TO_MENU; ?> </th> <tr> <tr> <td colspan="2"> <?php echo $adminLanguage->A_COMP_CREATE_MENU; ?> <br /><br /> </td> <tr> <tr> <td valign="top" width="100px"> <?php echo $adminLanguage->A_COMP_SELECT_MENU; ?> </td> <td> <?php echo $lists['menuselect']; ?> </td> <tr> <tr> <td valign="top" width="100px"> <?php echo $adminLanguage->A_COMP_MENU_TYPE; ?> </td> <td> <?php echo $lists['link_type']; ?> </td> <tr> <tr> <td valign="top" width="100px"> <?php echo $adminLanguage->A_COMP_MENU_NAME; ?> </td> <td> <input type="text" name="link_name" class="inputbox" value="" size="25" /> </td> <tr> <tr> <td> </td> <td> <input name="menu_link" type="button" class="button" value="<?php echo $adminLanguage->A_COMP_LINK_TO_MENU; ?> " onClick="submitbutton('menulink');" /> </td> <tr> <tr> <th colspan="2"> <?php echo $adminLanguage->A_COMP_MENU_LINKS; ?> </th> </tr> <?php if ($menus == NULL) { ?> <tr> <td colspan="2"> <?php echo $adminLanguage->A_COMP_NONE; ?> </td> </tr> <?php } else { foreach ($menus as $menu) { ?> <tr> <td colspan="2"> <hr/> </td> </tr> <tr> <td width="90px" valign="top" align="right"> <strong> <?php echo $adminLanguage->A_COMP_MENU; ?> </strong> </td> <td> <?php echo $menu->menutype; ?> </td> </tr> <tr> <td width="90px" valign="top" align="right"> <strong> <?php echo $adminLanguage->A_COMP_TYPE; ?> </strong> </td> <td> <?php echo $menu->type; ?> </td> </tr> <tr> <td width="90px" valign="top" align="right"> <strong> <?php echo $adminLanguage->A_COMP_ITEM_NAME; ?> </strong> </td> <td> <strong> <?php echo $menu->name; ?> </strong> </td> </tr> <tr> <td width="90px" valign="top" align="right"> <strong> <?php echo $adminLanguage->A_COMP_STATE; ?> </strong> </td> <td> <?php switch ($menu->published) { case -2: echo "<font color=\"red\">" . $adminLanguage->A_COMP_TRASHED . "</font>"; break; case 0: echo $adminLanguage->A_COMP_UNPUBLISHED; break; case 1: default: echo "<font color=\"green\">" . $adminLanguage->A_COMP_PUBLISHED . "</font>"; break; } ?> </td> </tr> <?php } } ?> <tr> <td colspan="2"> </td> </tr> </table> <?php } ?> </td> </tr> </table> <input type="hidden" name="option" value="com_categories" /> <input type="hidden" name="oldtitle" value="<?php echo $row->title; ?> " /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="sectionid" value="<?php echo $row->section; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?> " /> </form> <?php }
function bannerClientForm(&$row, $option) { global $adminLanguage; mosMakeHtmlSafe($row, ENT_QUOTES, 'extrainfo'); ?> <script language="javascript"> <!-- function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton == 'cancelclient') { submitform( pressbutton ); return; } // do field validation if (form.name.value == "") { alert( "<?php echo $adminLanguage->A_COMP_BANNERS_FILL_CL_NAME; ?> " ); } else if (form.contact.value == "") { alert( "<?php echo $adminLanguage->A_COMP_BANNERS_FILL_CO_NAME; ?> " ); } else if (form.email.value == "") { alert( "<?php echo $adminLanguage->A_COMP_BANNERS_FILL_CO_EMAIL; ?> " ); } else { submitform( pressbutton ); } } //--> </script> <table class="adminheading"> <tr> <th><?php echo $row->cid ? $adminLanguage->A_EDIT : $adminLanguage->A_COMP_ADD; ?> <?php echo $adminLanguage->A_COMP_BANNERS_TITLE_CLIENT; ?> </th> </tr> </table> <form action="index2.php" method="post" name="adminForm"> <table class="adminform"> <tr> <td width="10%"><?php echo $adminLanguage->A_COMP_BANNERS_CLIENT; ?> :</td> <td><input class="inputbox" type="text" name="name" size="30" maxlength="60" valign="top" value="<?php echo $row->name; ?> "></td> </tr> <tr> <td width="10%"><?php echo $adminLanguage->A_COMP_BANNERS_CONTACT_NAME; ?> :</td> <td><input class="inputbox" type="text" name="contact" size="30" maxlength="60" value="<?php echo $row->contact; ?> "></td> </tr> <tr> <td width="10%"><?php echo $adminLanguage->A_COMP_BANNERS_CONTACT_EMAIL; ?> :</td> <td><input class="inputbox" type="text" name="email" size="30" maxlength="60" value="<?php echo $row->email; ?> "></td> </tr> <tr> <td valign="top"><?php echo $adminLanguage->A_COMP_BANNERS_EXTRA; ?> :</td> <td><textarea class="inputbox" name="extrainfo" cols="60" rows="10"><?php echo str_replace('&', '&', $row->extrainfo); ?> </textarea> </td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> <input type="hidden" name="option" value="<?php echo $option; ?> "> <input type="hidden" name="cid" value="<?php echo $row->cid; ?> "> <input type="hidden" name="task" value=""> </form> <?php }
/** * Writes the edit form for new and existing content item * * A new record is defined when <var>$row</var> is passed with the <var>id</var> * property set to 0. * @param mosContent The category object * @param string The html for the groups select list */ function editContent(&$row, $section, &$lists, &$sectioncategories, &$images, $myid, &$params, $option, $redirect, &$menus) { global $mosConfig_live_site, $adminLanguage; $sec = $section; //used in metadata include mosMakeHtmlSafe($row); $mod_date = null; $create_date = null; if (intval($row->modified) != 0) { $mod_date = mosFormatDate($row->modified); } if (intval($row->created) != 0) { $create_date = mosFormatDate($row->created); } $tabs = new mosTabs(0); // used to hide "Reset Hits" when hits = 0 if (!$row->hits) { $visibility = "style='display: none; visbility: hidden;'"; } else { $visibility = ""; } ?> <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div> <link rel="stylesheet" type="text/css" media="all" href="../includes/js/calendar/calendar-mos.css" title="green" /> <!-- import the calendar script --> <script type="text/javascript" src="../includes/js/calendar/calendar.js"></script> <!-- import the language module --> <script type="text/javascript" src="../includes/js/calendar/lang/calendar-en.js"></script> <script language="javascript" type="text/javascript"> var sectioncategories = new Array; <?php $i = 0; foreach ($sectioncategories as $k => $items) { foreach ($items as $v) { echo "sectioncategories[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );\n\t\t"; } } ?> 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) . "' );\n\t\t"; } } ?> function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton =='resethits') { if (confirm("<?php echo $adminLanguage->A_COMP_CONTENT_ZERO; ?> ")){ submitform( pressbutton ); return; } else { return; } } if ( pressbutton == 'menulink' ) { if ( form.menuselect.value == "" ) { alert( "<?php echo $adminLanguage->A_COMP_SELECT_MENU; ?> " ); return; } else if ( form.link_name.value == "" ) { alert( "<?php echo $adminLanguage->A_COMP_ENTER_MENU_NAME; ?> " ); return; } else if ( confirm("<?php echo $adminLanguage->A_COMP_CREATE_MENU_LINK; ?> ") ){ submitform( pressbutton ); } else { return; } } if (pressbutton == 'cancel') { submitform( pressbutton ); return; } // assemble the images back into one field 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' ); // do field validation if (form.title.value == ""){ alert( "<?php echo $adminLanguage->A_COMP_CONTENT_MUST_TITLE; ?> " ); } else if (form.sectionid.value == "-1"){ alert( "<?php echo $adminLanguage->A_COMP_CONTENT_MUST_SECTION; ?> " ); } else if (form.catid.value == "-1"){ alert( "<?php echo $adminLanguage->A_COMP_CONTENT_MUST_CATEG; ?> " ); } else { <?php getEditorContents('editor1', 'introtext'); getEditorContents('editor2', 'fulltext'); ?> submitform( pressbutton ); } } </script> <form action="index2.php" method="post" name="adminForm"> <input type="hidden" name="images" value="" /> <table class="adminheading"> <tr> <th class="edit"> <?php echo $row->id ? $adminLanguage->A_COMP_EDITING : $adminLanguage->A_COMP_ADDING; ?> <?php echo $adminLanguage->A_COMP_CONTENT_IN; ?> <?php echo $section; ?> <?php echo $adminLanguage->A_COMP_SECTION; ?> </th> </tr> </table> <table cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="60%" valign="top"> <table width="100%" class="adminform"> <tr> <td width="100%"> <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <th colspan="4"> <?php echo $adminLanguage->A_COMP_CONTENT_ITEM_DETAILS; ?> </th> <tr> <tr> <td> <?php echo $adminLanguage->A_COMP_TITLE; ?> : </td> <td> <input class="text_area" type="text" name="title" size="30" maxlength="100" value="<?php echo $row->title; ?> " /> </td> <td> <?php echo $adminLanguage->A_COMP_SECTION; ?> : </td> <td> <?php echo $lists['sectionid']; ?> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_CONTENT_TITLE_ALIAS; ?> : </td> <td> <input name="title_alias" type="text" class="text_area" id="title_alias" value="<?php echo $row->title_alias; ?> " size="30" maxlength="100" /> </td> <td> <?php echo $adminLanguage->A_COMP_CATEG; ?> : </td> <td> <?php echo $lists['catid']; ?> </td> </tr> </table> </td> </tr> <tr> <td width="100%"> <?php echo $adminLanguage->A_COMP_CONTENT_INTRO; ?> <br /><?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor1', $row->introtext, 'introtext', 500, 200, '50', '15'); ?> </td> </tr> <tr> <td width="100%"> <?php echo $adminLanguage->A_COMP_CONTENT_MAIN; ?> <br /><?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor2', $row->fulltext, 'fulltext', 500, 350, '50', '15'); ?> </td> </tr> </table> </td> <td valign="top" width="40%"> <table> <tr> <td> <?php $tabs->startPane("content-pane"); $tabs->startTab($adminLanguage->A_COMP_CONTENT_PUBLISHING, "publish-page"); ?> <table class="adminform"> <tr> <th colspan="2"> <?php echo $adminLanguage->A_COMP_CONTENT_PUB_INFO; ?> </th> <tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_CONTENT_FRONTPAGE; ?> : </td> <td> <input type="checkbox" name="frontpage" value="1" <?php echo $row->frontpage ? 'checked="checked"' : ''; ?> /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_PUBLISHED; ?> : </td> <td> <input type="checkbox" name="published" value="1" <?php echo $row->state ? 'checked="checked"' : ''; ?> /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_ACCESS_LEVEL; ?> : </td> <td> <?php echo $lists['access']; ?> </td> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_CONTENT_AUTHOR; ?> : </td> <td> <input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php echo $row->created_by_alias; ?> " class="text_area" /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_CONTENT_CREATOR; ?> : </td> <td> <?php echo $lists['created_by']; ?> </td> </tr> <tr> <td valign="top" align="right"><?php echo $adminLanguage->A_COMP_ORDERING; ?> :</td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_CONTENT_OVERRIDE; ?> </td> <td> <input class="text_area" type="text" name="created" id="created" size="25" maxlength="19" value="<?php echo $row->created; ?> " /> <input name="reset" type="reset" class="button" onClick="return showCalendar('created', 'y-mm-dd');" value="..."> </td> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_CONTENT_START_PUB; ?> : </td> <td> <input class="text_area" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php echo $row->publish_up; ?> " /> <input type="reset" class="button" value="..." onClick="return showCalendar('publish_up', 'y-mm-dd');"> </td> </tr> <tr> <td valign="top" align="right"> <?php echo $adminLanguage->A_COMP_CONTENT_FINISH_PUB; ?> : </td> <td> <input class="text_area" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php echo $row->publish_down; ?> " /> <input type="reset" class="button" value="..." onClick="return showCalendar('publish_down', 'y-mm-dd');"> </td> </tr> </table> <br /> <table class="adminform"> <tr> <td width="90px" valign="top" align="right"> <strong><?php echo $adminLanguage->A_COMP_STATE; ?> :</strong> </td> <td> <?php echo $row->state > 0 ? $adminLanguage->A_COMP_PUBLISHED : ($row->state < 0 ? $adminLanguage->A_COMP_ARCHIVED : $adminLanguage->A_COMP_CONTENT_DRAFT_UNPUB); ?> </td> </tr> <tr > <td valign="top" align="right"> <strong> <?php echo $adminLanguage->A_COMP_HITS; ?> </strong>: </td> <td> <?php echo $row->hits; ?> <div <?php echo $visibility; ?> > <input name="reset_hits" type="button" class="button" value="<?php echo $adminLanguage->A_COMP_CONTENT_RESET_HIT; ?> " onClick="submitbutton('resethits');"> </div> </td> </tr> <tr> <td valign="top" align="right"> <strong> <?php echo $adminLanguage->A_COMP_CONTENT_REVISED; ?> </strong>: </td> <td> <?php echo $row->version; echo $adminLanguage->A_COMP_CONTENT_TIMES; ?> </td> </tr> <tr> <td valign="top" align="right"> <strong> <?php echo $adminLanguage->A_COMP_CONTENT_CREATED; ?> </strong> </td> <td> <?php echo $row->created ? "{$create_date}</td></tr><tr><td valign='top' align='right'><strong>" . $adminLanguage->A_COMP_CONTENT_BY . "</strong></td><td>{$row->creator}" : $adminLanguage->A_COMP_CONTENT_NEW_DOC; ?> </td> </tr> <tr> <td valign="top" align="right"> <strong> <?php echo $adminLanguage->A_COMP_CONTENT_LAST_MOD; ?> </strong> </td> <td> <?php echo $row->modified ? "{$mod_date}</td></tr><tr><td valign='top' align='right'><strong>" . $adminLanguage->A_COMP_CONTENT_BY . "</strong></td><td>{$row->modifier}" : $adminLanguage->A_COMP_CONTENT_NOT_MOD; ?> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab($adminLanguage->A_COMP_CONTENT_IMAGES2, $adminLanguage->A_COMP_CONT_IMG_PAGE); ?> <table class="adminform" width="100%"> <tr> <th colspan="2"> <?php echo $adminLanguage->A_COMP_CONTENT_MOSIMAGE; ?> </th> <tr> <tr> <td colspan="6"><?php echo $adminLanguage->A_COMP_CONTENT_SUB_FOLDER; ?> : <?php echo $lists['folders']; ?> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_CONTENT_GALLERY; ?> : <br /> <?php echo $lists['imagefiles']; ?> </td> <td valign="top"> <img name="view_imagefiles" src="../images/M_images/blank.png" width="100" /> </td> </tr> <tr> <td> <input class="button" type="button" value="<?php echo $adminLanguage->A_COMP_ADD; ?> " onClick="addSelectedToList('adminForm','imagefiles','imagelist')" /> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_CONTENT_IMAGES; ?> : <br /> <?php echo $lists['imagelist']; ?> </td> <td valign="top"> <img name="view_imagelist" src="../images/M_images/blank.png" width="100" /> </td> </tr> <tr> <td> <input class="button" type="button" value="<?php echo $adminLanguage->A_COMP_CONTENT_UP; ?> " onClick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" /> <input class="button" type="button" value="<?php echo $adminLanguage->A_COMP_CONTENT_DOWN; ?> " onClick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" /> <input class="button" type="button" value="<?php echo $adminLanguage->A_COMP_CONTENT_REMOVE; ?> " onClick="delSelectedFromList('adminForm','imagelist')" /> </td> </tr> <tr> <td colspan="2"> <?php echo $adminLanguage->A_COMP_CONTENT_EDIT_IMAGE; ?> : <table> <tr> <td align="right"> <?php echo $adminLanguage->A_COMP_SOURCE; ?> : </td> <td> <input class="text_area" type="text" name= "_source" value="" /> </td> </tr> <tr> <td align="right"> <?php echo $adminLanguage->A_COMP_CONTENT_ALIGN; ?> : </td> <td> <?php echo $lists['_align']; ?> </td> </tr> <tr> <td align="right"> <?php echo $adminLanguage->A_COMP_CONTENT_ALT; ?> : </td> <td> <input class="text_area" type="text" name="_alt" value="" /> </td> </tr> <tr> <td align="right"> <?php echo $adminLanguage->A_COMP_CONTENT_BORDER; ?> : </td> <td> <input class="text_area" type="text" name="_border" value="" size="3" maxlength="1" /> </td> </tr> <tr> <td colspan="2"> <input class="button" type="button" value="<?php echo $adminLanguage->A_COMP_CONTENT_APPLY; ?> " onClick="applyImageProps()" /> </td> </tr> </table> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab($adminLanguage->A_COMP_CONT_PARAMETERS, "params-page"); ?> <table class="adminform"> <tr> <th colspan="2"> <?php echo $adminLanguage->A_COMP_CONTENT_PARAM; ?> </th> <tr> <tr> <td> <?php echo $adminLanguage->A_COMP_CONTENT_PARAM_MESS; ?> <br /><br /> </td> </tr> <tr> <td> <?php echo $params->render(); ?> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab($adminLanguage->A_COMP_CONTENT_META_INFO, $adminLanguage->A_COMP_CONF_META_PAGE); ?> <table class="adminform"> <tr> <th colspan="2"> <?php echo $adminLanguage->A_COMP_CONTENT_META_DATA; ?> </th> <tr> <tr> <td> <?php echo $adminLanguage->A_COMP_DESCRIPTION; ?> : <br /> <textarea class="text_area" cols="30" rows="3" style="width:300px; height:50px" name="metadesc" width="500"><?php echo str_replace('&', '&', $row->metadesc); ?> </textarea> </td> </tr> <tr> <td> <?php echo $adminLanguage->A_COMP_CONTENT_KEYWORDS; ?> : <br /> <textarea class="text_area" cols="30" rows="3" style="width:300px; height:50px" name="metakey" width="500"><?php echo str_replace('&', '&', $row->metakey); ?> </textarea> </td> </tr> <tr> <td> <input type="button" class="button" value="<?php echo $adminLanguage->A_COMP_CONTENT_ADD_ETC; ?> " onClick="f=document.adminForm;f.metakey.value=document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].text+', '+getSelectedText('adminForm','catid')+', '+f.title.value+f.metakey.value;" /> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab($adminLanguage->A_COMP_CONTENT_LINK_TO_MENU, $adminLanguage->A_COMP_CONTENT_LINK_PAGE); ?> <table class="adminform"> <tr> <th colspan="2"> <?php echo $adminLanguage->A_COMP_LINK_TO_MENU; ?> </th> <tr> <tr> <td colspan="2"> <?php echo $adminLanguage->A_COMP_CONTENT_LINK_CI; ?> <br /><br /> </td> <tr> <tr> <td valign="top" width="90px"> <?php echo $adminLanguage->A_COMP_SELECT_MENU; ?> </td> <td> <?php echo $lists['menuselect']; ?> </td> <tr> <tr> <td valign="top" width="90px"> <?php echo $adminLanguage->A_COMP_MENU_NAME; ?> </td> <td> <input type="text" name="link_name" class="inputbox" value="" size="30" /> </td> <tr> <tr> <td> </td> <td> <input name="menu_link" type="button" class="button" value="<?php echo $adminLanguage->A_COMP_LINK_TO_MENU; ?> " onClick="submitbutton('menulink');" /> </td> <tr> <tr> <th colspan="2"> <?php echo $adminLanguage->A_COMP_MENU_LINKS; ?> </th> </tr> <?php if ($menus == NULL) { ?> <tr> <td colspan="2"> <?php echo $adminLanguage->A_COMP_NONE; ?> </td> </tr> <?php } else { foreach ($menus as $menu) { ?> <tr> <td colspan="2"> <hr/> </td> </tr> <tr> <td width="90px" valign="top"> <?php echo $adminLanguage->A_COMP_MENU; ?> </td> <td> <?php echo $menu->menutype; ?> </td> </tr> <tr> <td width="90px" valign="top"> <?php echo $adminLanguage->A_COMP_CONTENT_LINK_NAME; ?> </td> <td> <strong> <?php echo $menu->name; ?> </strong> </td> </tr> <tr> <td width="90px" valign="top"> <?php echo $adminLanguage->A_COMP_STATE; ?> </td> <td> <?php switch ($menu->published) { case -2: echo "<font color=\"red\">" . $adminLanguage->A_COMP_TRASHED . "</font>"; break; case 0: echo $adminLanguage->A_COMP_UNPUBLISHED; break; case 1: default: echo "<font color=\"green\">" . $adminLanguage->A_COMP_PUBLISHED . "</font>"; break; } ?> </td> </tr> <?php } } ?> <tr> <td colspan="2"> </td> </tr> </table> <?php $tabs->endTab(); $tabs->endPane(); ?> </td> </tr> </table> </td> </tr> </table> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="version" value="<?php echo $row->version; ?> " /> <input type="hidden" name="mask" value="0" /> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?> " /> <input type="hidden" name="task" value="" /> </form> <script language="Javascript" src="<?php echo $mosConfig_live_site; ?> /includes/js/overlib_mini.js"></script> <?php }
/** * The function from com_registration! * Registers a user into Mambo/Joomla * * @return boolean True when the registration process was successful, False when not */ function saveRegistration() { global $database, $acl, $vmLogger, $mosConfig_useractivation, $mosConfig_allowUserRegistration, $mosConfig_live_site; if ($mosConfig_allowUserRegistration == '0') { mosNotAuth(); return false; } $row = new mosUser($database); if (!$row->bind($_POST, 'usertype')) { $error = vmHtmlEntityDecode($row->getError()); $vmLogger->err($error); echo "<script type=\"text/javascript\"> alert('" . $error . "');</script>\n"; return false; } mosMakeHtmlSafe($row); $usergroup = 'Registered'; $row->id = 0; $row->usertype = $usergroup; $row->gid = $acl->get_group_id($usergroup, 'ARO'); if ($mosConfig_useractivation == '1') { $row->activation = md5(vmGenRandomPassword()); $row->block = '1'; } if (!$row->check()) { $error = vmHtmlEntityDecode($row->getError()); $vmLogger->err($error); echo "<script type=\"text/javascript\"> alert('" . $error . "');</script>\n"; return false; } $pwd = $row->password; $row->password = md5($row->password); $row->registerDate = date('Y-m-d H:i:s'); if (!$row->store()) { $error = vmHtmlEntityDecode($row->getError()); $vmLogger->err($error); echo "<script type=\"text/javascript\"> alert('" . $error . "');</script>\n"; return false; } $row->checkin(); $name = $row->name; $email = $row->email; $username = $row->username; $component = vmIsJoomla(1.5) ? 'com_user' : 'com_registration'; $activation_link = $mosConfig_live_site . "/index.php?option={$component}&task=activate&activation=" . $row->activation; // Send the registration email $this->_sendMail($name, $email, $username, $pwd, $activation_link); return true; }
public static function bannerClientForm(&$row, $option) { mosMakeHtmlSafe($row, ENT_QUOTES, 'extrainfo'); ?> <script language="javascript" type="text/javascript"> <!-- function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton == 'cancelclient') { submitform( pressbutton ); return; } // do field validation if (form.name.value == "") { alert( "Please fill in the Client Name." ); } else if (form.contact.value == "") { alert( "Please fill in the Contact Name." ); } else if (form.email.value == "") { alert( "Please fill in the Contact E-mail." ); } else { submitform( pressbutton ); } } //--> </script> <table class="adminheading"> <tr> <th> Banner Client: <small> <?php echo $row->cid ? 'Edit' : 'New'; ?> </small> </th> </tr> </table> <form action="index2.php" method="post" name="adminForm"> <table class="adminform"> <tr> <th colspan="2"> Details </th> </tr> <tr> <td width="10%"> Client Name: </td> <td> <input class="inputbox" type="text" name="name" size="30" maxlength="60" valign="top" value="<?php echo $row->name; ?> " /> </td> </tr> <tr> <td width="10%"> Contact Name: </td> <td> <input class="inputbox" type="text" name="contact" size="30" maxlength="60" value="<?php echo $row->contact; ?> " /> </td> </tr> <tr> <td width="10%"> Contact E-mail: </td> <td> <input class="inputbox" type="text" name="email" size="30" maxlength="60" value="<?php echo $row->email; ?> " /> </td> </tr> <tr> <td valign="top"> Extra Info: </td> <td> <textarea class="inputbox" name="extrainfo" cols="60" rows="10"><?php echo str_replace('&', '&', $row->extrainfo); ?> </textarea> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="cid" value="<?php echo $row->cid; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
function saveRegistration() { global $database, $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; } // simple spoof check security josSpoofCheck(); $row = new mosUser($database); if (!$row->bind($_POST, 'usertype')) { mosErrorAlert($row->getError()); } $row->name = trim($row->name); $row->email = trim($row->email); $row->username = trim($row->username); $row->password = trim($row->password); 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('" . html_entity_decode($row->getError()) . "'); window.history.go(-1); </script>\n"; exit; } $pwd = $row->password; $salt = mosMakePassword(16); $crypt = md5($row->password . $salt); $row->password = $crypt . ':' . $salt; $row->registerDate = date('Y-m-d H:i:s'); if (!$row->store()) { echo "<script> alert('" . html_entity_decode($row->getError()) . "'); window.history.go(-1); </script>\n"; exit; } $row->checkin(); $name = trim($row->name); $email = trim($row->email); $username = trim($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); // check if Global Config `mailfrom` and `fromname` values exist if ($mosConfig_mailfrom != '' && $mosConfig_fromname != '') { $adminName2 = $mosConfig_fromname; $adminEmail2 = $mosConfig_mailfrom; } else { // use email address and name of first superadmin for use in email sent to user $query = "SELECT name, email" . "\n FROM #__users" . "\n WHERE LOWER( usertype ) = 'superadministrator'" . "\n OR LOWER( usertype ) = 'super administrator'"; $database->setQuery($query); $rows = $database->loadObjectList(); $row2 = $rows[0]; $adminName2 = $row2->name; $adminEmail2 = $row2->email; } // Send email to user 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 email addresses of all admins and superadmins set to recieve system emails $query = "SELECT email, sendEmail" . "\n FROM #__users" . "\n WHERE ( gid = 24 OR gid = 25 )" . "\n AND sendEmail = 1" . "\n AND block = 0"; $database->setQuery($query); $admins = $database->loadObjectList(); foreach ($admins as $admin) { // send email to admin & super admin set to recieve system emails mosMail($adminEmail2, $adminName2, $admin->email, $subject2, $message2); } if ($mosConfig_useractivation == 1) { echo _REG_COMPLETE_ACTIVATE; } else { echo _REG_COMPLETE; } }
function editApplication(&$row) { mosMakeHtmlSafe($row); mosCommonHTML::loadOverlib(); ?> <script language="javascript" type="text/javascript"> function submitbutton(pressbutton) { var form = document.adminForm; if(pressbutton == 'cancel') { submitform(pressbutton); return; } // validation if(form.title.value == "") alert( "Application must have a title" ); else if(form.custom_script.value == "" && form.path.value == "") alert( "You have to define a path to a script file OR write down a script" ); else submitform(pressbutton); } </script> <form action="index2.php?option=com_jumi" method="post" name="adminForm"> <table class="adminheading"> <tr> <th class="edit"> Application Manager: <small><small>[ <?php echo $row->title ? $row->title : 'New'; ?> ]</small></small> </th> </tr> </table> <table class="adminform" width="100%"> <tr> <td width="200" class="key"> <label for="title"> Title: </label> </td> <td> <input class="inputbox" type="text" name="title" id="title" size="60" value="<?php echo @$row->title; ?> " /> </td> </tr> <tr> <td width="200" class="key"> <label for="alias"> Alias: </label> </td> <td> <input class="inputbox" type="text" name="alias" id="alias" size="60" value="<?php echo @$row->alias; ?> " /> </td> </tr> <tr> <td class="key"> <label for="custom_script"> <span onMouseOver="return overlib('<table><tr><td>Put here any code you want to include like php, html or javascript.<td></tr></table>', CAPTION, 'Custom Script', BELOW, RIGHT);" onMouseOut="return nd();">Custom Script:</span> </label> </td> <td> <p><textarea name="custom_script" id="custom_script" cols="80" rows="10"><?php echo @$row->custom_script; ?> </textarea></p> </td> </tr> <tr> <td class="key"> <label for="path"> <span onMouseOver="return overlib('<table><tr><td>Pathname of the file to be included after the custom script. If you are using Jumi arguments in the included file just define $jumi[] array in Custom script above.<td></tr></table>', CAPTION, 'Pathname', BELOW, RIGHT);" onMouseOut="return nd();">Pathname:</span> </label> </td> <td> <input class="inputbox" type="text" name="path" id="path" size="60" value="<?php echo @$row->path; ?> " /> </td> </tr> </table> <input type="hidden" name="option" value="com_jumi" /> <input type="hidden" name="cid" value="<?php echo @$row->id; ?> " /> <input type="hidden" name="mask" value="0" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="images" value="" /> <input type="hidden" name="hidemainmenu" value="0" /> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
/** * Writes the edit form for new and existing content item * * A new record is defined when <var>$row</var> is passed with the <var>id</var> * property set to 0. * @param mosContent The category object * @param string The html for the groups select list */ function editContent(&$row, $section, &$lists, &$sectioncategories, &$images, &$params, $option, $redirect, &$menus) { global $mosConfig_live_site; mosMakeHtmlSafe($row); $create_date = null; if (intval($row->created) != 0) { $create_date = mosFormatDate($row->created, '%A, %d %B %Y %H:%M', '0'); } $mod_date = null; if (intval($row->modified) != 0) { $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; visbility: hidden;'"; } else { $visibility = ""; } mosCommonHTML::loadOverlib(); mosCommonHTML::loadCalendar(); ?> <script language="javascript" type="text/javascript"> <!-- var sectioncategories = new Array; <?php $i = 0; foreach ($sectioncategories as $k => $items) { foreach ($items as $v) { echo "sectioncategories[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );\n\t\t"; } } ?> 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) . "' );\n\t\t"; } } ?> function submitbutton(pressbutton) { var form = document.adminForm; if ( pressbutton == 'menulink' ) { if ( form.menuselect.value == "" ) { alert( "<?php echo T_('Please select a Menu'); ?> " ); return; } else if ( form.link_name.value == "" ) { alert( "<?php echo T_('Please enter a Name for this menu item'); ?> " ); return; } } if (pressbutton == 'cancel') { submitform( pressbutton ); return; } // assemble the images back into one field 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' ); // do field validation if (form.title.value == ""){ alert( "<?php echo T_('Content item must have a title'); ?> " ); } else if (form.sectionid.value == "-1"){ alert( "<?php echo T_('You must select a Section.'); ?> " ); } else if (form.catid.value == "-1"){ alert( "<?php echo T_('You must select a Category.'); ?> " ); } else if (form.catid.value == ""){ alert( "<?php echo T_('You must select a Category.'); ?> " ); } else { <?php getEditorContents('editor1', 'introtext'); ?> <?php getEditorContents('editor2', 'fulltext'); ?> submitform( pressbutton ); } } // show / hide publishing information function displayParameterInfo() { if(document.getElementById('simpleediting').style.display == 'block') { document.getElementById('simpleediting').style.display = 'none'; document.getElementById('show').style.display = 'block'; document.getElementById('hide').style.display = 'none'; document.adminForm.simple_editing.value ='on'; } else { document.getElementById('simpleediting').style.display = 'block'; document.getElementById('show').style.display = 'none'; document.getElementById('hide').style.display = 'block'; document.adminForm.simple_editing.value ='off'; } } //--> </script> <?php if ($_SESSION['simple_editing'] == 'on') { $simpleediting = 'none'; $simple = 'block'; $advanced = 'none'; } else { $advanced = 'block'; $simple = 'none'; $simpleediting = 'block'; } ?> <form action="index2.php" method="post" name="adminForm"> <input type ="hidden" name="simple_editing" value='' /> <table class="adminheading" border="1"> <tr> <th class="edit"> <?php echo T_('Content Item:'); ?> <small> <?php echo $row->id ? T_('Edit') : T_('New'); ?> </small> <?php if ($row->id) { ?> <small><small> [ <?php echo T_('Section:'); ?> <?php echo $section; ?> ] </small></small> <?php } ?> </th> </tr> </table> <table width="100%"> <tr> <td valign="top" align="right"> <div id = "show" style="display:<?php echo $simple; ?> "> <a href="javascript:displayParameterInfo();"><?php echo T_('Show Advanced Details'); ?> </a> </div> <div id = "hide" style="display:<?php echo $advanced; ?> "> <a href="javascript:displayParameterInfo();"><?php echo T_('Hide Advanced Details'); ?> </a> </div> </td> </tr> </table> <table cellspacing="0" cellpadding="0" width="100%" > <tr> <td valign="top"> <table width="100%" class="adminform"> <tr> <td width="500"> <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr > <th colspan="4"> <?php echo T_('Item Details'); ?> </th> </tr> <tr> <td> <?php echo T_('Title:'); ?> </td> <td> <input class="text_area" type="text" name="title" size="30" maxlength="100" value="<?php echo $row->title; ?> " /> </td> <td> <?php echo T_('Section:'); ?> </td> <td> <?php echo $lists['sectionid']; ?> </td> </tr> <tr> <td> <?php echo T_('Title Alias:'); ?> </td> <td> <input name="title_alias" type="text" class="text_area" id="title_alias" value="<?php echo $row->title_alias; ?> " size="30" maxlength="100" /> </td> <td> <?php echo T_('Category:'); ?> </td> <td> <?php echo $lists['catid']; ?> </td> </tr> </table> </td> </tr> <tr> <td width="100%"> <?php echo T_('Intro Text:'); ?> (<?php echo T_('required'); ?> ) <br /><?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor1', $row->introtext, 'introtext', '100%;', '200', '75', '20'); ?> </td> </tr> <tr> <td width="100%"> <?php echo T_('Main Text:'); ?> (<?php echo T_('optional'); ?> ) <br /><?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor2', $row->fulltext, 'fulltext', '100%;', '350', '75', '30'); ?> </td> </tr> </table> </td> <td valign="top" align="right"> <div id="simpleediting" style="display:<?php echo $simpleediting; ?> "> <table width="100%" > <tr> <td width="200"> <table width="400"> <tr> <td > <?php $tabs->startPane("content-pane"); $tabs->startTab(T_("Publishing"), "publish-page"); ?> <table class="adminform"> <tr> <th colspan="2"> <?php echo T_('Publishing Info'); ?> </th> </tr> <tr> <td valign="top" align="right"> <?php echo T_('Show on Frontpage:'); ?> </td> <td> <input type="checkbox" name="frontpage" value="1" <?php echo $row->frontpage ? 'checked="checked"' : ''; ?> /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo T_('Published:'); ?> </td> <td> <input type="checkbox" name="published" value="1" <?php echo $row->state ? 'checked="checked"' : ''; ?> /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo T_('Access Level:'); ?> </td> <td> <?php echo $lists['access']; ?> </td> </tr> <tr> <td valign="top" align="right"> <?php echo T_('Author Alias:'); ?> </td> <td> <input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php echo $row->created_by_alias; ?> " class="text_area" /> </td> </tr> <tr> <td valign="top" align="right"> <?php // cause Mambo to be extremely slow w/ huge user table, comment out for now echo T_('Change Creator:'); ?> </td> <td> <?php // cause Mambo to be extremely slow w/ huge user table, comment out for now echo $lists['created_by']; ?> </td> </tr> <tr> <td valign="top" align="right"><?php echo T_('Ordering:'); ?> </td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td valign="top" align="right"> <?php echo T_('Override Created Date'); ?> </td> <td> <input class="text_area" type="text" name="created" id="created" size="25" maxlength="19" value="<?php echo $row->created; ?> " /> <input name="reset" type="reset" class="button" onClick="return showCalendar('created', 'y-mm-dd');" value="..." /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo T_('Start Publishing:'); ?> </td> <td> <input class="text_area" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php echo $row->publish_up; ?> " /> <input type="reset" class="button" value="..." onClick="return showCalendar('publish_up', 'y-mm-dd');" /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo T_('Finish Publishing:'); ?> </td> <td> <input class="text_area" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php echo $row->publish_down; ?> " /> <input type="reset" class="button" value="..." onClick="return showCalendar('publish_down', 'y-mm-dd');" /> </td> </tr> </table> <br /> <table class="adminform"> <?php if ($row->id) { ?> <tr> <td> <strong><?php echo T_('Content ID:'); ?> </strong> </td> <td> <?php echo $row->id; ?> </td> </tr> <?php } ?> <tr> <td width="90px" valign="top" align="right"> <strong><?php echo T_('State:'); ?> </strong> </td> <td> <?php echo $row->state > 0 ? T_('Published') : ($row->state < 0 ? T_('Archived') : T_('Draft Unpublished')); ?> </td> </tr> <tr > <td valign="top" align="right"> <strong> <?php echo T_('Hits'); ?> </strong>: </td> <td> <?php echo $row->hits; ?> <div <?php echo $visibility; ?> > <input name="reset_hits" type="button" class="button" value="<?php echo T_('Reset Hit Count'); ?> " onClick="submitbutton('resethits');" /> </div> </td> </tr> <tr> <td valign="top" align="right"> <strong> <?php echo T_('Revised'); ?> </strong>: </td> <td> <?php echo $row->version; ?> <?php echo T_('times'); ?> </td> </tr> <tr> <td valign="top" align="right"> <strong> <?php echo T_('Created'); ?> </strong> </td> <td> <?php echo $row->created ? "{$create_date}</td></tr><tr><td valign='top' align='right'><strong>" . T_('By') . "</strong></td><td>{$row->creator}" : "New document"; ?> </td> </tr> <tr> <td valign="top" align="right"> <strong> <?php echo T_('Last Modified'); ?> </strong> </td> <td> <?php echo $row->modified ? "{$mod_date}</td></tr><tr><td valign='top' align='right'><strong>" . T_('By') . "</strong></td><td>{$row->modifier}" : "Not modified"; ?> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab(T_("Images"), "images-page"); ?> <table class="adminform" width="100%"> <tr> <th colspan="2"> <?php echo T_('MOSImage Control'); ?> </th> </tr> <tr> <td colspan="6"><?php echo T_('Sub-folder:'); ?> <?php echo $lists['folders']; ?> </td> </tr> <tr> <td> <?php echo T_('Gallery Images:'); ?> <br /> <?php echo $lists['imagefiles']; ?> </td> <td valign="top"> <img name="view_imagefiles" src="../images/M_images/blank.png" width="100" /> </td> </tr> <tr> <td> <input class="button" type="button" value="<?php echo T_('Add'); ?> " onClick="addSelectedToList('adminForm','imagefiles','imagelist')" /> </td> </tr> <tr> <td> <?php echo T_('Content Images:'); ?> <br /> <?php echo $lists['imagelist']; ?> </td> <td valign="top"> <img name="view_imagelist" src="../images/M_images/blank.png" width="100" /> </td> </tr> <tr> <td> <input class="button" type="button" value="<?php echo T_('up'); ?> " onClick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" /> <input class="button" type="button" value="<?php echo T_('down'); ?> " onClick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" /> <input class="button" type="button" value="<?php echo T_('remove'); ?> " onClick="delSelectedFromList('adminForm','imagelist')" /> </td> </tr> <tr> <td colspan="2"> <?php echo T_('Edit the image selected:'); ?> <table> <tr> <td align="right"> <?php echo T_('Source:'); ?> </td> <td> <input class="text_area" type="text" name= "_source" value="" /> </td> </tr> <tr> <td align="right"> <?php echo T_('Image Align:'); ?> </td> <td> <?php echo $lists['_align']; ?> </td> </tr> <tr> <td align="right"> <?php echo T_('Alt Text:'); ?> </td> <td> <input class="text_area" type="text" name="_alt" value="" /> </td> </tr> <tr> <td align="right"> <?php echo T_('Border:'); ?> </td> <td> <input class="text_area" type="text" name="_border" value="" size="3" maxlength="1" /> </td> </tr> <tr> <td align="right"> <?php echo T_('Caption:'); ?> </td> <td> <input class="text_area" type="text" name="_caption" value="" size="30" /> </td> </tr> <tr> <td align="right"> <?php echo T_('Caption Position:'); ?> </td> <td> <?php echo $lists['_caption_position']; ?> </td> </tr> <tr> <td align="right"> <?php echo T_('Caption Align:'); ?> </td> <td> <?php echo $lists['_caption_align']; ?> </td> </tr> <tr> <td align="right"> <?php echo T_('Width:'); ?> </td> <td> <input class="text_area" type="text" name="_width" value="" size="5" maxlength="5" /> </td> </tr> <tr> <td colspan="2"> <input class="button" type="button" value="<?php echo T_('Apply'); ?> " onClick="applyImageProps()" /> </td> </tr> </table> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab(T_("Parameters"), "params-page"); ?> <table class="adminform"> <tr> <th colspan="2"> <?php echo T_('Parameter Control'); ?> </th> </tr> <tr> <td> * <?php echo T_('These Parameters only control what you see when you click to view an item fully'); ?> * <br /><br /> </td> </tr> <tr> <td> <?php echo $params->render(); ?> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab(T_("Meta Info"), "metadata-page"); ?> <table class="adminform"> <tr> <th colspan="2"> <?php echo T_('Meta Data'); ?> </th> </tr> <tr> <td> <?php echo T_('Description:'); ?> <br /> <textarea class="text_area" cols="30" rows="3" style="width:300px; height:50px" name="metadesc" width="500"><?php echo str_replace('&', '&', $row->metadesc); ?> </textarea> </td> </tr> <tr> <td> <?php echo T_('Keywords:'); ?> <br /> <textarea class="text_area" cols="30" rows="3" style="width:300px; height:50px" name="metakey" width="500"><?php echo str_replace('&', '&', $row->metakey); ?> </textarea> </td> </tr> <tr> <td> <input type="button" class="button" value="<?php echo T_('Add Sect/Cat/Title'); ?> " onClick="f=document.adminForm;f.metakey.value=document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].text+', '+getSelectedText('adminForm','catid')+', '+f.title.value+f.metakey.value;" /> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab(T_("Link to Menu"), "link-page"); ?> <table class="adminform"> <tr> <th colspan="2"> <?php echo T_('Link to Menu'); ?> </th> </tr> <tr> <td colspan="2"> <?php echo T_("This will create a 'Link - Content Item' in the menu you select"); ?> <br /><br /> </td> </tr> <tr> <td valign="top" width="90px"> <?php echo T_('Select a Menu'); ?> </td> <td> <?php echo $lists['menuselect']; ?> </td> </tr> <tr> <td valign="top" width="90px"> <?php echo T_('Menu Item Name'); ?> </td> <td> <input type="text" name="link_name" class="inputbox" value="" size="30" /> </td> </tr> <tr> <td> </td> <td> <input name="menu_link" type="button" class="button" value="<?php echo T_('Link to Menu'); ?> " onClick="submitbutton('menulink');" /> </td> </tr> <tr> <th colspan="2"> <?php echo T_('Existing Menu Links'); ?> </th> </tr> <?php if ($menus == NULL) { ?> <tr> <td colspan="2"> <?php echo T_('None'); ?> </td> </tr> <?php } else { mosCommonHTML::menuLinksContent($menus); } ?> <tr> <td colspan="2"> </td> </tr> </table> <?php $tabs->endTab(); $tabs->endPane(); ?> </td> </tr> </table> </td> </tr> </table> </div> </td> </tr> </table> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="version" value="<?php echo $row->version; ?> " /> <input type="hidden" name="mask" value="0" /> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="images" value="" /> <input type="hidden" name="hidemainmenu" value="0" /> </form> </td> </tr> </table> <?php }
function editDocumentForm(&$row, &$lists, $last, $created, &$params) { global $Itemid; global $_DOCMAN, $_DMUSER; require_once $GLOBALS['mosConfig_absolute_path'] . '/includes/HTML_toolbar.php'; mosMakeHtmlSafe($row); ob_start(); ?> <form action="index.php" method="post" name="adminForm" onsubmit="javascript:setgood();" id="dm_frmedit" class="dm_form"> <?php $tabs = new dmTabs(0); echo $tabs->startPane("content-pane"); echo $tabs->startTab(_DML_DOCUMENT, "document-page"); HTML_DMDocuments::_showTabDocument($row, $lists, $last, $created); echo $tabs->endTab(); echo $tabs->startTab(_DML_TAB_PERMISSIONS, "permissions-page"); HTML_DMDocuments::_showTabPermissions($row, $lists, $last, $created); echo $tabs->endTab(); echo $tabs->startTab(_DML_TAB_LICENSE, "license-page"); HTML_DMDocuments::_showTabLicense($row, $lists, $last, $created); if (isset($params)) { echo $tabs->endTab(); echo $tabs->startTab(_DML_TAB_DETAILS, "details-page"); HTML_DMDocuments::_showTabDetails($row, $lists, $last, $created, $params); } echo $tabs->endTab(); echo $tabs->endPane(); ?> <br /> <p> <label class="nofloat" for="dmdescription"><?php echo _DML_DESCRIPTION; ?> </label><br /> <?php // parameters : areaname, content, hidden field, width, height, rows, cols DOCMAN_Compat::editorArea('editor1', $row->dmdescription, 'dmdescription', '550', '250', '50', '10'); ?> </p> <input type="hidden" name="goodexit" value="0" /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="option" value="com_docman" /> <input type="hidden" name="task" value="doc_save" /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " /> <input type="hidden" name="dmcounter" value="<?php echo $row->dmcounter; ?> " /> <?php echo DOCMAN_token::render(); ?> </form> <?php $html = ob_get_contents(); ob_end_clean(); return $html; }
/** * Writes the edit form for new and existing content item * * A new record is defined when <var>$row</var> is passed with the <var>id</var> * property set to 0. * @param mosContent The category object * @param string The html for the groups select list */ function editContent(&$row, $section, &$lists, &$images, &$access, $myid, $sectionid, $task, $Itemid) { global $mosConfig_live_site, $mainframe; mosMakeHtmlSafe($row); require_once $GLOBALS['mosConfig_absolute_path'] . '/includes/HTML_toolbar.php'; // used for spoof hardening $validate = josSpoofValue(); $Returnid = intval(mosGetParam($_REQUEST, 'Returnid', $Itemid)); $tabs = new mosTabs(0, 1); $mainframe->addCustomHeadTag('<link rel="stylesheet" type="text/css" media="all" href="includes/js/calendar/calendar-mos.css" title="green" />'); ?> <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div> <!-- import the calendar script --> <script language="javascript" type="text/javascript" src="<?php echo $mosConfig_live_site; ?> /includes/js/calendar/calendar_mini.js"></script> <!-- import the language module --> <script language="javascript" type="text/javascript" src="<?php echo $mosConfig_live_site; ?> /includes/js/calendar/lang/calendar-en.js"></script> <script language="javascript" type="text/javascript" src="<?php echo $mosConfig_live_site; ?> /includes/js/overlib_mini.js"></script> <script language="javascript" type="text/javascript"> onunload = WarnUser; var folderimages = new Array; <?php $i = 0; foreach ($images as $k => $items) { foreach ($items as $v) { echo "\n\tfolderimages[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );"; } } ?> function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton == 'cancel') { submitform( pressbutton ); return; } // var goodexit=false; // assemble the images back into one field form.goodexit.value=1; 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 { form.onsubmit(); } catch(e){} // do field validation if (form.title.value == "") { alert ( "<?php echo addslashes(_E_WARNTITLE); ?> " ); } else if (parseInt('<?php echo $row->sectionid; ?> ')) { // for content items if (getSelectedValue('adminForm','catid') < 1) { alert ( "<?php echo addslashes(_E_WARNCAT); ?> " ); //} else if (form.introtext.value == "") { // alert ( "<?php echo addslashes(_E_WARNTEXT); ?> " ); } else { <?php getEditorContents('editor1', 'introtext'); getEditorContents('editor2', 'fulltext'); ?> submitform(pressbutton); } //} else if (form.introtext.value == "") { // alert ( "<?php echo addslashes(_E_WARNTEXT); ?> " ); } else { // for static content <?php getEditorContents('editor1', 'introtext'); ?> submitform(pressbutton); } } function setgood(){ document.adminForm.goodexit.value=1; } function WarnUser(){ if (document.adminForm.goodexit.value==0) { alert('<?php echo addslashes(_E_WARNUSER); ?> '); window.location="<?php echo sefRelToAbs("index.php?option=com_content&task=" . $task . "§ionid=" . $sectionid . "&id=" . $row->id . "&Itemid=" . $Itemid); ?> "; } } </script> <?php $docinfo = "<strong>" . _E_EXPIRES . "</strong> "; $docinfo .= $row->publish_down . "<br />"; $docinfo .= "<strong>" . _E_VERSION . "</strong> "; $docinfo .= $row->version . "<br />"; $docinfo .= "<strong>" . _E_CREATED . "</strong> "; $docinfo .= $row->created . "<br />"; $docinfo .= "<strong>" . _E_LAST_MOD . "</strong> "; $docinfo .= $row->modified . "<br />"; $docinfo .= "<strong>" . _E_HITS . "</strong> "; $docinfo .= $row->hits . "<br />"; ?> <form action="index.php" method="post" name="adminForm" onSubmit="javascript:setgood();"> <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <td class="contentheading" > <?php echo $section; ?> / <?php echo $row->id ? _E_EDIT : _E_ADD; ?> <?php echo _E_CONTENT; ?> <a href="javascript: void(0);" onMouseOver="return overlib('<table><?php echo $docinfo; ?> </table>', CAPTION, '<?php echo _E_ITEM_INFO; ?> ', BELOW, RIGHT);" onMouseOut="return nd();"> <strong>[Info]</strong> </a> </td> </tr> </table> <table class="adminform"> <tr> <td> <div style="float: left;"> <?php echo _E_TITLE; ?> <br /> <input class="inputbox" type="text" name="title" size="50" maxlength="100" value="<?php echo $row->title; ?> " /> </div> <div style="float: right;"> <?php // Toolbar Top mosToolBar::startTable(); mosToolBar::save(); mosToolBar::apply('apply_new'); mosToolBar::cancel(); mosToolBar::endtable(); ?> </div> </td> </tr> <?php if ($row->sectionid) { ?> <tr> <td> <?php echo _E_CATEGORY; ?> <br /> <?php echo $lists['catid']; ?> </td> </tr> <?php } ?> <tr> <?php if (intval($row->sectionid) > 0) { ?> <td> <?php echo _E_INTRO . ' (' . _CMN_REQUIRED . ')'; ?> : </td> <?php } else { ?> <td> <?php echo _E_MAIN . ' (' . _CMN_REQUIRED . ')'; ?> : </td> <?php } ?> </tr> <tr> <td> <?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor1', $row->introtext, 'introtext', '600', '400', '70', '15'); ?> </td> </tr> <?php if (intval($row->sectionid) > 0) { ?> <tr> <td> <?php echo _E_MAIN . ' (' . _CMN_OPTIONAL . ')'; ?> : </td> </tr> <tr> <td> <?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor2', $row->fulltext, 'fulltext', '600', '400', '70', '15'); ?> </td> </tr> <?php } ?> </table> <?php // Toolbar Bottom mosToolBar::startTable(); mosToolBar::save(); mosToolBar::apply(); mosToolBar::cancel(); mosToolBar::endtable(); ?> <?php $tabs->startPane('content-pane'); $tabs->startTab(_E_IMAGES, 'images-page'); ?> <table class="adminform"> <tr> <td colspan="4"> <?php echo _CMN_SUBFOLDER; ?> :: <?php echo $lists['folders']; ?> </td> </tr> <tr> <td align="top"> <?php echo _E_GALLERY_IMAGES; ?> </td> <td width="2%"> </td> <td align="top"> <?php echo _E_CONTENT_IMAGES; ?> </td> <td align="top"> <?php echo _E_EDIT_IMAGE; ?> </td> </tr> <tr> <td valign="top"> <?php echo $lists['imagefiles']; ?> <br /> <input class="button" type="button" value="<?php echo _E_INSERT; ?> " onclick="addSelectedToList('adminForm','imagefiles','imagelist')" /> </td> <td width="2%"> <input class="button" type="button" value=">>" onclick="addSelectedToList('adminForm','imagefiles','imagelist')" title="<?php echo _E_ADD; ?> "/> <br/> <input class="button" type="button" value="<<" onclick="delSelectedFromList('adminForm','imagelist')" title="<?php echo _E_REMOVE; ?> "/> </td> <td valign="top"> <?php echo $lists['imagelist']; ?> <br /> <input class="button" type="button" value="<?php echo _E_UP; ?> " onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" /> <input class="button" type="button" value="<?php echo _E_DOWN; ?> " onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" /> </td> <td valign="top"> <table> <tr> <td align="right"> <?php echo _E_SOURCE; ?> </td> <td> <input class="inputbox" type="text" name= "_source" value="" size="15" /> </td> </tr> <tr> <td align="right" valign="top"> <?php echo _E_ALIGN; ?> </td> <td> <?php echo $lists['_align']; ?> </td> </tr> <tr> <td align="right"> <?php echo _E_ALT; ?> </td> <td> <input class="inputbox" type="text" name="_alt" value="" size="15" /> </td> </tr> <tr> <td align="right"> <?php echo _E_BORDER; ?> </td> <td> <input class="inputbox" type="text" name="_border" value="" size="3" maxlength="1" /> </td> </tr> <tr> <td align="right"> <?php echo _E_CAPTION; ?> : </td> <td> <input class="text_area" type="text" name="_caption" value="" size="30" /> </td> </tr> <tr> <td align="right"> <?php echo _E_CAPTION_POSITION; ?> : </td> <td> <?php echo $lists['_caption_position']; ?> </td> </tr> <tr> <td align="right"> <?php echo _E_CAPTION_ALIGN; ?> : </td> <td> <?php echo $lists['_caption_align']; ?> </td> </tr> <tr> <td align="right"> <?php echo _E_CAPTION_WIDTH; ?> : </td> <td> <input class="text_area" type="text" name="_width" value="" size="5" maxlength="5" /> </td> </tr> <tr> <td align="right"> </td> <td> <input class="button" type="button" value="<?php echo _E_APPLY; ?> " onclick="applyImageProps()" /> </td> </tr> </table> </td> </tr> <tr> <td> <img name="view_imagefiles" src="<?php echo $mosConfig_live_site; ?> /images/M_images/blank.png" width="50" alt="<?php echo _E_NO_IMAGE; ?> " /> </td> <td width="2%"> </td> <td> <img name="view_imagelist" src="<?php echo $mosConfig_live_site; ?> /images/M_images/blank.png" width="50" alt="<?php echo _E_NO_IMAGE; ?> " /> </td> <td> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab(_E_PUBLISHING, 'publish-page'); ?> <table class="adminform"> <?php if ($access->canPublish) { ?> <tr> <td align="left"> <?php echo _E_STATE; ?> </td> <td> <?php echo $lists['state']; ?> </td> </tr> <?php } ?> <tr> <td align="left"> <?php echo _E_ACCESS_LEVEL; ?> </td> <td> <?php echo $lists['access']; ?> </td> </tr> <tr> <td align="left"> <?php echo _E_AUTHOR_ALIAS; ?> </td> <td> <input type="text" name="created_by_alias" size="50" maxlength="100" value="<?php echo $row->created_by_alias; ?> " class="inputbox" /> </td> </tr> <tr> <td align="left"> <?php echo _E_ORDERING; ?> </td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td align="left"> <?php echo _E_START_PUB; ?> </td> <td> <input class="inputbox" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php echo $row->publish_up; ?> " /> <input type="reset" class="button" value="..." onclick="return showCalendar('publish_up', 'y-mm-dd');" /> </td> </tr> <tr> <td align="left"> <?php echo _E_FINISH_PUB; ?> </td> <td> <input class="inputbox" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php echo $row->publish_down; ?> " /> <input type="reset" class="button" value="..." onclick="return showCalendar('publish_down', 'y-mm-dd');" /> </td> </tr> <tr> <td align="left"> <?php echo _E_SHOW_FP; ?> </td> <td> <input type="checkbox" name="frontpage" value="1" <?php echo $row->frontpage ? 'checked="checked"' : ''; ?> /> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab(_E_METADATA, 'meta-page'); ?> <table class="adminform"> <tr> <td align="left" valign="top"> <?php echo _E_M_DESC; ?> </td> <td> <textarea class="inputbox" cols="45" rows="3" name="metadesc"><?php echo str_replace('&', '&', $row->metadesc); ?> </textarea> </td> </tr> <tr> <td align="left" valign="top"> <?php echo _E_M_KEY; ?> </td> <td> <textarea class="inputbox" cols="45" rows="3" name="metakey"><?php echo str_replace('&', '&', $row->metakey); ?> </textarea> </td> </tr> </table> <?php $tabs->endTab(); $tabs->endPane(); ?> <div style="clear:both;"></div> <input type="hidden" name="images" value="" /> <input type="hidden" name="goodexit" value="0" /> <input type="hidden" name="option" value="com_content" /> <input type="hidden" name="Returnid" value="<?php echo $Returnid; ?> " /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="version" value="<?php echo $row->version; ?> " /> <input type="hidden" name="sectionid" value="<?php echo $row->sectionid; ?> " /> <input type="hidden" name="created_by" value="<?php echo $row->created_by; ?> " /> <input type="hidden" name="referer" value="<?php echo ampReplace(@$_SERVER['HTTP_REFERER']); ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="<?php echo $validate; ?> " value="1" /> </form> <?php }
function edituser(&$row, &$contact, &$lists, $option, $uid, &$params) { global $my, $acl; global $mosConfig_live_site; mosMakeHtmlSafe($row); $tabs = new mosTabs(0); mosCommonHTML::loadOverlib(); $canBlockUser = $acl->acl_check('administration', 'edit', 'users', $my->usertype, 'user properties', 'block_user'); $canEmailEvents = $acl->acl_check('workflow', 'email_events', 'users', $acl->get_group_name($row->gid, 'ARO')); ?> <script language="javascript" type="text/javascript"> function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton == 'cancel') { submitform( pressbutton ); return; } var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i"); // do field validation if (trim(form.name.value) == "") { alert( "Você deve informar um nome." ); } else if (form.username.value == "") { alert( "Você deve informar o nome de usuário." ); } else if (r.exec(form.username.value) || form.username.value.length < 3) { alert( "O nome de usuário contém caracteres inválidos ou é muito curto." ); } else if (trim(form.email.value) == "") { alert( "Você deve informar um endereço de e-mail." ); } else if (form.gid.value == "") { alert( "Você deve atribuir o usuário a um grupo." ); } else if (trim(form.password.value) != "" && form.password.value != form.password2.value){ alert( "Senhas não combinam." ); } else if (form.gid.value == "29") { alert( "Por favor, selecione outro grupo pois `Public Frontend` não é uma opção selecionável" ); } else if (form.gid.value == "30") { alert( "Por favor, selecione outro grupo pois `Public Backend` não é uma opção selecionável" ); } else { submitform( pressbutton ); } } function gotocontact( id ) { var form = document.adminForm; form.contact_id.value = id; submitform( 'contact' ); } </script> <form action="index2.php" method="post" name="adminForm"> <table class="adminheading"> <tr> <th class="user"> Usuário: <small><?php echo $row->id ? 'Editar' : 'Adicionar'; ?> </small> </th> </tr> </table> <table width="100%"> <tr> <td width="60%" valign="top"> <table class="adminform"> <tr> <th colspan="2"> Detalhes do Usuário </th> </tr> <tr> <td width="130"> Nome: </td> <td> <input type="text" name="name" class="inputbox" size="40" value="<?php echo $row->name; ?> " maxlength="50" /> </td> </tr> <tr> <td> Nome de Usuário: </td> <td> <input type="text" name="username" class="inputbox" size="40" value="<?php echo $row->username; ?> " maxlength="25" /> </td> <tr> <td> E-mail: </td> <td> <input class="inputbox" type="text" name="email" size="40" value="<?php echo $row->email; ?> " /> </td> </tr> <tr> <td> Nova Senha: </td> <td> <input class="inputbox" type="password" name="password" size="40" value="" /> </td> </tr> <tr> <td> Verificação de Senha: </td> <td> <input class="inputbox" type="password" name="password2" size="40" value="" /> </td> </tr> <tr> <td valign="top"> Grupo: </td> <td> <?php echo $lists['gid']; ?> </td> </tr> <?php if ($canBlockUser) { ?> <tr> <td> Bloquear Usuário </td> <td> <?php echo $lists['block']; ?> </td> </tr> <?php } if ($canEmailEvents) { ?> <tr> <td> Receber E-mail do sistema </td> <td> <?php echo $lists['sendEmail']; ?> </td> </tr> <?php } if ($uid) { ?> <tr> <td> Data do Registro </td> <td> <?php echo $row->registerDate; ?> </td> </tr> <tr> <td> Última Visita </td> <td> <?php echo $row->lastvisitDate; ?> </td> </tr> <?php } ?> <tr> <td colspan="2"> </td> </tr> </table> </td> <td width="40%" valign="top"> <table class="adminform"> <tr> <th colspan="1"> <?php echo 'Parâmetros'; ?> </th> </tr> <tr> <td> <?php echo $params->render('params'); ?> </td> </tr> </table> <?php if (!$contact) { ?> <table class="adminform"> <tr> <th> Infomações de Contato </th> </tr> <tr> <td> <br /> Sem detalhes de contato associado para este usuário: <br /> Veja 'Componentes -> Contato -> Administrar Contato' para detalhes. <br /><br /> </td> </tr> </table> <?php } else { ?> <table class="adminform"> <tr> <th colspan="2"> Informações de Contato </th> </tr> <tr> <td width="15%"> Nome: </td> <td> <strong> <?php echo $contact[0]->name; ?> </strong> </td> </tr> <tr> <td> Empresa: </td> <td > <strong> <?php echo $contact[0]->con_position; ?> </strong> </td> </tr> <tr> <td> Telefone: </td> <td > <strong> <?php echo $contact[0]->telephone; ?> </strong> </td> </tr> <tr> <td> Fax: </td> <td > <strong> <?php echo $contact[0]->fax; ?> </strong> </td> </tr> <tr> <td></td> <td > <strong> <?php echo $contact[0]->misc; ?> </strong> </td> </tr> <?php if ($contact[0]->image) { ?> <tr> <td></td> <td valign="top"> <img src="<?php echo $mosConfig_live_site; ?> /images/stories/<?php echo $contact[0]->image; ?> " align="middle" alt="Contato" /> </td> </tr> <?php } ?> <tr> <td colspan="2"> <br /><br /> <input class="button" type="button" value="change Contact Details" onclick="javascript: gotocontact( '<?php echo $contact[0]->id; ?> ' )"> <i> <br /> 'Componentes -> Contato -> Administrar Contatos'. </i> </td> </tr> </table> <?php } ?> </td> </tr> </table> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="contact_id" value="" /> <?php if (!$canEmailEvents) { ?> <input type="hidden" name="sendEmail" value="0" /> <?php } ?> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
function editNewsFeed(&$row, &$lists, $option) { 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.name.value == '') { alert( "<?php echo T_('Please fill in the news feed name.'); ?> " ); } else if (form.catid.value == 0) { alert( "<?php echo T_('Please select a Category.'); ?> " ); } else if (form.link.value == '') { alert( "<?php echo T_('Please fill in the news feed link.'); ?> " ); } else if (getSelectedValue('adminForm','catid') < 0) { alert( "<?php echo T_('Please select a category.'); ?> " ); } else if (form.numarticles.value == "" || form.numarticles.value == 0) { alert( "<?php echo T_('Please fill in the number of articles to display.'); ?> " ); } else if (form.cache_time.value == "" || form.cache_time.value == 0) { alert( "<?php echo T_('Please fill in the cache refresh time.'); ?> " ); } else { submitform( pressbutton ); } } </script> <form action="index2.php" method="post" name="adminForm"> <table class="adminheading"> <tr> <th class="edit"> <?php echo T_('News Feed:'); ?> <small><?php echo $row->id ? T_('Edit') : T_('New'); ?> </small> <small><small>[ <?php echo $row->name; ?> ]</small></small> </th> </tr> </table> <table class="adminform"> <tr> <th colspan="2"> <?php echo T_('Details'); ?> </th> </tr> <tr> <td> <?php echo T_('Name'); ?> </td> <td> <input class="inputbox" type="text" size="40" name="name" value="<?php echo $row->name; ?> "> </td> </tr> <tr> <td> <?php echo T_('Category'); ?> </td> <td> <?php echo $lists['category']; ?> </td> </tr> <tr> <td> <?php echo T_('Link'); ?> </td> <td> <input class="inputbox" type="text" size="60" name="link" value="<?php echo $row->link; ?> "> </td> </tr> <tr> <td> <?php echo T_('Number of Articles'); ?> </td> <td> <input class="inputbox" type="text" size="2" name="numarticles" value="<?php echo $row->numarticles; ?> "> </td> </tr> <tr> <td> <?php echo T_('Cache time (in seconds)'); ?> </td> <td> <input class="inputbox" type="text" size="4" name="cache_time" value="<?php echo $row->cache_time; ?> "> </td> </tr> <tr> <td> <?php echo T_('Ordering'); ?> </td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td valign="top" align="right"> <?php echo T_('Published:'); ?> </td> <td> <?php echo $lists['published']; ?> </td> </tr> <tr> <td colspan="2" align="center"> </td> </tr> </table> <input type="hidden" name="id" value="<?php echo $row->id; ?> "> <input type="hidden" name="option" value="<?php echo $option; ?> "> <input type="hidden" name="task" value=""> </form> <?php }
function editNewsFeed(&$row, &$lists, $option) { 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.name.value == '') { alert( "Por favor, informe o nome da fonte de notícia." ); } else if (form.catid.value == 0) { alert( "Por favor, selecione uma Categoria." ); } else if (form.link.value == '') { alert( "Por favor, informe o link da fonte de notícia." ); } else if (getSelectedValue('adminForm','catid') < 0) { alert( "Por favor, selecione uma categoria." ); } else if (form.numarticles.value == "" || form.numarticles.value == 0) { alert( "Por favor, informe o número de artigos a exibir." ); } else if (form.cache_time.value == "" || form.cache_time.value == 0) { alert( "Por favor, informe o tempo de atualização do cache." ); } else { submitform( pressbutton ); } } </script> <form action="index2.php" method="post" name="adminForm"> <table class="adminheading"> <tr> <th class="edit"> Fonte da Notícia: <small><?php echo $row->id ? 'Editar' : 'Novo'; ?> </small> <small><small>[ <?php echo $row->name; ?> ]</small></small> </th> </tr> </table> <table class="adminform"> <tr> <th colspan="2"> Detalhes </th> </tr> <tr> <td> Nome </td> <td> <input class="inputbox" type="text" size="40" name="name" value="<?php echo $row->name; ?> "> </td> </tr> <tr> <td> Categoria </td> <td> <?php echo $lists['category']; ?> </td> </tr> <tr> <td> URL </td> <td> <input class="inputbox" type="text" size="60" name="link" value="<?php echo $row->link; ?> "> </td> </tr> <tr> <td> Número de Artigos </td> <td> <input class="inputbox" type="text" size="2" name="numarticles" value="<?php echo $row->numarticles; ?> "> </td> </tr> <tr> <td> Duração da Cache (em segundos) </td> <td> <input class="inputbox" type="text" size="4" name="cache_time" value="<?php echo $row->cache_time; ?> "> </td> </tr> <tr> <td> Ordem </td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td valign="top" align="right"> Publicado: </td> <td> <?php echo $lists['published']; ?> </td> </tr> <tr> <td colspan="2" align="center"> </td> </tr> </table> <input type="hidden" name="id" value="<?php echo $row->id; ?> "> <input type="hidden" name="option" value="<?php echo $option; ?> "> <input type="hidden" name="task" value=""> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
/** * Writes the edit form for new and existing content item * * A new record is defined when <var>$row</var> is passed with the <var>id</var> * property set to 0. * @param mosContent The category object * @param string The html for the groups select list */ function editContent(&$row, $section, &$lists, &$sectioncategories, &$images, &$params, $option, $redirect, &$menus) { global $database; mosMakeHtmlSafe($row); $nullDate = $database->getNullDate(); $create_date = null; if ($row->created != $nullDate) { $create_date = mosFormatDate($row->created, '%A, %d %B %Y %H:%M', '0'); } $mod_date = null; 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 sectioncategories = new Array; <?php $i = 0; foreach ($sectioncategories as $k => $items) { foreach ($items as $v) { echo "sectioncategories[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->id) . "','" . addslashes($v->name) . "' );\t"; } } ?> var folderimages = new Array; <?php $i = 0; foreach ($images as $k => $items) { foreach ($items as $v) { echo "folderimages[" . $i++ . "] = new Array( '{$k}','" . addslashes(ampReplace($v->value)) . "','" . addslashes(ampReplace($v->text)) . "' );\t"; } } ?> function submitbutton(pressbutton) { var form = document.adminForm; if ( pressbutton == 'menulink' ) { if ( form.menuselect.value == "" ) { alert( "Selecione um menu" ); return; } else if ( form.link_name.value == "" ) { alert( "Por favor, informe um nome para este item do menu" ); return; } } if (pressbutton == 'cancel') { submitform( pressbutton ); return; } // assemble the images back into one field 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' ); // do field validation if (form.title.value == ""){ alert( "Item de conteúdo deve ter um título" ); } else if (form.sectionid.value == "-1"){ alert( "Você deve selecionar uma seção." ); } else if (form.catid.value == "-1"){ alert( "Você deve selecionar uma categoria." ); } else if (form.catid.value == ""){ alert( "Você deve selecionar uma categoria." ); } else { <?php getEditorContents('editor1', 'introtext'); ?> <?php getEditorContents('editor2', 'fulltext'); ?> submitform( pressbutton ); } } //--> </script> <form action="index2.php" method="post" name="adminForm"> <table class="adminheading"> <tr> <th class="edit"> Itens de Conteúdo: <small> <?php echo $row->id ? 'Editar' : 'Novo'; ?> </small> <?php if ($row->id) { ?> <small><small> [ Seção: <?php echo $section; ?> ] </small></small> <?php } ?> </th> </tr> </table> <table cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="60%" valign="top"> <table width="100%" class="adminform"> <tr> <td width="100%"> <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <th colspan="4"> Detalhes do Item </th> </tr> <tr> <td> Título: </td> <td> <input class="text_area" type="text" name="title" size="30" maxlength="100" value="<?php echo $row->title; ?> " /> </td> <td> Seção: </td> <td> <?php echo $lists['sectionid']; ?> </td> </tr> <tr> <td> Sub-Título: </td> <td> <input name="title_alias" type="text" class="text_area" id="title_alias" value="<?php echo $row->title_alias; ?> " size="30" maxlength="100" /> </td> <td> Categoria: </td> <td> <?php echo $lists['catid']; ?> </td> </tr> </table> </td> </tr> <tr> <td width="100%"> Texto de Introdução: (necessário) <br /><?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor1', $row->introtext, 'introtext', '100%;', '350', '75', '20'); ?> </td> </tr> <tr> <td width="100%"> Texto principal: (opcional) <br /><?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor2', $row->fulltext, 'fulltext', '100%;', '400', '75', '30'); ?> </td> </tr> </table> </td> <td valign="top" width="40%"> <?php $tabs->startPane("content-pane"); $tabs->startTab("Publicação", "publish-page"); ?> <table class="adminform"> <tr> <th colspan="2"> Info da Publicação </th> </tr> <tr> <td valign="top" align="right" width="120"> Exibir na Página Inicial: </td> <td> <input type="checkbox" name="frontpage" value="1" <?php echo $row->frontpage ? 'checked="checked"' : ''; ?> /> </td> </tr> <tr> <td valign="top" align="right"> Publicado: </td> <td> <input type="checkbox" name="published" value="1" <?php echo $row->state ? 'checked="checked"' : ''; ?> /> </td> </tr> <tr> <td valign="top" align="right"> Nível de Acesso: </td> <td> <?php echo $lists['access']; ?> </td> </tr> <tr> <td valign="top" align="right"> Apelido do Autor: </td> <td> <input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php echo $row->created_by_alias; ?> " class="text_area" /> </td> </tr> <tr> <td valign="top" align="right"> Alterar Autor: </td> <td> <?php echo $lists['created_by']; ?> </td> </tr> <tr> <td valign="top" align="right">Ordem:</td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td valign="top" align="right"> Alterar Data de Criação </td> <td> <input class="text_area" type="text" name="created" id="created" size="25" maxlength="19" value="<?php echo $row->created; ?> " /> <input name="reset" type="reset" class="button" onclick="return showCalendar('created', 'y-mm-dd');" value="..." /> </td> </tr> <tr> <td valign="top" align="right"> Início da Publicação: </td> <td> <input class="text_area" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php echo $row->publish_up; ?> " /> <input type="reset" class="button" value="..." onclick="return showCalendar('publish_up', 'y-mm-dd');" /> </td> </tr> <tr> <td valign="top" align="right"> Fim da Publicação: </td> <td> <input class="text_area" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php echo $row->publish_down; ?> " /> <input type="reset" class="button" value="..." onclick="return showCalendar('publish_down', 'y-mm-dd');" /> </td> </tr> </table> <br /> <table class="adminform"> <?php if ($row->id) { ?> <tr> <td> <strong>ID do conteúdo:</strong> </td> <td> <?php echo $row->id; ?> </td> </tr> <?php } ?> <tr> <td width="120" valign="top" align="right"> <strong>Estado:</strong> </td> <td> <?php echo $row->state > 0 ? 'Publicado' : ($row->state < 0 ? 'Arquivado' : 'Rascunho não publicado'); ?> </td> </tr> <tr > <td valign="top" align="right"> <strong> Acessos </strong>: </td> <td> <?php echo $row->hits; ?> <div <?php echo $visibility; ?> > <input name="reset_hits" type="button" class="button" value="Reiniciar Contagem" onclick="submitbutton('resethits');" /> </div> </td> </tr> <tr> <td valign="top" align="right"> <strong> Revisão </strong>: </td> <td> <?php echo $row->version; ?> vez(es) </td> </tr> <tr> <td valign="top" align="right"> <strong> Criado </strong> </td> <td> <?php if (!$create_date) { ?> Novo documento <?php } else { echo $create_date; } ?> </td> </tr> <tr> <td valign="top" align="right"> <strong> Última Alteração </strong> </td> <td> <?php if (!$mod_date) { ?> Não alterado <?php } else { echo $mod_date; ?> <br /> <?php echo $row->modifier; } ?> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab("Imagens", "images-page"); ?> <table class="adminform" width="100%"> <tr> <th colspan="2"> Controle do MOSImage </th> </tr> <tr> <td colspan="2"> <table width="100%"> <tr> <td width="48%" valign="top"> <div align="center"> Imagens na Galeria: <br /> <?php echo $lists['imagefiles']; ?> </div> </td> <td width="2%"> <input class="button" type="button" value=">>" onclick="addSelectedToList('adminForm','imagefiles','imagelist')" title="Adicionar"/> <br /> <input class="button" type="button" value="<<" onclick="delSelectedFromList('adminForm','imagelist')" title="Remover"/> </td> <td width="48%"> <div align="center"> Imagens no Artigo: <br /> <?php echo $lists['imagelist']; ?> <br /> <input class="button" type="button" value="Para cima" onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" /> <input class="button" type="button" value="Para baixo" onclick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" /> </div> </td> </tr> </table> Sub-pastas: <?php echo $lists['folders']; ?> </td> </tr> <tr valign="top"> <td> <div align="center"> Imagem de amostra:<br/> <img name="view_imagefiles" src="../images/M_images/blank.png" alt="Imagem vazia padrão" width="100" /> </div> </td> <td valign="top"> <div align="center"> Imagem Ativa:<br/> <img name="view_imagelist" src="../images/M_images/blank.png" alt="Imagem Ativa" width="100" /> </div> </td> </tr> <tr> <td colspan="2"> Edite a imagem selecionada: <table> <tr> <td align="right"> Fonte: </td> <td> <input class="text_area" type="text" name= "_source" value="" /> </td> </tr> <tr> <td align="right"> Alinhamento: </td> <td> <?php echo $lists['_align']; ?> </td> </tr> <tr> <td align="right"> Texto Alt: </td> <td> <input class="text_area" type="text" name="_alt" value="" /> </td> </tr> <tr> <td align="right"> Borda: </td> <td> <input class="text_area" type="text" name="_border" value="" size="3" maxlength="1" /> </td> </tr> <tr> <td align="right"> Sub-Título: </td> <td> <input class="text_area" type="text" name="_caption" value="" size="30" /> </td> </tr> <tr> <td align="right"> Posição do Sub-Título: </td> <td> <?php echo $lists['_caption_position']; ?> </td> </tr> <tr> <td align="right"> Alinhamento do Sub-Título: </td> <td> <?php echo $lists['_caption_align']; ?> </td> </tr> <tr> <td align="right"> Largura Sub-Título: </td> <td> <input class="text_area" type="text" name="_width" value="" size="5" maxlength="5" /> </td> </tr> <tr> <td colspan="2"> <input class="button" type="button" value="Aplicar" onclick="applyImageProps()" /> </td> </tr> </table> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab("Parâmetros", "params-page"); ?> <table class="adminform"> <tr> <th colspan="2"> Controle de Parâmetros </th> </tr> <tr> <td> Estes parâmetros somente controlam o que você vê quando clica para visualizar um item completamente <br /><br /> </td> </tr> <tr> <td> <?php echo $params->render(); ?> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab("Meta dados", "metadata-page"); ?> <table class="adminform"> <tr> <th colspan="2"> Meta Dados </th> </tr> <tr> <td> Descrição: <br /> <textarea class="text_area" cols="30" rows="3" style="width: 350px; height: 50px" name="metadesc"><?php echo str_replace('&', '&', $row->metadesc); ?> </textarea> </td> </tr> <tr> <td> Palavras Chaves: <br /> <textarea class="text_area" cols="30" rows="3" style="width: 350px; height: 50px" name="metakey"><?php echo str_replace('&', '&', $row->metakey); ?> </textarea> </td> </tr> <tr> <td> <input type="button" class="button" value="Adicionar titulo Seção/Categoria/Título" onclick="f=document.adminForm;f.metakey.value=document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].text+', '+getSelectedText('adminForm','catid')+', '+f.title.value+f.metakey.value;" /> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab("Link para o Menu", "link-page"); ?> <table class="adminform"> <tr> <th colspan="2"> Link para o Menu </th> </tr> <tr> <td colspan="2"> Isto irá criar um 'Link - Item de Conteúdo' no menu que você selecionou <br /><br /> </td> </tr> <tr> <td valign="top" width="90"> Selecione um Menu </td> <td> <?php echo $lists['menuselect']; ?> </td> </tr> <tr> <td valign="top" width="90"> Nome do Menu </td> <td> <input type="text" name="link_name" class="inputbox" value="" size="30" /> </td> </tr> <tr> <td> </td> <td> <input name="menu_link" type="button" class="button" value="Link para o Menu" onclick="submitbutton('menulink');" /> </td> </tr> <tr> <th colspan="2"> Links de Menu Existentes </th> </tr> <?php if ($menus == NULL) { ?> <tr> <td colspan="2"> Nenhum </td> </tr> <?php } else { mosCommonHTML::menuLinksContent($menus); } ?> <tr> <td colspan="2"> </td> </tr> </table> <?php $tabs->endTab(); $tabs->endPane(); ?> </td> </tr> </table> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="version" value="<?php echo $row->version; ?> " /> <input type="hidden" name="mask" value="0" /> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="images" value="" /> <input type="hidden" name="hidemainmenu" value="0" /> <input type="hidden" name="<?php echo josSpoofValue(); ?> " value="1" /> </form> <?php }
/** * Writes the edit form for new and existing categories * * @param mosCategory $ The category object * @param string $ * @param array $ */ function edit(&$row, $section, &$lists, $redirect) { global $mosConfig_live_site, $mosConfig_absolute_path; if ($row->image == "") { $row->image = 'blank.png'; } 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 ( form.name.value == "" ) { alert('<?php echo _DML_CAT_MUST_SELECT_NAME; ?> '); } else { <?php getEditorContents('editor1', 'description'); ?> submitform(pressbutton); } } </script> <form action="index2.php" method="post" name="adminForm"> <?php $tmp = ($row->id ? _DML_EDIT : _DML_ADD) . ' ' . _DML_CAT . ' ' . $row->name; dmHTML::adminHeading($tmp, 'categories'); ?> <table width="100%"> <tr> <td valign="top"> <table class="adminform"> <tr> <th colspan="3"> <?php echo _DML_CATDETAILS; ?> </th> <tr> <tr> <td> <?php echo _DML_CATTITLE; ?> : </td> <td colspan="2"> <input class="text_area" type="text" name="title" value="<?php echo $row->title; ?> " size="50" maxlength="50" title="A short name to appear in menus" /> </td> </tr> <tr> <td> <?php echo _DML_CATNAME; ?> : </td> <td colspan="2"> <input class="text_area" type="text" name="name" value="<?php echo $row->name; ?> " size="50" maxlength="255" title="<?php echo _DML_LONGNAME; ?> " /> </td> </tr> <tr> <td align="right"><?php echo _DML_PARENTITEM; ?> :</td> <td> <?php echo $lists['parent']; ?> </td> </tr> <tr> <td> <?php echo _DML_IMAGE; ?> : </td> <td> <?php echo $lists['image']; ?> </td> <td rowspan="4" width="50%"> <script language="javascript" type="text/javascript"> if (document.forms[0].image.options.value!=''){ jsimg='../images/stories/' + getSelectedValue( 'adminForm', 'image' ); } else { jsimg='../images/M_images/blank.png'; } document.write('<img src=' + jsimg + ' name="imagelib" width="80" height="80" border="2" alt="<?php echo _DML_PREVIEW; ?> " />'); </script> </td> </tr> <tr> <td> <?php echo _DML_IMAGEPOS; ?> : </td> <td> <?php echo $lists['image_position']; ?> </td> </tr> <tr> <td> <?php echo _DML_ORDERING; ?> : </td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td> <?php echo _DML_ACCESSLEVEL; ?> : </td> <td> <?php echo $lists['access']; ?> </td> </tr> <tr> <td> <?php echo _DML_PUBLISHED; ?> : </td> <td> <?php echo $lists['published']; ?> </td> </tr> <tr> <td valign="top"> <?php echo _DML_DESCRIPTION; ?> : </td> <td colspan="2"> <?php // parameters : areaname, content, hidden field, width, height, rows, cols DOCMAN_Compat::editorArea('editor1', $row->description, 'description', '500', '200', '50', '5'); ?> </td> </tr> </table> </td> </tr> </table> <input type="hidden" name="option" value="com_docman" /> <input type="hidden" name="section" value="categories" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="oldtitle" value="<?php echo $row->title; ?> " /> <input type="hidden" name="id" value="<?php echo $row->id; ?> " /> <input type="hidden" name="sectionid" value="com_docman" /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?> " /> <?php echo DOCMAN_token::render(); ?> </form> <?php include_once $mosConfig_absolute_path . "/components/com_docman/footer.php"; }