/** * Writes the edit form for new and existing record (FRONTEND) * * 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 string The html for the categories select list */ function editWeblink($option, &$row, &$lists) { $Returnid = intval(mosGetParam($_REQUEST, 'Returnid', 0)); ?> <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 T_("Web Link item must have a title"); ?> ' ); } else if (getSelectedValue('adminForm','catid') < 1) { alert( '<?php echo T_("You must select a category."); ?> ' ); } else if (form.url.value == ""){ alert( '<?php echo T_("You must have a url."); ?> ' ); } else { submitform( pressbutton ); } } </script> <form action="<?php echo sefRelToAbs("index.php"); ?> " method="post" name="adminForm" id="adminForm"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="contentheading"> <?php echo T_('Submit A Web Link'); ?> </td> <td width="10%"> <?php mosToolBar::startTable(); mosToolBar::spacer(); mosToolBar::save(); mosToolBar::cancel(); mosToolBar::endtable(); ?> </td> </tr> </table> <table cellpadding="4" cellspacing="1" border="0" width="100%"> <tr> <td width="20%" align="right"> <?php echo T_('Name:'); ?> </td> <td width="80%"> <input class="inputbox" type="text" name="title" size="50" maxlength="250" value="<?php echo htmlspecialchars(stripslashes($row->title, ENT_QUOTES)); ?> " /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo T_('Section:'); ?> </td> <td> <?php echo $lists['catid']; ?> </td> </tr> <tr> <td valign="top" align="right"> <?php echo T_('URL:'); ?> </td> <td> <input class="inputbox" type="text" name="url" value="<?php echo $row->url; ?> " size="50" maxlength="250" /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo T_('Description:'); ?> </td> <td> <textarea class="inputbox" cols="30" rows="6" name="description" style="width:300px" width="300"><?php echo htmlspecialchars($row->description, ENT_QUOTES); ?> </textarea> </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="ordering" value="<?php echo $row->ordering; ?> " /> <input type="hidden" name="approved" value="<?php echo $row->approved; ?> " /> <input type="hidden" name="Returnid" value="<?php echo $Returnid; ?> " /> </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, &$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 }
/** * Writes a cancel button and invokes a cancel operation (eg a checkin) * @param string An override for the task * @param string An override for the alt text */ function cancel($task = 'cancel', $alt = 'Cancel') { $alt = JText::_($alt); mosToolBar::custom($task, 'cancel_f2.png', '', $alt, false); }
/** * Writes the edit form for new and existing record (FRONTEND) * * 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 string The html for the categories select list */ function editWeblink($option, &$row, &$lists) { global $mainframe; require_once $GLOBALS['mosConfig_absolute_path'] . '/includes/HTML_toolbar.php'; $Returnid = intval(mosGetParam($_REQUEST, 'Returnid', 0)); // used for spoof hardening $validate = josSpoofValue(); ?> <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( "Weblink item must have a title" ); } else if (getSelectedValue('adminForm','catid') < 1) { alert( "You must select a category." ); } else if (form.url.value == ""){ alert( "You must have a url." ); } else { submitform( pressbutton ); } } </script> <form action="<?php echo sefRelToAbs("index.php"); ?> " method="post" name="adminForm" id="adminForm"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="contentheading"> <?php echo _SUBMIT_LINK; ?> </td> <td width="10%"> <?php mosToolBar::startTable(); mosToolBar::spacer(); mosToolBar::save(); mosToolBar::cancel(); mosToolBar::endtable(); ?> </td> </tr> </table> <table cellpadding="4" cellspacing="1" border="0" width="100%"> <tr> <td width="20%" align="right"> <?php echo _NAME; ?> </td> <td width="80%"> <input class="inputbox" type="text" name="title" size="50" maxlength="250" value="<?php echo htmlspecialchars($row->title, ENT_QUOTES); ?> " /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo _SECTION; ?> </td> <td> <?php echo $lists['catid']; ?> </td> </tr> <tr> <td valign="top" align="right"> <?php echo _URL; ?> </td> <td> <input class="inputbox" type="text" name="url" value="<?php echo $row->url; ?> " size="50" maxlength="250" /> </td> </tr> <tr> <td valign="top" align="right"> <?php echo _URL_DESC; ?> </td> <td> <textarea class="inputbox" cols="30" rows="6" name="description" style="width:300px" width="300"><?php echo htmlspecialchars($row->description, ENT_QUOTES); ?> </textarea> </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="ordering" value="<?php echo $row->ordering; ?> " /> <input type="hidden" name="approved" value="<?php echo $row->approved; ?> " /> <input type="hidden" name="Returnid" value="<?php echo $Returnid; ?> " /> <input type="hidden" name="referer" value="<?php echo $_SERVER['HTTP_REFERER']; ?> " /> <input type="hidden" name="<?php echo $validate; ?> " value="1" /> </form> <?php }
function userEdit($row, $option, $submitvalue, &$params) { global $mosConfig_absolute_path, $mosConfig_frontend_userparams; require_once $mosConfig_absolute_path . '/includes/HTML_toolbar.php'; // used for spoof hardening $validate = josSpoofValue(); mosCommonHTML::loadOverlib(); ?> <script language="javascript" type="text/javascript"> function submitbutton( pressbutton ) { var form = document.mosUserForm; var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i"); if (pressbutton == 'cancel') { form.task.value = 'cancel'; form.submit(); return; } // do field validation if (form.name.value == "") { alert( "<?php echo addslashes(_REGWARN_NAME); ?> " ); } else if (form.username.value == "") { alert( "<?php echo addslashes(_REGWARN_UNAME); ?> " ); } else if (r.exec(form.username.value) || form.username.value.length < 3) { alert( "<?php printf(addslashes(_VALID_AZ09), addslashes(_PROMPT_UNAME), 4); ?> " ); } else if (form.email.value == "") { alert( "<?php echo addslashes(_REGWARN_MAIL); ?> " ); } else if ((form.password.value != "") && (form.password.value != form.verifyPass.value)){ alert( "<?php echo addslashes(_REGWARN_VPASS2); ?> " ); } else if (r.exec(form.password.value)) { alert( "<?php printf(addslashes(_VALID_AZ09), addslashes(_REGISTER_PASS), 4); ?> " ); } else { form.submit(); } } </script> <form action="index.php" method="post" name="mosUserForm"> <div class="componentheading"> <?php echo _EDIT_TITLE; ?> </div> <div style="float: right;"> <?php mosToolBar::startTable(); mosToolBar::spacer(); mosToolBar::save(); mosToolBar::cancel(); mosToolBar::endtable(); ?> </div> <table cellpadding="5" cellspacing="0" border="0" width="100%"> <tr> <td width=85> <?php echo _YOUR_NAME; ?> </td> <td> <input class="inputbox" type="text" name="name" value="<?php echo $row->name; ?> " size="40" /> </td> </tr> <tr> <td> <?php echo _EMAIL; ?> </td> <td> <input class="inputbox" type="text" name="email" value="<?php echo $row->email; ?> " size="40" /> </td> </tr> <tr> <td> <?php echo _UNAME; ?> </td> <td> <input class="inputbox" type="text" name="username" value="<?php echo $row->username; ?> " size="40" /> </td> </tr> <tr> <td> <?php echo _PASS; ?> </td> <td> <input class="inputbox" type="password" name="password" value="" size="40" /> </td> </tr> <tr> <td> <?php echo _VPASS; ?> </td> <td> <input class="inputbox" type="password" name="verifyPass" size="40" /> </td> </tr> <?php if ($mosConfig_frontend_userparams == '1' || $mosConfig_frontend_userparams == 1 || $mosConfig_frontend_userparams == NULL) { ?> <tr> <td colspan="2"> <?php echo $params->render('params'); ?> </td> </tr> <?php } ?> </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="saveUserEdit" /> <input type="hidden" name="<?php echo $validate; ?> " value="1" /> </form> <?php }
<div class="<?php echo $boardclass; ?> _bt_cvr4"> <div class="<?php echo $boardclass; ?> _bt_cvr5"> <form action = "index.php" method = "post" name = "mosUserForm"> <div style = "float: right; display:none"> <?php mosToolBar::startTable(); mosToolBar::spacer(); mosToolBar::save(); mosToolBar::cancel(); mosToolBar::endtable(); ?> </div> <table class = "fb_blocktable" id = "fb_forumprofile_sub" border = "0" cellspacing = "0" cellpadding = "0" width="100%"> <thead> <tr> <th colspan = "2"> <div class = "fb_title_cover"> <span class = "fb_title"><?php echo _KUNENA_EDIT_TITLE; ?> </span> </div></th> </tr> </thead> <tbody class = "fb_myprofile_general"> <tr class="fb_sth"> <th colspan="2" > <center>
/** * 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; mosMakeHtmlSafe($row); $Returnid = intval(mosGetParam($_REQUEST, 'Returnid', $Itemid)); ?> <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="<?php echo $mosConfig_live_site; ?> /includes/js/calendar/calendar.js"></script> <!-- import the language module --> <script type="text/javascript" src="<?php echo $mosConfig_live_site; ?> /includes/js/calendar/lang/calendar-en.js"></script> <script language="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 T_('Content item must have a title'); ?> " ); } else if (parseInt('<?php echo $row->sectionid; ?> ')) { // for content items if (getSelectedValue('adminForm','catid') < 1) { alert ( "<?php echo T_('Please select a category'); ?> " ); //} else if (form.introtext.value == "") { // alert ( "<?php echo T_('Content item must have intro text'); ?> " ); } else { <?php getEditorContents('editor1', 'introtext'); getEditorContents('editor2', 'fulltext'); ?> submitform(pressbutton); } //} else if (form.introtext.value == "") { // alert ( "<?php echo T_('Content item must have intro text'); ?> " ); } 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 T_('Please either Cancel or Save the current change'); ?> '); window.location="<?php echo sefRelToAbs("index.php?option=com_content&task=" . $task . "§ionid=" . $sectionid . "&id=" . $row->id . "&Itemid=" . $Itemid); ?> " } } </script> <?php //$docinfo = "<strong>".T_('Subject:')."</strong> "; //$docinfo .= $row->title."<br />"; $docinfo = "<strong>" . T_('Expiry Date:') . "</strong> "; $docinfo .= $row->publish_down . "<br />"; $docinfo .= "<strong>" . T_('Version:') . "</strong> "; $docinfo .= $row->version . "<br />"; $docinfo .= "<strong>" . T_('Created:') . "</strong> "; $docinfo .= $row->created . "<br />"; $docinfo .= "<strong>" . T_('Last Modified:') . "</strong> "; $docinfo .= $row->modified . "<br />"; $docinfo .= "<strong>" . T_('Hits:') . "</strong> "; $docinfo .= $row->hits . "<br />"; ?> <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <td class="contentheading" > <?php echo $section; ?> / <?php echo $row->id ? T_('Edit') : T_('Add'); ?> <?php echo T_('Content'); ?> <a href="javascript: void(0);" onMouseOver="return overlib('<table><?php echo $docinfo; ?> </table>', CAPTION, '<?php echo T_('Item Information'); ?> ', BELOW, RIGHT);" onMouseOut="return nd();"> <strong>[<?php echo T_('Info'); ?> ]</strong> </a> </td> <td width="10%"> <?php mosToolBar::startTable(); mosToolBar::save(); mosToolBar::spacer(25); mosToolBar::cancel(); mosToolBar::endtable(); $tabs = new mosTabs(0); ?> </td> </tr> </table> <form action="index.php" method="post" name="adminForm" onSubmit="javascript:setgood();"> <input type="hidden" name="images" value="" /> <table class="adminform"> <tr> <td> <?php echo T_('Title:'); ?> </td> </tr> <tr> <td> <input class="inputbox" type="text" name="title" size="50" maxlength="100" value="<?php echo $row->title; ?> " /> </td> </tr> <tr> <td> <input class="inputbox" type="text" name="title_alias" size="50" maxlength="100" value="<?php echo $row->title_alias; ?> " /> </td> </tr> <?php if ($row->sectionid) { ?> <tr> <td> <?php echo T_('Category:'); ?> </td> </tr> <tr> <td> <?php echo $lists['catid']; ?> </td> </tr> <?php } ?> <tr> <?php if (intval($row->sectionid) > 0) { ?> <td> <?php echo T_('Intro Text') . ' (' . T_('Required') . ')'; ?> : </td> <?php } else { ?> <td> <?php echo T_('Main Text') . ' (' . T_('Required') . ')'; ?> : </td> <?php } ?> </tr> <tr> <td> <?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor1', $row->introtext, 'introtext', '500', '200', '65', '20'); ?> </td> </tr> <?php if (intval($row->sectionid) > 0) { ?> <tr> <td> <?php echo T_('Main Text') . ' (' . T_('Optional') . ')'; ?> : </td> </tr> <tr> <td> <?php // parameters : areaname, content, hidden field, width, height, rows, cols editorArea('editor2', $row->fulltext, 'fulltext', '500', '400', '65', '20'); ?> </td> </tr> <?php } ?> </table> <?php $tabs->startPane('content-pane'); $tabs->startTab(T_('Images'), 'images-page'); ?> <table class="adminform"> <tr> <td colspan="6"> <?php echo T_('Sub-folder'); ?> :: <?php echo $lists['folders']; ?> </td> </tr> <tr> <td align="top"> <?php echo T_('Gallery Images'); ?> </td> <td align="top"> <?php echo T_('Content Images'); ?> </td> <td align="top"> <?php echo T_('Edit Image'); ?> </td> <tr> <td valign="top"> <?php echo $lists['imagefiles']; ?> <br /> <input class="button" type="button" value="<?php echo T_('Insert'); ?> " onclick="addSelectedToList('adminForm','imagefiles','imagelist')" /> </td> <td valign="top"> <?php echo $lists['imagelist']; ?> <br /> <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> <td valign="top"> <table> <tr> <td align="right"> <?php echo T_('Source:'); ?> </td> <td> <input class="inputbox" type="text" name= "_source" value="" size="15" /> </td> </tr> <tr> <td align="right" valign="top"> <?php echo T_('Align:'); ?> </td> <td> <?php echo $lists['_align']; ?> </td> </tr> <tr> <td align="right"> <?php echo T_('Alt Text:'); ?> </td> <td> <input class="inputbox" type="text" name="_alt" value="" size="15" /> </td> </tr> <tr> <td align="right"> <?php echo T_('Border:'); ?> </td> <td> <input class="inputbox" type="text" name="_border" value="" size="3" maxlength="1" /> </td> </tr> <tr> <td align="right"></td> <td> <input class="button" type="button" value="<?php echo T_('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 T_('No Image'); ?> " /> </td> <td> <img name="view_imagelist" src="<?php echo $mosConfig_live_site; ?> /images/M_images/blank.png" width="50" alt="<?php echo T_('No Image'); ?> " /> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab(T_('Publishing'), 'publish-page'); ?> <table class="adminform"> <?php if ($access->canPublish) { ?> <tr> <td align="left"> <?php echo T_('State:'); ?> </td> <td> <?php echo $lists['state']; ?> </td> </tr> <?php } ?> <tr> <td align="left"> <?php echo T_('Access Level:'); ?> </td> <td> <?php echo $lists['access']; ?> </td> </tr> <tr> <td align="left"> <?php echo T_('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 T_('Ordering:'); ?> </td> <td> <?php echo $lists['ordering']; ?> </td> </tr> <tr> <td align="left"> <?php echo T_('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="left"> <?php echo T_('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> <tr> <td align="left"> <?php echo T_('Show on Front Page:'); ?> </td> <td> <input type="checkbox" name="frontpage" value="1" <?php echo $row->frontpage ? 'checked="checked"' : ''; ?> /> </td> </tr> </table> <?php $tabs->endTab(); $tabs->startTab(T_('Metadata'), 'meta-page'); ?> <table class="adminform"> <tr> <td align="left" valign="top"> <?php echo T_('Description:'); ?> </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 T_('Keywords:'); ?> </td> <td> <textarea class="inputbox" cols="45" rows="3" name="metakey"><?php echo str_replace('&', '&', $row->metakey); ?> </textarea> </td> </tr> </table> <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="task" value="" /> </form> <?php $tabs->endTab(); $tabs->endPane(); ?> <div style="clear:both;"></div> <?php }
function showCreateGallery($rows) { global $rsgConfig; $my = JFactory::getUser(); $editor =& JFactory::getEditor(); //Load frontend toolbar class require_once JPATH_ROOT . '/includes/HTML_toolbar.php'; ?> <script type="text/javascript"> function submitbutton(pressbutton) { var form = document.form1; if (pressbutton == 'cancel') { form.reset(); return; } <?php echo $editor->save('description'); ?> // do field validation if (form.parent.value == "-1") { alert( "<?php echo JText::_('You need to select a parent gallery'); ?> " ); } else if (form.catname1.value == "") { alert( "<?php echo JText::_('You must provide a gallery name.'); ?> " ); } else if (form.description.value == ""){ alert( "<?php echo JText::_('You must provide a description.'); ?> " ); } else{ form.submit(); } } </script> <?php if ($rows) { foreach ($rows as $row) { $catname = $row->name; $description = $row->description; $ordering = $row->ordering; $uid = $row->uid; $catid = $row->id; $published = $row->published; $user = $row->user; $parent = $row->parent; } } else { $catname = ""; $description = ""; $ordering = ""; $uid = ""; $catid = ""; $published = ""; $user = ""; $parent = 0; } ?> <form name="form1" id="form1" method="post" action="<?php echo JRoute::_("index.php?option=com_rsgallery2&rsgOption=myGalleries&task=saveCat"); ?> "> <table width="100%"> <tr> <td colspan="2"><h3><?php echo JText::_('Create Gallery'); ?> </h3></td> </tr> <tr> <td align="right"> <div style="float: right;"> <?php // Toolbar mosToolBar::startTable(); mosToolBar::save(); mosToolBar::cancel(); mosToolBar::endtable(); ?> </div> </td> </tr> </table> <input type="hidden" name="catid" value="<?php echo $catid; ?> " /> <input type="hidden" name="ordering" value="<?php echo $ordering; ?> " /> <table class="adminlist" border="1"> <tr> <th colspan="2"><?php echo JText::_('Create Gallery'); ?> </th> </tr> <tr> <td><?php echo JText::_('Top gallery'); ?> </td> <td> <?php if (!$rsgConfig->get('acl_enabled')) { galleryUtils::showCategories(NULL, $my->id, 'parent'); } else { galleryUtils::showUserGalSelectList('up_mod_img', 'parent'); } ?> </td> </tr> <tr> <td><?php echo JText::_('Gallery name'); ?> </td> <td align="left"><input type="text" name="catname1" size="30" value="<?php echo $catname; ?> " /></td> </tr> <tr> <td><?php echo JText::_('Description'); ?> </td> <td align="left"> <?php echo $editor->display('description', $description, '100%', '200', '10', '20', false); ?> </td> </tr> <tr> <td><?php echo JText::_('Published'); ?> </td> <td align="left"><input type="checkbox" name="published" value="1" <?php if ($published == 1) { echo "checked"; } ?> /></td> </tr> </table> </form> <?php }