Exemplo n.º 1
0
    /**
     * 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 . "&sectionid=" . $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');
        ?>
&nbsp;
			<?php 
        echo T_('Content');
        ?>
 &nbsp;&nbsp;&nbsp;
			<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('&', '&amp;', $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('&', '&amp;', $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 
    }
Exemplo n.º 2
0
    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 
    }
Exemplo n.º 3
0
    /**
     * Writes a preview button for a given option (opens a popup window)
     * @param string The name of the popup file (excluding the file extension)
     */
    public static function preview($popup = '', $updateEditors = false)
    {
        global $database;
        $image2 = mosAdminMenus::ImageCheckAdmin('preview_f2.png', '/administrator/images/', NULL, NULL, 'Preview', 'preview', 1, 'middle', 'Preview');
        $sql = "SELECT template" . "\n FROM #__templates_menu" . "\n WHERE client_id = 0" . "\n AND menuid = 0";
        $database->setQuery($sql);
        $cur_template = $database->loadResult();
        ?>
		<td>
			<script language="javascript" type="text/javascript">
			<!--
			public static function popup() {
				<?php 
        if ($updateEditors) {
            getEditorContents('editor1', 'introtext');
            getEditorContents('editor2', 'fulltext');
        }
        ?>
				window.open('popups/<?php 
        echo $popup;
        ?>
.php?t=<?php 
        echo $cur_template;
        ?>
', 'win1', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no');
			}
			//-->
			</script>
		 	<a class="toolbar" href="#" onclick="popup();">
				<?php 
        echo $image2;
        ?>
				<br />Preview</a>
		</td>
		<?php 
    }
Exemplo n.º 4
0
    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";
    }
Exemplo n.º 5
0
    /**
     * Writes the edit form for new and existing module
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.
     * @param mosCategory The category object
     * @param array <p>The modules of the left side.  The array elements are in the form
     * <var>$leftorder[<i>order</i>] = <i>label</i></var>
     * where <i>order</i> is the module order from the db table and <i>label</i> is a
     * text label associciated with the order.</p>
     * @param array See notes for leftorder
     * @param array An array of select lists
     * @param object Parameters
     */
    function editModule(&$row, &$orders2, &$lists, &$params, $option)
    {
        global $mosConfig_live_site;
        global $adminLanguage;
        $tabs = new mosTabs(0);
        ?>
		<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
	   
		<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton) {
			if ( ( pressbutton == 'save' ) && ( document.adminForm.title.value == "" ) ) {
				alert("<?php 
        echo $adminLanguage->A_COMP_MOD_MUST_TITLE;
        ?>
");
			} else {
				<?php 
        if ($row->module == "") {
            getEditorContents('editor1', 'content');
        }
        ?>
				submitform(pressbutton);
			}
			submitform(pressbutton);
		}
		<!--
		var originalOrder = '<?php 
        echo $row->ordering;
        ?>
';
		var originalPos = '<?php 
        echo $row->position;
        ?>
';
		var orders = new Array();	// array in the format [key,value,text]
		<?php 
        $i = 0;
        foreach ($orders2 as $k => $items) {
            foreach ($items as $v) {
                echo "\n\torders[" . $i++ . "] = new Array( \"{$k}\",\"{$v->value}\",\"{$v->text}\" );";
            }
        }
        ?>
		//-->
		</script>
		<table class="adminheading">
		<tr>
			<th class="modules">
			<?php 
        echo $row->id ? 'Edit' : 'New';
        ?>
 
			<?php 
        echo $lists['client_id'] ? $adminLanguage->A_COMP_MAMB_ADMIN : $adminLanguage->A_COMP_MAMB_SITE;
        ?>
			<?php 
        echo $adminLanguage->A_COMP_MOD_MODULE;
        ?>
 ->
			<?php 
        echo $row->title;
        ?>
			</th>
		</tr>
		</table>
	
		<form action="index2.php" method="post" name="adminForm">
	
		<table cellspacing="0" cellpadding="0" width="100%">
		<tr valign="top">
			<td width="60%" valign="top">
				<table class="adminform">
					<tr>
						<th colspan="2">
						<?php 
        echo $adminLanguage->A_COMP_MOD_DETAILS;
        ?>
						</th>
					<tr>
					<tr>
						<td width="100" align="left">
						<?php 
        echo $adminLanguage->A_COMP_TITLE;
        ?>
:
						</td>
						<td>
						<input class="text_area" type="text" name="title" size="35" value="<?php 
        echo $row->title;
        ?>
" />
						</td>
	
					</tr>
					<!-- START selectable pages -->
					<tr>
						<td width="100" align="left">
						<?php 
        echo $adminLanguage->A_COMP_MOD_SHOW_TITLE;
        ?>
:
						</td>
						<td>
						<?php 
        echo $lists['showtitle'];
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top" align="left">
						<?php 
        echo $adminLanguage->A_COMP_MOD_POSITION;
        ?>
:
						</td>
						<td>
						<?php 
        echo $lists['position'];
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top" align="left">
						<?php 
        echo $adminLanguage->A_COMP_MOD_ORDER;
        ?>
:
						</td>
						<td>
						<script language="javascript" type="text/javascript">
						<!--
						writeDynaList( 'class="inputbox" name="ordering" size="1"', orders, originalPos, originalPos, originalOrder );
						//-->
						</script>
						</td>
					</tr>
					<tr>
						<td valign="top" align="left">
						<?php 
        echo $adminLanguage->A_COMP_ACCESS_LEVEL;
        ?>
:
						</td>
						<td>
						<?php 
        echo $lists['access'];
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top">
						<?php 
        echo $adminLanguage->A_COMP_PUBLISHED;
        ?>
:
						</td>
						<td>
						<?php 
        echo $lists['published'];
        ?>
						</td>
					</tr>
					<tr>
						<td colspan="2">
						</td>
					</tr>
					<tr>
						<td valign="top">
						<?php 
        echo $adminLanguage->A_COMP_ID;
        ?>
:
						</td>
						<td>
						<?php 
        echo $row->id;
        ?>
						</td>
					</tr>
					<!-- END selectable pages -->
					<?php 
        if ($row->module == "") {
            ?>
						<tr>
							<td valign="top" align="left">
							<?php 
            echo $adminLanguage->A_COMP_MOD_CONTENT;
            ?>
:
							</td>
							<td>
							<?php 
            // parameters : areaname, content, hidden field, width, height, rows, cols
            editorArea('editor1', $row->content, 'content', '500', '350', '70', '15');
            ?>
							</td>
						</tr>
						<?php 
        }
        ?>
					</table>
				</td>
				<td width="40%">
					<table width="100%">
					<tr>
						<td>
						<?php 
        $tabs->startPane("module");
        $tabs->startTab($adminLanguage->A_COMP_MOD_TAB_LBL, "location-page");
        ?>
						<table width="100%" class="adminform">
						<tr>
							<th>
							<?php 
        echo $adminLanguage->A_COMP_MOD_POSITION;
        ?>
							</th>
						<tr>
						<tr>
							<td>
							<?php 
        echo $adminLanguage->A_COMP_MOD_ITEM_LINK;
        ?>
:
							<br /><br />
							<?php 
        echo $lists['selections'];
        ?>
							</td>
						</tr>
						</table>
						<?php 
        $tabs->endTab();
        $tabs->startTab($adminLanguage->A_COMP_CONT_PARAMETERS, "params-page");
        ?>
						<table class="adminform">
						<tr>
							<th >
							<?php 
        echo $adminLanguage->A_COMP_CONT_PARAMETERS;
        ?>
							</th>
						<tr>
						<tr>
							<td>
							<?php 
        echo $params->render();
        ?>
							</td>
						</tr>
						</table>
						<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>
						</td>
					</tr>
					</table>
				</td>
			</tr>
		</table>
	
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="original" value="<?php 
        echo $row->ordering;
        ?>
" />
		<input type="hidden" name="module" value="<?php 
        echo $row->module;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="client_id" value="<?php 
        echo $lists['client_id'];
        ?>
" />
		<?php 
        if ($row->client_id || $lists['client_id']) {
            echo '<input type="hidden" name="client" value="admin" />';
        }
        ?>
		</form>
		<script language="Javascript" src="<?php 
        echo $mosConfig_live_site;
        ?>
/includes/js/overlib_mini.js"></script>
		<?php 
    }
Exemplo n.º 6
0
    /**
     * The function to handle all default page situations
     * not responsible for lists!
     */
    function FORMS_MENU_SAVE_CANCEL()
    {
        global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_lang, $VM_LANG, $page, $limitstart, $vmIcons;
        $no_menu = (int) $_REQUEST['no_menu'];
        $bar =& vmToolBar::getInstance('virtuemart');
        $is_iframe = vmGet($_REQUEST, 'is_iframe', 0);
        $product_parent_id = vmGet($_REQUEST, 'product_parent_id', 0);
        $product_id = vmGet($_REQUEST, 'product_id');
        $script = '';
        if (is_array($product_id)) {
            $product_id = "";
        }
        // These editor arrays tell the toolbar to load correct "getEditorContents" script parts
        // This is necessary for WYSIWYG Editors like TinyMCE / mosCE / FCKEditor
        $editor1_array = array('product.product_form' => 'product_desc', 'shopper.shopper_group_form' => 'shopper_group_desc', 'product.product_category_form' => 'category_description', 'manufacturer.manufacturer_form' => 'mf_desc', 'store.store_form' => 'vendor_store_desc', 'product.product_type_parameter_form' => 'parameter_description', 'product.product_type_form' => 'product_type_description', 'vendor.vendor_form' => 'vendor_store_desc');
        $editor2_array = array('store.store_form' => 'vendor_terms_of_service', 'vendor.vendor_form' => 'vendor_terms_of_service');
        $editor1 = isset($editor1_array[$page]) ? $editor1_array[$page] : '';
        $editor2 = isset($editor2_array[$page]) ? $editor2_array[$page] : '';
        if ($no_menu) {
            vmCommonHTML::loadExtJS();
        }
        $script .= '
var submitbutton = function(pressbutton){
	
	var form = document.adminForm;
	if (pressbutton == \'cancel\') {
		submitform( pressbutton );
		return;
	}	
';
        if ($editor1 != '') {
            if (vmIsJoomla(1.5)) {
                jimport('joomla.html.editor');
                $editor_type = $GLOBALS['mainframe']->getCfg('editor');
                if ($editor_type != 'none') {
                    $editor = JEditor::getInstance();
                    $script .= $editor->getContent($editor1);
                }
            } else {
                ob_start();
                getEditorContents('editor1', $editor1);
                $script .= ob_get_contents();
                ob_end_clean();
            }
        }
        if ($editor2 != '') {
            if (vmIsJoomla(1.5)) {
                jimport('joomla.html.editor');
                $editor_type = $GLOBALS['mainframe']->getCfg('editor');
                if ($editor_type != 'none') {
                    $editor = JEditor::getInstance();
                    $script .= $editor->getContent($editor2);
                }
            } else {
                ob_start();
                getEditorContents('editor2', $editor2);
                $script .= ob_get_contents();
                ob_end_clean();
            }
        }
        if ($no_menu) {
            $admin = defined('_VM_IS_BACKEND') ? '/administrator' : '';
            $script .= "\r\n    // define some private variables\r\n    var dialog, showBtn;\r\n\r\n    var showDialog = function( content ) {\r\n    \tExt.Msg.show( { \r\n            \t\ttitle: '" . $VM_LANG->_('PEAR_LOG_NOTICE') . "',\r\n            \t\tmsg: content,\r\n            \t\tautoCreate: true,\r\n                    width:400,\r\n                    height:180,\r\n                    modal: false,\r\n                    resizable: false,\r\n                    buttons: Ext.Msg.OK,\r\n                    shadow:true,\r\n                    animEl:Ext.get( 'vm-toolbar' )\r\n            });\r\n        " . (DEBUG ? "" : "setTimeout('Ext.Msg.hide()', 3000);") . "\r\n    };\r\n    \r\n    // return a public interface\r\n    var onSuccess = function(o,c) {\r\n\t\tshowDialog( o.responseText );\r\n\t};\r\n    var onFailure = function(o) {\r\n\t\tExt.Msg.alert( 'Error!', 'Save action failed: ' + o.statusText );\r\n\t};\r\n\tvar onCallback=function(o,s,r) {\r\n\t\t//if( s ) alert( 'Success' );\r\n\t\t//else alert( 'Failure' );\r\n\t}\r\n\t\r\n   \tExt.Ajax.request( { method: 'POST',\r\n   \t\t\t\t\t\turl: '{$_SERVER['PHP_SELF']}',\r\n   \t\t\t\t\t\tsuccess: onSuccess,\r\n   \t\t\t\t\t\tfailure: onFailure,\r\n   \t\t\t\t\t\tcallback: onCallback,\r\n   \t\t\t\t\t\tisUpload: true,\r\n   \t\t\t\t\t\tform: document.adminForm,\r\n   \t\t\t\t\t\tparams: { no_html:1 }\r\n   \t\t\t\t\t\t}\r\n   \t\t\t\t\t);\r\n\t";
        } else {
            $script .= "\n\t\t\tsubmitform( pressbutton );\n";
        }
        $script .= "\t\t}\n";
        $bar->buttons .= $script;
        if ($page == "product.product_form" && !empty($product_id)) {
            if (empty($product_parent_id)) {
                // add new attribute
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_attribute_form&product_id=" . $product_id . "&limitstart=" . $limitstart . "&no_menu={$no_menu}";
                $alt = $VM_LANG->_('PHPSHOP_ATTRIBUTE_FORM_MNU');
                $bar->customHref($href, 'new', $alt);
            } else {
                // back to parent product
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_id={$product_parent_id}&limitstart=" . $limitstart . "&no_menu={$no_menu}";
                $alt = $VM_LANG->_('PHPSHOP_PRODUCT_FORM_RETURN_LBL');
                $bar->customHref($href, $vmIcons['back_icon'], $vmIcons['back_icon2'], $alt);
                // new child product
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_parent_id={$product_parent_id}&limitstart=" . $limitstart . "&no_menu={$no_menu}";
                $alt = $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ADD_ANOTHER_ITEM_MNU');
                $bar->customHref($href, 'new', $alt);
            }
            // Go to Price list
            $href = $_SERVER['PHP_SELF'] . "?page=product.product_price_list&product_id={$product_id}&product_parent_id={$product_parent_id}&limitstart={$limitstart}&return_args=&option=com_virtuemart&no_menu={$no_menu}";
            $alt = $VM_LANG->_('PHPSHOP_PRICE_LIST_MNU');
            $bar->customHref($href, 'new', $alt);
            // add product type
            $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_product_type_form&product_id={$product_id}&product_parent_id={$product_parent_id}&limitstart={$limitstart}&no_menu={$no_menu}";
            $alt = $VM_LANG->_('PHPSHOP_PRODUCT_PRODUCT_TYPE_FORM_MNU');
            $bar->customHref($href, 'new', $alt);
            /*** Adding an item is only pssible, if the product has attributes ***/
            if (ps_product::product_has_attributes($product_id)) {
                // Add Item
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_parent_id={$product_id}&limitstart={$limitstart}&no_menu={$no_menu}";
                $alt = $VM_LANG->_('PHPSHOP_PRODUCT_FORM_NEW_ITEM_LBL');
                $bar->customHref($href, 'new', $alt);
            }
            $bar->divider();
        } elseif ($page == "admin.country_form") {
            if (!empty($_REQUEST['country_id'])) {
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=admin.country_state_form&country_id=" . intval($_REQUEST['country_id']) . "&limitstart={$limitstart}&no_menu={$no_menu}";
                $alt = $VM_LANG->_('PHPSHOP_ADD_STATE');
                $bar->customHref($href, 'new', $alt);
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=admin.country_state_list&country_id=" . intval($_REQUEST['country_id']) . "&limitstart={$limitstart}&no_menu={$no_menu}";
                $alt = $VM_LANG->_('PHPSHOP_LIST_STATES');
                $bar->customHref($href, 'new', $alt);
                $bar->divider();
            }
        }
        $bar->save('save', $VM_LANG->_('CMN_SAVE'));
        //$bar->apply( 'apply', $VM_LANG->_('E_APPLY') );
        $bar->cancel();
    }
Exemplo n.º 7
0
    function JLMS_cLook_Feel(&$row, &$lists, $option)
    {
        JHTML::_('behavior.tooltip');
        ?>
		<script language="javascript" type="text/javascript">
		<!--
		function setgood() {
			return true;
		}
		function submitbutton(pressbutton) {
			var form = document.adminForm;
		<?php 
        if (class_exists('JFactory')) {
            $editor =& JLMS07062010_JFactory::getEditor();
            echo $editor->save('frontpage_text_guest');
        } else {
            getEditorContents('editor3', 'frontpage_text_guest');
        }
        ?>
			try {
				form.onsubmit();
			} catch(e) {
				//alert(e);
			}
			var form2 = document.adminForm_text_guest;
			try {
				form2.onsubmit();
			} catch(e) {
				//alert(e);
			}
			form.frontpage_text_guest.value = form2.frontpage_text_guest.value;
			submitform( pressbutton );
		}
		
		<?php 
        if (JLMS_J16version()) {
            ?>
		Joomla.submitbutton = submitbutton;
		<?php 
        }
        ?>
		//-->
		</script>
		
		<?php 
        //for table
        $colgroup = '
		<colgroup>
			<col width="180">
		</colgroup>
		';
        ?>
		
	<div>
<table width="100%" >
	<tr>
		<td width="220" valign="top">
		<div>
			<?php 
        echo joomla_lms_adm_html::JLMS_menu();
        ?>
		</div>
		</td>
		<td valign="top">
		<div class="width-100">
		<fieldset class="adminform">
		<?php 
        if (!class_exists('JToolBarHelper')) {
            ?>
		<table class="adminheading">
		<tr>
			<th class="config"><?php 
            echo _JOOMLMS_COMP_NAME;
            ?>
:
				<small>
					<?php 
            echo _JLMS_LF_APPEARANCE;
            ?>
				</small>
			</th>
		</tr>
		</table>
		<?php 
        }
        ?>
		<table width="100%" border="0">
			<tr>
				<td valign="top" >				
	<form action="index.php" method="post" name="adminForm" onsubmit="setgood();">	
				<table >
					<tr>
					<td>
					<div class="width-100">
					<fieldset class="adminform"><legend><?php 
        echo _JLMS_LF_JLMS_TOP_MENU;
        ?>
</legend>
					<table cellpadding="0" cellspacing="0">
						<?php 
        echo $colgroup;
        ?>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_SHOW_TOP_MENU;
        ?>
:</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['lofe_show_top'];
        ?>
							</fieldset>
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_TOP_MENU_STYLE;
        ?>
:</td>
							<td>
								<fieldset class="radio">
								<?php 
        echo $lists['lofe_menu_style'];
        ?>
								</fieldset>
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_SHOW_MENU_ITEM_HEAD;
        ?>
:</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['lofe_show_head'];
        ?>
							</fieldset>
							</td>
						</tr>
					</table>
					</fieldset>
					</div>
					</td>
					</tr>
					<tr>
					<td>
					<div class="width-100">
					<fieldset class="adminform"><legend><?php 
        echo _JLMS_LF_COURSE_SELECTBOX;
        ?>
</legend>
					<table cellpadding="0" cellspacing="0">
						<?php 
        echo $colgroup;
        ?>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_SHOW_COURSE_SELB;
        ?>
:</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['lofe_show_course_box'];
        ?>
							</fieldset>
							</td>
						</tr>						
					</table>
					</fieldset>
					</div>
					</td>
					</tr>
					<?php 
        //Show Status Lpaths/Scorms //by Max - 25.02.2011
        ?>
					<tr>
						<td>
						<div class="width-100">
							<fieldset class="adminform">
								<legend><?php 
        echo _JLMS_LF_RESULTS_DISPLAY_OPTIONS;
        ?>
</legend>
								<table cellpadding="0" cellspacing="0">
									<?php 
        echo $colgroup;
        ?>
									<tr>
										<td valign="top">
											<?php 
        echo _JLMS_LF_SCORM_STATUS_AS;
        ?>
:
										</td>
										<td>
											<fieldset class="radio">
												<?php 
        echo $lists['scorm_status_as'];
        ?>
											</fieldset>
										</td>
									</tr>
									<tr>
										<td valign="top">
											<?php 
        echo _JLMS_LF_LPATH_STATUS_AS;
        ?>
:
										</td>
										<td>
											<fieldset class="radio">
												<?php 
        echo $lists['lpath_status_as'];
        ?>
											</fieldset>
										</td>
									</tr>
									<tr>
										<td valign="top">
											<?php 
        echo _JLMS_LF_QUIZ_STATUS_AS;
        ?>
:
										</td>
										<td>
											<fieldset class="radio">
												<?php 
        echo $lists['quiz_status_as'];
        ?>
											</fieldset>
										</td>
									</tr>
								</table>
							</fieldset>
						</div>
						</td>
					</tr>

					<tr>
					<td>
					<div class="width-100">
					<fieldset class="adminform"><legend><?php 
        echo _JLMS_LF_META_DATA;
        ?>
</legend>
					<table cellpadding="0" cellspacing="0">
						<?php 
        echo $colgroup;
        ?>
						<tr>
							<td><?php 
        echo _JLMS_LF_META_DESC;
        ?>
:</td>
							<td>
								<textarea class="text_area" cols="60" rows="2" style="width:500px; height:40px" name="meta_desc"><?php 
        echo $row->meta_desc;
        ?>
</textarea>
							</td>
						</tr>
						<tr>
							<td><?php 
        echo _JLMS_LF_META_KEYW;
        ?>
:</td>
							<td>
								<textarea class="text_area" cols="60" rows="2" style="width:500px; height:40px" name="meta_keys"><?php 
        echo $row->meta_keys;
        ?>
</textarea>
							</td>
						</tr>
					</table>
					</fieldset>
					</div>
					</td>
					</tr>
					<tr>
					<td>
					<div class="width-100">
					<fieldset class="adminform"><legend><?php 
        echo _JLMS_LF_HPAGE_CONFIG;
        ?>
</legend>
					<table cellpadding="0" cellspacing="0">
						<?php 
        echo $colgroup;
        ?>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_CH_COURSES_LI_MOD;
        ?>
:</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['frontpage_courses'];
        ?>
							</fieldset>
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_CH_COURSES_EXPAND_ALL;
        ?>
:</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['frontpage_courses_expand_all'];
        ?>
							</fieldset>
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_CH_ALL_COURSES_L;
        ?>
:</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['frontpage_allcourses'];
        ?>
							</fieldset>
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_CH_ANNOUNCEMENTS_M;
        ?>
:</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['frontpage_announcements'];
        ?>
							</fieldset>
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_CH_HOMEW_M;
        ?>
:</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['frontpage_homework'];
        ?>
							</fieldset>
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_CH_DROPB_M;
        ?>
 :</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['frontpage_dropbox'];
        ?>
							</fieldset>
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_CH_MAILB_M;
        ?>
 :</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['frontpage_mailbox'];
        ?>
							</fieldset>
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_CH_CRT_M;
        ?>
 :</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['frontpage_certificates'];
        ?>
							</fieldset>
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_CH_LFP_M;
        ?>
 :</td>
							<td>
							<fieldset class="radio">
							<?php 
        echo $lists['frontpage_latest_forum_posts'];
        ?>
							</fieldset>
							</td>
						</tr>
						<tr><td><?php 
        echo _JLMS_LF_NUM_ITEMS_IN_M;
        ?>
:</td>
							<td><input class="text_area" type="text" name="homepage_items" size="3" maxlength="4" value="<?php 
        echo $row->homepage_items;
        ?>
"/>							
							</td>
						</tr>
						<tr><td valign="top"><?php 
        echo _JLMS_LF_HOMEP_TEXT;
        ?>
:</td>
							<td>
							<?php 
        JLMS_editorArea('editor2', $row->frontpage_text, 'frontpage_text', '100%;', '250', '40', '20');
        ?>
							</td>
						</tr>
					</table>
					</fieldset>
					</div>
					</td>
					</tr>
				</table>
	<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
"/>
	<input type="hidden" name="boxchecked" value=""/>
	<input type="hidden" name="task" value=""/>
	<input type="hidden" name="frontpage_text_guest" value=""/>	
	</form>	
	</fieldset>
	</div>
				<table >
					<tr>
					<td>
					<form action="index.php" method="post" name="adminForm_text_guest" onsubmit="setgood();">
					<div class="width-100">
						<fieldset class="adminform"><legend><?php 
        echo _JLMS_LF_HOMEP_TEXT_UNR_USRS;
        ?>
</legend>
							<table cellpadding="0" cellspacing="0">
								<tr>
									<td>
										<?php 
        JLMS_editorArea('editor3', $row->frontpage_text_guest, 'frontpage_text_guest', '100%;', '250', '40', '20');
        ?>
									</td>
								</tr>
							</table>
						</fieldset>
					</div>
					</form>
					</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>

		</td>
	</tr>
</table>

	</div>

<?php 
    }
    /**
     * Writes the edit form for new and existing categories
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.  Note that the <var>section</var> property <b>must</b> be defined
     * even for a new record.
     * @param mosCategory The category object
     * @param string The html for the image list select list
     * @param string The html for the image position select list
     * @param string The html for the ordering list
     * @param string The html for the groups select list
     */
    function edit(&$row, $option, &$lists, &$menus)
    {
        global $mosConfig_live_site;
        if ($row->name != '') {
            $name = $row->name;
        } else {
            $name = "Nova Seção";
        }
        if ($row->image == "") {
            $row->image = 'blank.png';
        }
        mosMakeHtmlSafe($row, ENT_QUOTES, 'descrição');
        ?>
		<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "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("Seção tem que possuir um nome");
			} else if (form.title.value ==""){
				alert("A seção tem que possuir 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="sections">
			Seção:
			<small>
			<?php 
        echo $row->id ? 'Editar' : 'Nova';
        ?>
			</small>
			<small><small>
			[ <?php 
        echo stripslashes($name);
        ?>
 ]
			</small></small>
			</th>
		</tr>
		</table>

		<table width="100%">
		<tr>
			<td valign="top" width="60%">
				<table class="adminform">
				<tr>
					<th colspan="3">
					Detalhes da Seção
					</th>
				<tr>
				<tr>
					<td width="100">
					Âmbito:
					</td>
					<td width="85%" colspan="2">
					<strong>
					<?php 
        echo $row->scope;
        ?>
					</strong>
					</td>
				</tr>
				<tr>
					<td>
					Título:
					</td>
					<td colspan="2">
					<input class="text_area" type="text" name="title" value="<?php 
        echo $row->title;
        ?>
" size="50" maxlength="50" title="Um nome abreviado para ser utilizado nos menus" />
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo isset($row->section) ? "Categoria" : "Seção";
        ?>
 Nome:
					</td>
					<td colspan="2">
					<input class="text_area" type="text" name="name" value="<?php 
        echo $row->name;
        ?>
" size="50" maxlength="255" title="Um nome longo para ser utilizado nos cabeçalhos" />
					</td>
				</tr>
				<tr>
					<td>
					Ordenação:
					</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%">
					<?php 
        $path = $mosConfig_live_site . "/images/";
        if ($row->image != "blank.png") {
            $path .= "stories/";
        }
        ?>
					<img src="<?php 
        echo $path . $row->image;
        ?>
" name="imagelib" width="80" height="80" border="2" alt="Pré-visualizar" />
					</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">
				<?php 
        if ($row->id > 0) {
            ?>
					<table class="adminform">
					<tr>
						<th colspan="2">
					        Link Menu 
						</th>
					<tr>
					<tr>
						<td colspan="2">
					        Este irá criar um novo item de menu no menu que você selecionou
						<br /><br />
						</td>
					<tr>
					<tr>
						<td valign="top" width="100px">
					        Selecione um Menu 
						</td>
						<td>
						<?php 
            echo $lists['menuselect'];
            ?>
						</td>
					<tr>
					<tr>
						<td valign="top" width="100px">
						Tipo do Menu 
						</td>
						<td>
						<?php 
            echo $lists['link_type'];
            ?>
						</td>
					<tr>
					<tr>
						<td valign="top" width="100px">
						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>
						&nbsp;
						</th>
					</tr>
					<tr>
						<td>
						Links de menus disponíveis somente depois de salvar a seção
						</td>
					</tr>
					</table>
					<?php 
        }
        ?>
				<br />
				<table class="adminform">
				<tr>
					<th colspan="2">
					Diretórios MOSImage
					</th>
					<tr>
					<tr>
					<td colspan="2">
					<?php 
        echo $lists['folders'];
        ?>
					</td>
				<tr>
				</table>
			</td>
		</tr>
		</table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="scope" value="<?php 
        echo $row->scope;
        ?>
" />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="oldtitle" value="<?php 
        echo $row->title;
        ?>
" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
Exemplo n.º 9
0
";
				}
			}
		}
	}

	if ( msg != '' ){
		msghdr = '<?php 
echo _DML_ENTRY_ERRORS;
?>
';
		msghdr += '\n=================================';
		alert( msghdr + msg + '\n' );
	} else {
		/* for static content */
		<?php 
getEditorContents('editor1', 'dmdescription');
?>
		submitform(pressbutton);
	}
}

function setgood() {
	document.adminForm.goodexit.value=1;
}

function WarnUser() {

}
<?php 
die;
Exemplo n.º 10
0
    /**
     * Writes the edit form for new and existing categories
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.  Note that the <var>section</var> property <b>must</b> be defined
     * even for a new record.
     * @param mosCategory The category object
     * @param string The html for the image list select list
     * @param string The html for the image position select list
     * @param string The html for the ordering list
     * @param string The html for the groups select list
     */
    function edit(&$row, $option, &$lists, &$menus)
    {
        global $mosConfig_live_site;
        if ($row->name != '') {
            $name = $row->name;
        } else {
            $name = "New Section";
        }
        if ($row->image == "") {
            $row->image = 'blank.png';
        }
        mosMakeHtmlSafe($row, ENT_QUOTES, 'description');
        ?>
		<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "Please select a Menu" );
					return;
				} else if ( form.link_type.value == "" ) {
					alert( "Please select a menu type" );
					return;
				} else if ( form.link_name.value == "" ) {
					alert( "Please enter a Name for this menu item" );
					return;
				}
			}

			if (form.name.value == ""){
				alert("Section must have a name");
			} else if (form.title.value ==""){
				alert("Section must have a title");
			} else {
				<?php 
        getEditorContents('editor1', 'description');
        ?>
				submitform(pressbutton);
			}
		}
		</script>

		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th class="sections">
			Section:
			<small>
			<?php 
        echo $row->id ? 'Edit' : 'New';
        ?>
			</small>
			<small><small>
			[ <?php 
        echo stripslashes($name);
        ?>
 ]
			</small></small>
			</th>
		</tr>
		</table>

		<table width="100%">
		<tr>
			<td valign="top" width="60%">
				<table class="adminform">
				<tr>
					<th colspan="3">
					Section Details
					</th>
				<tr>
				<tr>
					<td width="100">
					Scope:
					</td>
					<td width="85%" colspan="2">
					<strong>
					<?php 
        echo $row->scope;
        ?>
					</strong>
					</td>
				</tr>
				<tr>
					<td>
					Title:
					</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 isset($row->section) ? "Category" : "Section";
        ?>
 Name:
					</td>
					<td colspan="2">
					<input class="text_area" type="text" name="name" value="<?php 
        echo $row->name;
        ?>
" size="50" maxlength="255" title="A long name to be displayed in headings" />
					</td>
				</tr>
				<tr>
					<td>
					Ordering:
					</td>
					<td colspan="2">
					<?php 
        echo $lists['ordering'];
        ?>
					</td>
				</tr>
				<tr>
					<td>
					Image:
					</td>
					<td>
					<?php 
        echo $lists['image'];
        ?>
					</td>
					<td rowspan="5" width="50%">
					<?php 
        $path = $mosConfig_live_site . "/images/";
        if ($row->image != "blank.png") {
            $path .= "stories/";
        }
        ?>
					<img src="<?php 
        echo $path . $row->image;
        ?>
" name="imagelib" width="80" height="80" border="2" alt="Preview" />
					</td>
				</tr>
				<tr>
					<td>
					Image Position:
					</td>
					<td>
					<?php 
        echo $lists['image_position'];
        ?>
					</td>
				</tr>
				<tr>
					<td>
					Access Level:
					</td>
					<td>
					<?php 
        echo $lists['access'];
        ?>
					</td>
				</tr>
				<tr>
					<td>
					Published:
					</td>
					<td>
					<?php 
        echo $lists['published'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="2">
					Description:
					</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">
				<?php 
        if ($row->id > 0) {
            ?>
					<table class="adminform">
					<tr>
						<th colspan="2">
						Link to Menu
						</th>
					<tr>
					<tr>
						<td colspan="2">
						This will create a new menu item in the menu you select
						<br /><br />
						</td>
					<tr>
					<tr>
						<td valign="top" width="100px">
						Select a Menu
						</td>
						<td>
						<?php 
            echo $lists['menuselect'];
            ?>
						</td>
					<tr>
					<tr>
						<td valign="top" width="100px">
						Select Menu Type
						</td>
						<td>
						<?php 
            echo $lists['link_type'];
            ?>
						</td>
					<tr>
					<tr>
						<td valign="top" width="100px">
						Menu Item 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="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::menuLinksSecCat($menus);
            }
            ?>
					<tr>
						<td colspan="2">
						</td>
					</tr>
					</table>
					<?php 
        } else {
            ?>
					<table class="adminform" width="40%">
					<tr>
						<th>
						&nbsp;
						</th>
					</tr>
					<tr>
						<td>
						Menu links available when saved
						</td>
					</tr>
					</table>
					<?php 
        }
        ?>
				<br />
				<table class="adminform">
				<tr>
					<th colspan="2">
					MOSImage Directories
					</th>
					<tr>
					<tr>
					<td colspan="2">
					<?php 
        echo $lists['folders'];
        ?>
					</td>
				<tr>
				</table>
			</td>
		</tr>
		</table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="scope" value="<?php 
        echo $row->scope;
        ?>
" />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="oldtitle" value="<?php 
        echo $row->title;
        ?>
" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
Exemplo n.º 11
0
    /**
     * Writes the edit form for new and existing categories
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.  Note that the <var>section</var> property <b>must</b> be defined
     * even for a new record.
     * @param mosCategory The category object
     * @param string The html for the image list select list
     * @param string The html for the image position select list
     * @param string The html for the ordering list
     * @param string The html for the groups select list
     */
    function edit(&$row, $option, &$lists, &$menus)
    {
        global $mosConfig_live_site;
        if ($row->name != '') {
            $name = $row->name;
        } else {
            $name = T_("New Section");
        }
        if ($row->image == "") {
            $row->image = 'blank.png';
        }
        ?>
		<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "<?php 
        echo T_('Please select a Menu');
        ?>
" );
					return;
				} else if ( form.link_type.value == "" ) {
					alert( "<?php 
        echo T_('Please select a menu type');
        ?>
" );
					return;
				} else if ( form.link_name.value == "" ) {
					alert( "<?php 
        echo T_('Please enter a Name for this menu item');
        ?>
" );
					return;
				}
			}

			if (form.name.value == ""){
				alert("<?php 
        echo T_('Section must have a name');
        ?>
");
			} else if (form.title.value ==""){
				alert("<?php 
        echo T_('Section must have a title');
        ?>
");
			} else {
				<?php 
        getEditorContents('editor1', 'description');
        ?>
				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">
		<tr>
			<th class="sections">
			<?php 
        echo T_('Section:');
        ?>
			<small>
			<?php 
        echo $row->id ? T_('Edit') : T_('New');
        ?>
			</small>
			<small><small>
			[ <?php 
        echo $name;
        ?>
 ]
			</small></small>
			</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 width="100%">
		<tr>
			<td valign="top" >
				<table class="adminform">
				<tr>
					<th colspan="3">
					<?php 
        echo T_('Section Details');
        ?>
					</th>
				</tr>
				<tr>
					<td width="150">
					<?php 
        echo T_('Scope:');
        ?>
					</td>
					<td width="85%" colspan="2">
					<strong>
					<?php 
        echo $row->scope;
        ?>
					</strong>
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo T_('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 T_('A short name to appear in menus');
        ?>
" />
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo isset($row->section) ? T_("Category") : T_("Section");
        ?>
 <?php 
        echo T_('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 T_('A long name to be displayed in headings');
        ?>
" />
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo T_('Image:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['image'];
        ?>
					</td>
					<td rowspan="4" width="50%">
					<?php 
        $path = $mosConfig_live_site . "/images/";
        if ($row->image != "blank.png") {
            $path .= "stories/";
        }
        ?>
					<img src="<?php 
        echo $path;
        echo $row->image;
        ?>
" name="imagelib" width="80" height="80" border="2" alt="<?php 
        echo T_('Preview');
        ?>
" />
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo T_('Image Position:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['image_position'];
        ?>
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo T_('Ordering:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['ordering'];
        ?>
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo T_('Access Level:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['access'];
        ?>
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo T_('Published:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['published'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top">
					<?php 
        echo T_('Description:');
        ?>
					</td>
					<td colspan="2">
					<?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" align="right">
			<div id="simpleediting" style="display:<?php 
        echo $simpleediting;
        ?>
">
			<table cellspacing="0" cellpadding="0" border="0" width="100%" >
				<tr>
					<td width="40%">
			<?php 
        if ($row->id > 0) {
            ?>
				<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 new menu item in the menu you select');
            ?>
					<br /><br />
					</td>
				</tr>
				<tr>
					<td valign="top" width="100px">
					<?php 
            echo T_('Select a Menu');
            ?>
					</td>
					<td>
					<?php 
            echo $lists['menuselect'];
            ?>
					</td>
				</tr>
				<tr>
					<td valign="top" width="100px">
					<?php 
            echo T_('Select Menu Type');
            ?>
					</td>
					<td>
					<?php 
            echo $lists['link_type'];
            ?>
					</td>
				</tr>
				<tr>
					<td valign="top" width="100px">
					<?php 
            echo T_('Menu Item 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 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::menuLinksSecCat($menus);
            }
            ?>
				<tr>
					<td colspan="2">
					</td>
				</tr>
				</table>
			<?php 
        } else {
            ?>

			<table class="adminform" width="40%">
				<tr><th>&nbsp;</th></tr>
				<tr><td><?php 
            echo T_('Menu links available when saved');
            ?>
</td></tr>
			</table>
			<?php 
        }
        ?>
			</td>
		</tr>
		</table>
		</div>
		</td>
		</tr>
		</table>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="scope" value="<?php 
        echo $row->scope;
        ?>
" />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="oldtitle" value="<?php 
        echo $row->title;
        ?>
" />
		</form>
		</td>
		</tr>
		</table>
		<?php 
    }
Exemplo n.º 12
0
    function editLicense($option, &$row)
    {
        global $mosConfig_absolute_path;
        mosMakeHtmlSafe($row);
        ?>

        <script language="javascript" type="text/javascript">
            function submitbutton(pressbutton) {
				  var form = document.adminForm;
				  if (pressbutton == 'cancel') {
					submitform( pressbutton );
					return;
				  }

				if (form.name.value == "") {
					alert ( "<?php 
        echo _E_WARNTITLE;
        ?>
" );
				} else {
				  <?php 
        getEditorContents('editor1', 'license');
        ?>
				  submitform( pressbutton );
				}
			}
        </script>
		<form action="index2.php" method="post" name="adminForm" id="adminForm">
		<?php 
        $tmp = ($row->id ? _DML_EDIT : _DML_ADD) . ' ' . _DML_LICENSES;
        dmHTML::adminHeading($tmp, 'licenses');
        ?>

        <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
				<tr>
					<td width="20%" align="right"><?php 
        echo _DML_NAME;
        ?>
:</td>
					<td width="80%">
						<input class="inputbox" type="text" name="name" size="50" maxlength="100" value="<?php 
        echo $row->name;
        ?>
" />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right"><?php 
        echo _DML_LICENSE_TEXT;
        ?>
:</td>
				<td>
					<?php 
        DOCMAN_Compat::editorArea('editor1', $row->license, 'license', '700', '600', '60', '30');
        ?>
				</td>
			  </tr>

			<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
			<input type="hidden" name="option" value="com_docman" />
			<input type="hidden" name="section" value="licenses" />
			<input type="hidden" name="task" value="" />
            <?php 
        echo DOCMAN_token::render();
        ?>
		</form>
	</table>
    <?php 
        include_once $mosConfig_absolute_path . "/components/com_docman/footer.php";
    }
Exemplo n.º 13
0
    /**
     * 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 = 'Content';
        } else {
            $component = ucfirst(substr($redirect, 4));
            if ($redirect == 'com_contact_details') {
                $component = 'Contact';
            }
        }
        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( "Please select a Menu" );
					return;
				} else if ( form.link_type.value == "" ) {
					alert( "Please select a menu type" );
					return;
				} else if ( form.link_name.value == "" ) {
					alert( "Please enter a Name for this menu item" );
					return;
				}
			}

			if ( form.name.value == "" ) {
				alert("Category must have a name");
			} else if (form.title.value ==""){
				alert("Category must have a title");
			} else {
				<?php 
        getEditorContents('editor1', 'description');
        ?>
				submitform(pressbutton);
			}
		}
		</script>

		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th class="categories">
			Category:
			<small>
			<?php 
        echo $row->id ? 'Edit' : 'New';
        ?>
			</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">
					Category Details
					</th>
				<tr>
				<tr>
					<td>
					Category Title:
					</td>
					<td colspan="2">
					<input class="text_area" type="text" name="title" value="<?php 
        echo stripslashes($row->title);
        ?>
" size="50" maxlength="50" title="A short name to appear in menus" />
					</td>
				</tr>
				<tr>
					<td>
					Category Name:
					</td>
					<td colspan="2">
					<input class="text_area" type="text" name="name" value="<?php 
        echo stripslashes($row->name);
        ?>
" size="50" maxlength="255" title="A long name to be displayed in headings" />
					</td>
				</tr>
				<tr>
					<td>
					Section:
					</td>
					<td colspan="2">
					<?php 
        echo $lists['section'];
        ?>
					</td>
				</tr>
				<tr>
					<td>
					Ordering:
					</td>
					<td colspan="2">
					<?php 
        echo $lists['ordering'];
        ?>
					</td>
				</tr>
				<tr>
					<td>
					Image:
					</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>
					Image Position:
					</td>
					<td>
					<?php 
        echo $lists['image_position'];
        ?>
					</td>
				</tr>
				<tr>
					<td>
					Access Level:
					</td>
					<td>
					<?php 
        echo $lists['access'];
        ?>
					</td>
				</tr>
				<tr>
					<td>
					Published:
					</td>
					<td>
					<?php 
        echo $lists['published'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="2">
					Description:
					</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">
						This will create a new menu item in the menu you select
						<br /><br />
						</td>
					<tr>
					<tr>
						<td valign="top" width="100">
						Select a Menu
						</td>
						<td>
						<?php 
            echo $lists['menuselect'];
            ?>
						</td>
					<tr>
					<tr>
						<td valign="top" width="100">
						Select Menu Type
						</td>
						<td>
						<?php 
            echo $lists['link_type'];
            ?>
						</td>
					<tr>
					<tr>
						<td valign="top" width="100">
						Menu Item 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="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::menuLinksSecCat($menus);
            }
            ?>
					<tr>
						<td colspan="2">
						</td>
					</tr>
					</table>
					<?php 
        } else {
            ?>
					<table class="adminform" width="40%">
					<tr>
						<th>
						&nbsp;
						</th>
					</tr>
					<tr>
						<td>
						Menu links available when saved
						</td>
					</tr>
					</table>
					<?php 
        }
        // content
        if ($row->section > 0 || $row->section == 'content') {
            ?>
					<br />
					<table class="adminform">
					<tr>
						<th colspan="2">
						MOSImage Directories
						</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 
    }
Exemplo n.º 14
0
    function showEditDocument($doc_details, &$lists, $option, $id)
    {
        $JLMS_CONFIG =& JLMSFactory::getConfig();
        $Itemid = $JLMS_CONFIG->get('Itemid');
        $is_dis_start = !($doc_details->publish_start == 1);
        $is_dis_end = !($doc_details->publish_end == 1);
        ?>
<script language="javascript" type="text/javascript">
<!--//--><![CDATA[//><!--
window.addEvent('domready', function() {
	<?php 
        if ($is_dis_start) {
            ?>
	
			document.adminForm.startday.disabled = true;
			document.adminForm.startmonth.disabled = true;
			document.adminForm.startyear.disabled = true;
	<?php 
        }
        if ($is_dis_end) {
            ?>
			document.adminForm.endday.disabled = true;
			document.adminForm.endmonth.disabled = true;
			document.adminForm.endyear.disabled = true;	
	<?php 
        }
        ?>
	
}
);
function setgood() {
	return true;
}
function submitbutton(pressbutton) {
	var form=document.adminForm;
	try {
		form.onsubmit();
	} catch(e) {
		//alert(e);
	}
	if (is_start_c == 1) {if (form.start_date.value == ''){jlms_getDate('start');}}
	if (is_end_c == 1) {if (form.end_date.value == ''){jlms_getDate('end');}}
	<?php 
        if (!$doc_details->id && !($doc_details->folder_flag == 1)) {
            ?>
	if ((pressbutton=='save_doc') && ((form.userfile0.value=="") && (form.doc_name0.value==""))){alert("<?php 
            echo _JLMS_DOCS_SELECT_FILE_OR_ENTER_NAME;
            ?>
");
	<?php 
        } else {
            ?>
	if ((pressbutton=='save_doc') && (form.doc_name0.value=="")){alert("<?php 
            echo _JLMS_PL_ENTER_NAME;
            ?>
");
	<?php 
        }
        ?>
	} else {

	<?php 
        if (class_exists('JFactory')) {
            $editor =& JLMS07062010_JFactory::getEditor();
            echo $editor->save('doc_description');
        } else {
            getEditorContents('editor1', 'doc_description');
        }
        ?>

		form.task.value = pressbutton;
		form.submit();
	}
}
function submitbutton_aF2(pb, ri2) {
	var form=document.adminForm2;
	if (pb=='add_perms') {
		form.role_id2.value = 0;
		var sel_value = form.role_id.options[form.role_id.selectedIndex].value;
		if (sel_value == 0 || sel_value == '0') {
		} else {
			form.task2.value = pb;
			form.submit();
		}
	} else if (pb=='del_perms') {
		form.role_id2.value = ri2;
		form.task2.value = pb;
		form.submit();
	}
}
var is_start_c = <?php 
        echo $doc_details->publish_start ? '1' : '0';
        ?>
; var is_end_c = <?php 
        echo $doc_details->publish_end ? '1' : '0';
        ?>
;
function jlms_Change_start() {
	var form=document.adminForm;
	if (is_start_c == 1) {
		is_start_c = 0
		form.startday.disabled = true;
		form.startmonth.disabled = true;
		form.startyear.disabled = true;
	} else {
		is_start_c = 1
		form.startday.disabled = false;
		form.startmonth.disabled = false;
		form.startyear.disabled = false;
	}
}
function jlms_Change_end() {
	var form=document.adminForm;
	if (is_end_c == 1) {
		is_end_c = 0
		form.endday.disabled = true;
		form.endmonth.disabled = true;
		form.endyear.disabled = true;
	} else {
		is_end_c = 1
		form.endday.disabled = false;
		form.endmonth.disabled = false;
		form.endyear.disabled = false;
	}
}
<?php 
        if (!($doc_details->folder_flag == 1) && !$doc_details->id) {
            ?>
function jlms_changeZips_values(elem) {
	if (elem.name == 'upload_zip') {
		if (elem.value == '1' || elem.value == 1) {
			if (elem.form.zip_package.length) {
				var i;
				for (i = 0; i<elem.form.zip_package.length; i++) {
					if (elem.form.zip_package[i].value > 0) {
						if (elem.form.zip_package[i].checked) {
							elem.form.zip_package[i].checked = false;
						}
					} else {
						if (!elem.form.zip_package[i].checked) {
							elem.form.zip_package[i].checked = true;
						}
					}

				}
			}
			document.getElementById('jlms_newformbtn_row').style.display = '';
			document.getElementById('jlms_newformbtn_row').style.visibility = 'visible';
		}
	} else if (elem.name == 'zip_package') {
		if (elem.value == '1' || elem.value == 1) {
			if (elem.form.upload_zip.length) {
				var i;
				for (i = 0; i<elem.form.upload_zip.length; i++) {
					if (elem.form.upload_zip[i].value > 0) {
						if (elem.form.upload_zip[i].checked) {
							elem.form.upload_zip[i].checked = false;
						}
					} else {
						if (!elem.form.upload_zip[i].checked) {
							elem.form.upload_zip[i].checked = true;
						}
					}

				}
			}
			i = 1;
			while(document.getElementById('tr1_' + i)) {
				document.getElementById('tr1_' + i).style.display = 'none';
				document.getElementById('tr1_' + i).style.visibility = 'hidden';
				document.getElementById('tr2_' + i).style.display = 'none';
				document.getElementById('tr2_' + i).style.visibility = 'hidden';
				i++;
			}
			document.getElementById('jlms_newformbtn_row').style.display = 'none';
			document.getElementById('jlms_newformbtn_row').style.visibility = 'hidden';
		}
	}
}
<?php 
        } else {
            ?>
function jlms_changeZips_values(elem) {
	
}
<?php 
        }
        ?>
function Add_new_form() {
	i = 1;
	while(document.getElementById('tr1_' + i)) {
		if( document.getElementById('tr1_' + i).style.display == 'none' && document.getElementById('tr1_' + i).style.visibility == 'hidden') {
			document.getElementById('tr1_' + i).style.display = '';
			document.getElementById('tr1_' + i).style.visibility = 'visible';
			document.getElementById('tr2_' + i).style.display = '';
			document.getElementById('tr2_' + i).style.visibility = 'visible';
			break;
		}
		i++;
	}	
}
//--><!]]>
</script>
<?php 
        JLMS_TMPL::OpenMT();
        $hparams = array();
        $toolbar = array();
        $title = '';
        if ($doc_details->folder_flag == 1) {
            $title = $doc_details->id ? _JLMS_DOCS_TITLE_EDIT_FOLDER : _JLMS_DOCS_TITLE_NEW_FOLDER;
        } else {
            $title = $doc_details->id ? _JLMS_DOCS_TITLE_EDIT_DOC : _JLMS_DOCS_TITLE_NEW_DOC;
        }
        $toolbar[] = array('btn_type' => 'save', 'btn_js' => "javascript:submitbutton('save_doc');");
        $toolbar[] = array('btn_type' => 'cancel', 'btn_js' => "javascript:submitbutton('cancel_doc');");
        JLMS_TMPL::ShowHeader('doc', $title, $hparams, $toolbar);
        JLMS_TMPL::OpenTS();
        ?>
		<form action="<?php 
        echo sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid);
        ?>
" method="post" name="adminForm" enctype="multipart/form-data" onsubmit="setgood();">
			<table width="100%" cellpadding="0" cellspacing="0" border="0" id="jlms_item_properties">
				<tr>
					<td width="30%" valign="middle" style="vertical-align:middle"><?php 
        echo _JLMS_ENTER_NAME;
        ?>
</td>
					<td><input class="inputbox" size="40" type="text" name="doc_name0" value="<?php 
        echo str_replace('"', '&quot;', $doc_details->doc_name);
        ?>
" />
					</td>
				</tr>
			<?php 
        if (!($doc_details->folder_flag == 1)) {
            ?>
				<tr>
					<td valign="middle" style="vertical-align:middle"><br /><?php 
            echo _JLMS_CHOOSE_FILE;
            ?>
</td>
					<td>
						<br /><input size="40" class="inputbox" type="file" name="userfile0" />
					</td>
				</tr>
			<?php 
            if (!$doc_details->id) {
                ?>
			<?php 
                for ($i = 1; $i < 10; $i++) {
                    ?>
						<tr style="visibility:hidden; display:none;" id="tr1_<?php 
                    echo $i;
                    ?>
">
							<td valign="middle" style="vertical-align:middle"><br /><?php 
                    echo _JLMS_ENTER_NAME;
                    ?>
</td>
							<td><br /><input class="inputbox" size="40" type="text" name="doc_name<?php 
                    echo $i;
                    ?>
" value="<?php 
                    echo str_replace('"', '&quot;', $doc_details->doc_name);
                    ?>
" />
							</td>
						</tr>
						<tr style="visibility:hidden; display:none;" id="tr2_<?php 
                    echo $i;
                    ?>
">
							<td valign="middle" style="vertical-align:middle"><br /><?php 
                    echo _JLMS_CHOOSE_FILE;
                    ?>
</td>
							<td>
								<br /><input size="40" class="inputbox" type="file" name="userfile<?php 
                    echo $i;
                    ?>
" />
							</td>
						</tr>
				<?php 
                }
                ?>
				<tr id="jlms_newformbtn_row">
					<td width="30%" valign="middle" style="vertical-align:middle" colspan="2"><br />
					<input type="button" onclick="javascript:Add_new_form();" value="+" style="width: 70px;" name="add_new_g_cat" class="text_area"/>
					</td>
				</tr>
			<?php 
            }
            ?>
			<?php 
            if (!($doc_details->folder_flag == 1) && !$doc_details->id) {
                ?>
				<tr>
					<td valign="middle" style="vertical-align:middle"><br /><?php 
                echo _JLMS_OUTDOCS_UPLOAD_ZIP_FILES;
                ?>
:</td>
					<td><br /><?php 
                echo $lists['upload_zip'];
                ?>
</td>
				</tr>
				<tr><td colspan="2"><span class="small"><?php 
                echo _JLMS_OUTDOCS_UPLOAD_ZIP_FILES_NOTE;
                ?>
</span></td></tr>
			<?php 
            }
            ?>
				<tr>
					<td valign="middle" style="vertical-align:middle"><br /><?php 
            echo _JLMS_DOCS_UPLOAD_CONTENT_ZIP_PACK;
            ?>
:</td>
					<td><br /><?php 
            echo $lists['content_zip_pack'];
            ?>
</td>
				</tr>
			<?php 
        }
        ?>
				<tr>
					<td valign="middle" style="vertical-align:middle"><br /><?php 
        echo _JLMS_PLACE_IN;
        ?>
</td>
					<td><br /><?php 
        echo $lists['course_folders'];
        ?>
</td>
				</tr>
				<tr>
					<td valign="middle" style="vertical-align:middle"><br /><?php 
        echo _JLMS_PUBLISHING;
        ?>
</td>
					<td><br /><?php 
        echo $lists['publishing'];
        ?>
</td>
				</tr>
				<tr>
					<td valign="middle"><br /><?php 
        echo _JLMS_START_DATE;
        ?>
</td>
					<td valign="middle" style="vertical-align:middle "><br />
						<table class="jlms_date_outer" cellpadding="0" cellspacing="0" border="0"><tr><td valign="middle"><input type="checkbox" value="1" name="is_start" onclick="jlms_Change_start()" <?php 
        echo $doc_details->publish_start ? 'checked' : '';
        ?>
 /></td>
						<td valign="middle" style="vertical-align:middle ">
						<?php 
        $s_date = $is_dis_start ? date('Y-m-d') : $doc_details->start_date;
        echo JLMS_HTML::_('calendar.calendar', $s_date, 'start', 'start');
        ?>
						</td></tr></table>
					</td>
				</tr>	
				<tr>
					<td><br /><?php 
        echo _JLMS_END_DATE;
        ?>
</td>
					<td valign="middle" style="vertical-align:middle "><br />
						<table class="jlms_date_outer" cellpadding="0" cellspacing="0" border="0"><tr><td valign="middle"><input type="checkbox" value="1" name="is_end" onclick="jlms_Change_end()" <?php 
        echo $doc_details->publish_end ? 'checked' : '';
        ?>
 /></td>
						<td valign="middle" style="vertical-align:middle ">
						<?php 
        $e_date = $is_dis_end ? date('Y-m-d') : $doc_details->end_date;
        echo JLMS_HTML::_('calendar.calendar', $e_date, 'end', 'end');
        ?>
						</td></tr></table>
					</td>
				</tr>
				<tr>
					<td valign="top" style="vertical-align:top "><br /><?php 
        echo _JLMS_IS_TIME_RELATED;
        ?>
</td>
					<td><br />
						<?php 
        JLMS_HTML::_('showperiod.field', $doc_details->is_time_related, $doc_details->show_period);
        ?>
					</td>
				</tr>	
				<tr>
					<td colspan="2" valign="top" align="left" style="text-align:left "><br /><?php 
        echo _JLMS_DESCRIPTION;
        ?>
</td>
				</tr>	
				<tr>
					<td colspan="2">
					<?php 
        JLMS_editorArea('editor1', $doc_details->doc_description, 'doc_description', '100%', '250', '40', '20');
        ?>
					</td>
				</tr>
			</table>
			<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
			<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
			<input type="hidden" name="task" value="update_document" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="course_id" value="<?php 
        echo $id;
        ?>
" />
			<input type="hidden" name="folder_flag" value="<?php 
        echo $doc_details->folder_flag;
        ?>
" />
			<input type="hidden" name="id" value="<?php 
        echo $doc_details->id;
        ?>
" />
		</form>

<?php 
        $JLMS_ACL =& JLMSFactory::getACL();
        if ($JLMS_ACL->CheckPermissions('docs', 'set_permissions') && isset($doc_details->id) && $doc_details->id && isset($doc_details->folder_flag) && $doc_details->folder_flag == 1) {
            $db =& JFactory::getDbo();
            $query = "SELECT a.*, b.lms_usertype as role_name FROM #__lms_documents_perms as a LEFT JOIN #__lms_usertypes as b ON a.role_id = b.id WHERE a.doc_id = " . intval($doc_details->id);
            $db->SetQuery($query);
            $doc_perms = $db->LoadObjectList();
            $role_types = '(1,2,4,5)';
            $query = "SELECT id as value, lms_usertype as text, roletype_id, IF(roletype_id = 4, 1, IF(roletype_id = 2, 2, IF(roletype_id = 1, 4, 3))) as ordering FROM #__lms_usertypes WHERE roletype_id IN {$role_types} ORDER BY ordering, lms_usertype";
            $db->SetQuery($query);
            $roles = $db->LoadObjectList('value');
            $cur_role = 0;
            //$view_by ? $row->role_id : $row->lms_usertype_id;
            $sel_name = 'role_id';
            // : 'lms_usertype_id';
            $sel_html = '<select id="roles_selections" class="text_area" style="width:266px" name="' . $sel_name . '">';
            $sel_html .= '<option value="0"> - Select role - </option>';
            $prev_roletype = 0;
            foreach ($roles as $role) {
                if ($role->roletype_id != $prev_roletype) {
                    if ($prev_roletype) {
                        $sel_html .= '</optgroup>';
                    }
                    $prev_roletype = $role->roletype_id;
                    if ($role->roletype_id == 4) {
                        $sel_html .= '<optgroup label="Administrator roles">';
                    }
                    if ($role->roletype_id == 2) {
                        $sel_html .= '<optgroup label="Teacher roles">';
                    }
                    if ($role->roletype_id == 5) {
                        $sel_html .= '<optgroup label="Assistant roles">';
                    }
                    if ($role->roletype_id == 1) {
                        $sel_html .= '<optgroup label="Learner roles">';
                    }
                }
                $selected = '';
                if ($role->value == $cur_role) {
                    $selected = ' selected="selected"';
                }
                $sel_html .= '<option value="' . $role->value . '"' . $selected . '>' . $role->text . '</option>';
            }
            $sel_html .= '</optgroup>';
            $sel_html .= '</select>';
            $custom_perm_title = _JLMS_CUSTOM_PERMISSIONS;
            if ($JLMS_CONFIG->get('is_trial', false) && $JLMS_CONFIG->get('trial_custom_perm_heading_text', '')) {
                $custom_perm_title .= $JLMS_CONFIG->get('trial_custom_perm_heading_text', '');
            }
            ?>
			<a name="perms"></a><div class="contentheading"><?php 
            echo $custom_perm_title;
            ?>
</div>
<?php 
            if ($JLMS_CONFIG->get('is_trial', false) && $JLMS_CONFIG->get('trial_custom_perm_page_text', '')) {
                echo '<div class="joomlalms_sys_message">' . $JLMS_CONFIG->get('trial_custom_perm_page_text', '') . '</div>';
            }
            ?>
		<form action="<?php 
            echo sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid);
            ?>
" method="post" name="adminForm2" enctype="multipart/form-data">
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
 width="16" class="sectiontableheader">&nbsp;</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
					<<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
 class="sectiontableheader"><?php 
            echo _JLMS_CPERM_ROLE_NAME;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
					<<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
 class="sectiontableheader"><?php 
            echo _JLMS_CPERM_VIEW;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
					<<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
 class="sectiontableheader"><?php 
            echo _JLMS_CPERM_VIEW_ALL;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
					<<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
 class="sectiontableheader"><?php 
            echo _JLMS_CPERM_ORDER;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
					<<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
 class="sectiontableheader"><?php 
            echo _JLMS_CPERM_PUBLISH;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
					<<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
 class="sectiontableheader"><?php 
            echo _JLMS_CPERM_MANAGE;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
				</tr>
<?php 
            $k = 1;
            if (count($doc_perms)) {
                $yes_img = '<img height="16" width="16" border="0" alt="V" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_accept.png" class="JLMS_png"/>';
                $no_img = '<img height="16" width="16" border="0" alt="X" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_cancel.png" class="JLMS_png"/>';
                foreach ($doc_perms as $doc_perm) {
                    echo '<tr class="sectiontableentry' . $k . '">';
                    echo '<td>';
                    echo '<a href="javascript:submitbutton_aF2(\'del_perms\', ' . $doc_perm->role_id . ');"><img src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/btn_delete.png" class="JLMS_png" width="16" height="16" border="0" alt="btn_add" /></a>';
                    echo '</td>';
                    echo '<td align="left">' . $doc_perm->role_name . '</td>';
                    echo '<td align="center">' . ($doc_perm->p_view ? $yes_img : $no_img) . '</td>';
                    echo '<td align="center">' . ($doc_perm->p_viewall ? $yes_img : $no_img) . '</td>';
                    echo '<td align="center">' . ($doc_perm->p_order ? $yes_img : $no_img) . '</td>';
                    echo '<td align="center">' . ($doc_perm->p_publish ? $yes_img : $no_img) . '</td>';
                    echo '<td align="center">' . ($doc_perm->p_manage ? $yes_img : $no_img) . '</td>';
                    echo '</tr>';
                }
            }
            ?>
				<tr class="sectiontableentry<?php 
            echo $k;
            ?>
">
					<td><a href="javascript:submitbutton_aF2('add_perms', 0);"><img src="<?php 
            echo $JLMS_CONFIG->get('live_site');
            ?>
/components/com_joomla_lms/lms_images/toolbar/btn_add.png" class="JLMS_png" width="16" height="16" border="0" alt="btn_add" /></a></td>
					<td><?php 
            echo $sel_html;
            ?>
</td>
					<td align="center"><input class="inputbox" type="checkbox" name="p_view" value="1" /></td>
					<td align="center"><input class="inputbox" type="checkbox" name="p_viewall" value="1" /></td>
					<td align="center"><input class="inputbox" type="checkbox" name="p_order" value="1" /></td>
					<td align="center"><input class="inputbox" type="checkbox" name="p_publish" value="1" /></td>
					<td align="center"><input class="inputbox" type="checkbox" name="p_manage" value="1" /></td>
				</tr>

			</table>
			<input type="hidden" name="option" value="<?php 
            echo $option;
            ?>
" />
			<input type="hidden" name="Itemid" value="<?php 
            echo $Itemid;
            ?>
" />
			<input type="hidden" name="task" value="save_doc" />
			<input type="hidden" name="role_id2" value="0" />
			<input type="hidden" name="task2" value="add_perms" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="course_id" value="<?php 
            echo $id;
            ?>
" />
			<input type="hidden" name="folder_flag" value="<?php 
            echo $doc_details->folder_flag;
            ?>
" />
			<input type="hidden" name="id" value="<?php 
            echo $doc_details->id;
            ?>
" />
		</form>
<?php 
        }
        ?>

<?php 
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::CloseMT();
    }
Exemplo n.º 15
0
    function formStart($javascriptType = '', $html = 0, $images = null)
    {
        global $_VERSION;
        $joomAca15 = $_VERSION->RELEASE != '1.0' && class_exists('JFactory') ? true : false;
        if ($joomAca15) {
            $editor =& JFactory::getEditor();
        }
        mosCommonHTML::loadOverlib();
        echo '<script language="javascript" type="text/javascript">';
        switch ($javascriptType) {
            case 'edit_mailing':
                if (!$joomAca15) {
                    ?>
					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 == 'show') {
					submitform( pressbutton );
					return;
				}
				<?php 
                if (!$joomAca15) {
                    ?>
					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' );
				<?php 
                }
                ?>
				if (form.subject.value == ""){
					alert( "Mailing must have a title" );
				} else {
					<?php 
                if ($html != 0) {
                    if ($joomAca15) {
                        echo $editor->save('content');
                    } else {
                        getEditorContents('editor1', 'content');
                    }
                }
                ?>
					if(pressbutton){
						if (pressbutton == 'saveSend') {
							if (!confirm('Are you sure you want to proceed?')){return;}
							form.action = 'index2.php?option=com_acajoom&act=mailing';
						}
						form.task.value=pressbutton;
					}
					form.submit();
				}
			}
		<?php 
                break;
            case 'show_mailing':
                ?>
			function checkcid(myField) {
				myField.checked = true;
				isChecked(true);
			}
			function submitbutton(pressbutton) {
				var form = document.adminForm;
				if (pressbutton == 'cancel') {
					submitform( pressbutton );
					return;
				}
				if (pressbutton == 'sendNewsletter') {
					if (!confirm('Are you sure you want to proceed?')){return;}
					form.action = 'index2.php?option=com_acajoom&act=mailing';
				}
				submitform( pressbutton );
			}
			<?php 
                break;
            case 'configpanel':
                ?>
			function submitbutton(pressbutton) {
				var form = document.adminForm;
				if (pressbutton == 'cancel') {
					submitform( pressbutton );
					return;
				}
				if (pressbutton == 'sendQueue') {
					form.action = 'index2.php?option=com_acajoom&act=mailing';
				}
				submitform( pressbutton );
			}
			<?php 
                break;
            case 'editlist':
                ?>
				function submitbutton(pressbutton) {
					var form = document.adminForm;
					if (pressbutton == 'cancel') {
						submitform( pressbutton );
						return;
					}
				<?php 
                if ($GLOBALS[ACA . 'listHTMLeditor'] == '1') {
                    if ($joomAca15) {
                        echo $editor->save('list_desc');
                    } else {
                        getEditorContents('editor1', 'list_desc');
                    }
                }
                if ($html) {
                    if ($joomAca15) {
                        $editor->save('layout');
                        $editor->save('subscribemessage');
                        $editor->save('unsubscribemessage');
                    } else {
                        getEditorContents('editor2', 'layout');
                        getEditorContents('editor3', 'subscribemessage');
                        getEditorContents('editor4', 'unsubscribemessage');
                    }
                }
                ?>
					submitform( pressbutton );
				}
				<?php 
                break;
            default:
                ?>
			function submitbutton(pressbutton) {
				var form = document.adminForm;
				if (pressbutton == 'cancel') {
					submitform( pressbutton );
					return;
				}
				submitform( pressbutton );
			}
			<?php 
                break;
        }
        echo '</script>';
    }
Exemplo n.º 16
0
    /**
     * 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";
    }
Exemplo n.º 17
0
    /**
     * Writes the edit form for new and existing categories
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.  Note that the <var>section</var> property <b>must</b> be defined
     * even for a new record.
     * @param mosCategory The category object
     * @param string The html for the image list select list
     * @param string The html for the image position select list
     * @param string The html for the ordering list
     * @param string The html for the groups select list
     */
    function edit(&$row, $option, &$lists, &$menus)
    {
        global $mosConfig_live_site, $adminLanguage;
        if ($row->name != '') {
            $name = $row->name;
        } else {
            $name = $adminLanguage->A_COMP_SECT_NEW;
        }
        if ($row->image == "") {
            $row->image = 'blank.png';
        }
        ?>
		<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "<?php 
        echo $adminLanguage->A_COMP_SECT_SEL_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_SECT_MUST_NAME;
        ?>
");
			} else if (form.title.value ==""){
				alert("<?php 
        echo $adminLanguage->A_COMP_SECT_MUST_TITLE;
        ?>
");
			} else {
				<?php 
        getEditorContents('editor1', 'description');
        ?>
				submitform(pressbutton);
			}
		}
		</script>

		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th>
			<?php 
        echo $row->id ? $adminLanguage->A_COMP_EDIT : $adminLanguage->A_COMP_ADD;
        ?>
 <?php 
        echo $adminLanguage->A_COMP_SECTION;
        ?>
 <?php 
        echo " / " . $name;
        ?>
			</th>
		</tr>
		</table>

		<table width="100%">
		<tr>
			<td valign="top">
				<table class="adminform">
				<tr>
					<th colspan="3">
					<?php 
        echo $adminLanguage->A_COMP_SECT_DETAILS;
        ?>
					</th>
				<tr>
				<tr>
					<td width="150">
					<?php 
        echo $adminLanguage->A_COMP_SECT_SCOPE;
        ?>
:
					</td>
					<td width="85%" colspan="2">
					<strong>
					<?php 
        echo $row->scope;
        ?>
					</strong>
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo $adminLanguage->A_COMP_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 isset($row->section) ? $adminLanguage->A_COMP_CATEG : $adminLanguage->A_COMP_SECTION;
        ?>
 <?php 
        echo $adminLanguage->A_COMP_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_IMAGE;
        ?>
:
					</td>
					<td>
					<?php 
        echo $lists['image'];
        ?>
					</td>
					<td rowspan="4" width="50%">
					<?php 
        $path = $mosConfig_live_site . "/images/";
        if ($row->image != "blank.png") {
            $path .= "stories/";
        }
        ?>
					<img src="<?php 
        echo $path;
        echo $row->image;
        ?>
" name="imagelib" width="80" height="80" border="2" alt="<?php 
        echo $adminLanguage->A_COMP_PREVIEW;
        ?>
" />
					</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->id > 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">
							<?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_TYPE;
                    ?>
							</td>
							<td>
							<?php 
                    echo $menu->type;
                    ?>
  
							</td>
						</tr>
						<tr>
							<td width="90px" valign="top">
							<?php 
                    echo $adminLanguage->A_COMP_ITEM_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 
        }
        ?>
			</td>
		</tr>
		</table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="scope" value="<?php 
        echo $row->scope;
        ?>
" />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="oldtitle" value="<?php 
        echo $row->title;
        ?>
" />
		</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>&nbsp;
						
						</th>
					</tr>
					<tr>
						<td>
						Links de menus dispon&iacute;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 
    }
Exemplo n.º 19
0
    /**
     * Writes the edit form for new and existing module
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.
     * @param mosCategory The category object
     * @param array <p>The modules of the left side.  The array elements are in the form
     * <var>$leftorder[<i>order</i>] = <i>label</i></var>
     * where <i>order</i> is the module order from the db table and <i>label</i> is a
     * text label associciated with the order.</p>
     * @param array See notes for leftorder
     * @param array An array of select lists
     * @param object Parameters
     */
    function editModule(&$row, &$orders2, &$lists, &$params, $option)
    {
        global $mosConfig_live_site;
        $row->titleA = '';
        if ($row->id) {
            $row->titleA = '<small><small>[ ' . $row->title . ' ]</small></small>';
        }
        mosCommonHTML::loadOverlib();
        ?>
		<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton) {
			if ( pressbutton == 'save' ) {
				if ( document.adminForm.title.value == "" ) {
					alert("<?php 
        echo T_('Module must have a title');
        ?>
");
					return;
				} else if ( (document.adminForm.access.value == 2) && (document.adminForm.elements['groups[]'].selectedIndex < 0) ) {
						alert("<?php 
        echo T_('Special Access groups required for access level Special');
        ?>
");
						return;
				}
			} else {
				<?php 
        if ($row->module == "") {
            getEditorContents('editor1', 'content');
        }
        ?>
				submitform(pressbutton);
			}
			submitform(pressbutton);
		}
		<!--
		var originalOrder = '<?php 
        echo $row->ordering;
        ?>
';
		var originalPos = '<?php 
        echo $row->position;
        ?>
';
		var orders = new Array();	// array in the format [key,value,text]
		<?php 
        $i = 0;
        foreach ($orders2 as $k => $items) {
            foreach ($items as $v) {
                echo "\n\torders[" . $i++ . "] = new Array( \"{$k}\",\"{$v->value}\",\"{$v->text}\" );";
            }
        }
        ?>
		//-->
		</script>
		<table class="adminheading">
		<tr>
			<th class="modules">
			<?php 
        echo $lists['client_id'] ? T_('Administrator') : T_('Site');
        ?>
			<?php 
        echo T_('Module:');
        ?>
			<small>
			<?php 
        echo $row->id ? T_('Edit') : T_('New');
        ?>
			</small>
			<?php 
        echo $row->titleA;
        ?>
			</th>
		</tr>
		</table>

		<form action="index2.php" method="post" name="adminForm">

		<table cellspacing="0" cellpadding="0" width="100%">
		<tr valign="top">
			<td width="60%">
				<table class="adminform">
				<tr>
					<th colspan="2">
					<?php 
        echo T_('Details');
        ?>
					</th>
				</tr>
				<tr>
					<td width="100" align="left">
					<?php 
        echo T_('Title:');
        ?>
					</td>
					<td>
					<input class="text_area" type="text" name="title" size="35" value="<?php 
        echo $row->title;
        ?>
" />
					</td>
				</tr>
				<!-- START selectable pages -->
				<tr>
					<td width="100" align="left">
					<?php 
        echo T_('Show title:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['showtitle'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="left">
					<?php 
        echo T_('Position:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['position'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="left">
					<?php 
        echo T_('Module Order:');
        ?>
					</td>
					<td>
					<script language="javascript" type="text/javascript">
					<!--
					writeDynaList( 'class="inputbox" name="ordering" size="1"', orders, originalPos, originalPos, originalOrder );
					//-->
					</script>
					</td>
				</tr>
				<tr>
					<td valign="top" align="left">
					<?php 
        echo T_('Access Level:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['access'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="left">
					<?php 
        echo T_('Special Access:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['groups'] . "&nbsp;" . mosToolTip(T_('Special Access Groups'), T_('If Access Level is Special, only the selected groups will have access to the module'));
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top">
					<?php 
        echo T_('Published:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['published'];
        ?>
					</td>
				</tr>
				<tr>
					<td colspan="2">
					</td>
				</tr>
				<tr>
					<td valign="top">
					<?php 
        echo T_('ID:');
        ?>
					</td>
					<td>
					<?php 
        echo $row->id;
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top">
					<?php 
        echo T_('Description:');
        ?>
					</td>
					<td>
					<?php 
        echo $row->description;
        ?>
					</td>
				</tr>
				</table>

				<table class="adminform">
				<tr>
					<th >
					<?php 
        echo T_('Parameters');
        ?>
					</th>
				</tr>
				<tr>
					<td>
					<?php 
        echo $params->render();
        ?>
					</td>
				</tr>
				</table>
			</td>
			<td width="40%" >
				<table width="100%" class="adminform">
				<tr>
					<th>
					<?php 
        echo T_('Pages / Items');
        ?>
					</th>
				</tr>
				<tr>
					<td>
					<?php 
        echo T_('Menu Item Link(s):');
        ?>
					<br />
					<?php 
        echo $lists['selections'];
        ?>
					</td>
				</tr>
				</table>
			</td>
		</tr>
		<?php 
        if ($row->module == "") {
            ?>
			<tr>
				<td colspan="2">
						<table width="100%" class="adminform">
						<tr>
							<th colspan="2">
							<?php 
            echo T_('Custom Output');
            ?>
							</th>
						</tr>
						<tr>
							<td valign="top" align="left">
							<?php 
            echo T_('Content:');
            ?>
							</td>
							<td>
							<?php 
            // parameters : areaname, content, hidden field, width, height, rows, cols
            editorArea('editor1', $row->content, 'content', '700', '350', '95', '30');
            ?>
							</td>
						</tr>
						</table>
				</td>
			</tr>
			<?php 
        }
        ?>
		</table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="original" value="<?php 
        echo $row->ordering;
        ?>
" />
		<input type="hidden" name="module" value="<?php 
        echo $row->module;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="client_id" value="<?php 
        echo $lists['client_id'];
        ?>
" />
		<?php 
        if ($row->client_id || $lists['client_id']) {
            echo '<input type="hidden" name="client" value="admin" />';
        }
        ?>
		</form>
		<?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('&', '&amp;', $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('&', '&amp;', $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 
    }
Exemplo n.º 21
0
    /**
     * The function to handle all default page situations
     * not responsible for lists!
     */
    function FORMS_MENU_SAVE_CANCEL()
    {
        global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_lang, $VM_LANG, $product_id, $page, $limitstart, $mosConfig_editor, $vmIcons;
        $bar =& JToolBar::getInstance('toolbar');
        $product_id = vmGet($_REQUEST, 'product_id', 0);
        $no_menu = vmGet($_REQUEST, 'no_menu', 0);
        $is_iframe = vmGet($_REQUEST, 'is_iframe', 0);
        $product_parent_id = vmGet($_REQUEST, 'product_parent_id', 0);
        $script = '';
        $clone_product = vmRequest::getInt('clone_product', 0);
        if (is_array($product_id)) {
            $product_id = "";
        }
        // These editor arrays tell the toolbar to load correct "getEditorContents" script parts
        // This is necessary for WYSIWYG Editors like TinyMCE / mosCE / FCKEditor
        $editor1_array = array('product.product_form' => 'product_desc', 'shopper.shopper_group_form' => 'shopper_group_desc', 'product.product_category_form' => 'category_description', 'manufacturer.manufacturer_form' => 'mf_desc', 'store.store_form' => 'vendor_store_desc', 'product.product_type_parameter_form' => 'parameter_description', 'product.product_type_form' => 'product_type_description', 'vendor.vendor_form' => 'vendor_store_desc');
        $editor2_array = array('store.store_form' => 'vendor_terms_of_service', 'vendor.vendor_form' => 'vendor_terms_of_service');
        $editor1 = isset($editor1_array[$page]) ? $editor1_array[$page] : '';
        $editor2 = isset($editor2_array[$page]) ? $editor2_array[$page] : '';
        if ($no_menu) {
            vmCommonHTML::loadExtjs();
        }
        $script .= '<script type="text/javascript">
        	function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == \'cancel\') {
				submitform( pressbutton );
				return;
			}
			';
        if ($editor1 != '') {
            if (vmIsJoomla(1.5)) {
                jimport('joomla.html.editor');
                $editor_type = $GLOBALS['mainframe']->getCfg('editor');
                if ($editor_type != 'none') {
                    $editor = JEditor::getInstance();
                    $script .= $editor->getContent($editor1);
                }
            } else {
                ob_start();
                getEditorContents('editor1', $editor1);
                $script .= ob_get_contents();
                ob_end_clean();
            }
        }
        if ($editor2 != '') {
            if (vmIsJoomla(1.5)) {
                jimport('joomla.html.editor');
                $editor_type = $GLOBALS['mainframe']->getCfg('editor');
                if ($editor_type != 'none') {
                    $editor = JEditor::getInstance();
                    $script .= $editor->getContent($editor2);
                }
            } else {
                ob_start();
                getEditorContents('editor2', $editor2);
                $script .= ob_get_contents();
                ob_end_clean();
            }
        }
        if ($no_menu) {
            $admin = defined('_VM_IS_BACKEND') ? '/administrator' : '';
            $script .= "\n\t\t\t\n    // define some private variables\n    var dialog, showBtn;\n\n   // the second argument is true to indicate file upload.\n   YAHOO.util.Connect.setForm(form, true);\n   \n    var showDialog = function( content ) {\n    \tExt.MessageBox.show( { \n            \t\ttitle: '" . $VM_LANG->_('PEAR_LOG_NOTICE') . "',\n            \t\tmsg: content,\n            \t\tautoCreate: true,\n                    width:400,\n                    height:180,\n                    modal: false,\n                    resizable: false,\n                    buttons: Ext.MessageBox.OK,\n                    shadow:true,\n                    animEl:Ext.get( 'vm-toolbar' )\n            });\n        setTimeout('Ext.MessageBox.hide()', 3000);\n    };\n    \n    // return a public interface\n    var callback = {\n    \tsuccess: function(o) {\n    \t\t//Ext.DomHelper.insertHtml( document.body, o.responseText );\n    \t\tshowDialog( o.responseText );\n    \t},\n    \tfailure: function(o) {\n    \t\tExt.DomHelper.append( document.body, { tag: 'div', id: 'vmLogResult', html: 'Save action failed: ' + o.statusText } );\n    \t\tshowDialog( o.responseText );\n    \t},\n        upload : function(o){\n            //Ext.DomHelper.insertHtml( 'beforeEnd', document.body, o.responseText );\n    \t\tshowDialog( o.responseText );\n        }\n    };\n    \n   \tvar cObj = YAHOO.util.Connect.asyncRequest('POST', '{$_SERVER['PHP_SELF']}', callback);\n\t\n\t\t\t\n";
        } else {
            $script .= "\n\t\t\tsubmitform( pressbutton );\n";
        }
        $script .= "\t\t}\n\t\t</script>";
        $bar->appendButton('Custom', $script);
        vmMenuBar::startTable();
        if ($page == "product.product_form" && !empty($product_id) && $clone_product != 1) {
            if (empty($product_parent_id)) {
                // add new attribute
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_attribute_form&product_id=" . $product_id . "&limitstart=" . $limitstart . "&no_menu={$no_menu}";
                $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_ATTRIBUTE_FORM_MNU');
                vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt);
                vmMenuBar::spacer();
            } else {
                // back to parent product
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_id={$product_parent_id}&limitstart=" . $limitstart . "&no_menu={$no_menu}";
                $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_PRODUCT_FORM_RETURN_LBL');
                vmMenuBar::customHref($href, $vmIcons['back_icon'], $vmIcons['back_icon2'], $alt);
                vmMenuBar::spacer();
                // new child product
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_parent_id={$product_parent_id}&limitstart=" . $limitstart . "&no_menu={$no_menu}";
                $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ADD_ANOTHER_ITEM_MNU');
                vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt);
                vmMenuBar::spacer();
            }
            // Go to Price list
            $href = $_SERVER['PHP_SELF'] . "?page=product.product_price_list&product_id={$product_id}&product_parent_id={$product_parent_id}&limitstart={$limitstart}&return_args=&option=com_virtuemart&no_menu={$no_menu}";
            $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_PRICE_LIST_MNU');
            vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt);
            vmMenuBar::spacer();
            // add product type
            $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_product_type_form&product_id={$product_id}&product_parent_id={$product_parent_id}&limitstart={$limitstart}&no_menu={$no_menu}";
            $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_PRODUCT_PRODUCT_TYPE_FORM_MNU');
            vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt);
            vmMenuBar::spacer();
            /*** Adding an item is only pssible, if the product has attributes ***/
            if (ps_product::product_has_attributes($product_id)) {
                // Add Item
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_parent_id={$product_id}&limitstart={$limitstart}&no_menu={$no_menu}";
                $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_PRODUCT_FORM_NEW_ITEM_LBL');
                vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt);
                vmMenuBar::spacer();
            }
            vmMenuBar::divider();
        } elseif ($page == "admin.country_form") {
            if (!empty($_REQUEST['country_id'])) {
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=admin.country_state_form&country_id=" . intval($_REQUEST['country_id']) . "&limitstart={$limitstart}&no_menu={$no_menu}";
                $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_ADD_STATE');
                vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt);
                vmMenuBar::spacer();
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=admin.country_state_list&country_id=" . intval($_REQUEST['country_id']) . "&limitstart={$limitstart}&no_menu={$no_menu}";
                $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_LIST_STATES');
                vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt);
                vmMenuBar::spacer();
                vmMenuBar::divider();
            }
        }
        vmMenuBar::spacer();
        vmMenuBar::save('save', $VM_LANG->_('CMN_SAVE'));
        if ($no_menu == 0) {
            vmMenuBar::spacer();
            vmMenuBar::apply('apply', $VM_LANG->_('E_APPLY'));
        }
        if ((strstr(@$_SERVER['HTTP_REFERER'], $page) || strstr(@$_SERVER['HTTP_REFERER'], $_SERVER['PHP_SELF'])) && $no_menu && !$is_iframe) {
            // offer a back button
            vmMenuBar::spacer();
            vmMenuBar::back();
        }
        vmMenuBar::spacer();
        vmMenuBar::cancel();
        vmMenuBar::spacer();
        vmMenuBar::endTable();
    }
Exemplo n.º 22
0
    function edit(&$row, &$images, &$lists, $myid, &$params, $option, &$menus)
    {
        global $mosConfig_live_site, $adminLanguage;
        //mosMakeHtmlSafe( $row );
        $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="<?php 
        echo $mosConfig_live_site;
        ?>
/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" type="text/javascript">
		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;
			}

			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_SECT_SEL_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_TYPED_ARE_YOU;
        ?>
') ){
					submitform( pressbutton );
				} else {
					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( "<?php 
        echo $adminLanguage->A_COMP_TEMP;
        ?>
Content item must have a title" );
			} else if (trim(form.name.value) == ""){
				alert( "<?php 
        echo $adminLanguage->A_COMP_TEMP;
        ?>
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>
			<?php 
        echo $row->id ? $adminLanguage->A_COMP_EDIT : $adminLanguage->A_COMP_ADD;
        ?>
            <?php 
        echo $adminLanguage->A_COMP_TYPED_CONTENT;
        ?>
			</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">
					<?php 
        echo $adminLanguage->A_COMP_CONTENT_ITEM_DETAILS;
        ?>
					</th>
				<tr>
				<tr>
					<td align="left">
					<?php 
        echo $adminLanguage->A_COMP_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">
					<?php 
        echo $adminLanguage->A_COMP_CONTENT_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">
					<?php 
        echo $adminLanguage->A_COMP_TYPED_TEXT;
        ?>
<br />
					<?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor1', $row->introtext, 'introtext', 500, 400, '65', '50');
        ?>
					</td>
				</tr>
				</table>
			</td>
			<td width="40%" valign="top">
				<?php 
        $tabs->startPane("content-pane");
        $tabs->startTab($adminLanguage->A_COMP_CONT_PUB_TAB, "publish-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					<?php 
        echo $adminLanguage->A_COMP_CONT_PUBLISHING;
        ?>
					</th>
				<tr>
				<tr>
					<td valign="top" align="right">
					<?php 
        echo $adminLanguage->A_COMP_STATE;
        ?>
:
					</td>
					<td>
					<?php 
        echo $row->state > 0 ? $adminLanguage->A_COMP_PUBLISHED : $adminLanguage->A_COMP_CONTENT_DRAFT_UNPUB;
        ?>
					</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="inputbox" />
					</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_CONTENT_OVERRIDE;
        ?>
					</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 width="20%" align="right">
					<?php 
        echo $adminLanguage->A_COMP_CONTENT_START_PUB;
        ?>
:
					</td>
					<td width="80%">
					<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 width="20%" align="right">
					<?php 
        echo $adminLanguage->A_COMP_CONTENT_FINISH_PUB;
        ?>
:
					</td>
					<td width="80%">
					<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">
				<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_ADMIN_VERSION;
        ?>
</strong>
					</td>
					<td>
					<?php 
        echo "{$row->version}";
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong><?php 
        echo $adminLanguage->A_CREATED;
        ?>
</strong>
					</td>
					<td>
					<?php 
        echo $row->created ? $row->created . "</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_TEMP;
        ?>
Last Modified</strong>
					</td>
					<td>
					<?php 
        echo $row->modified ? $row->modified . "</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>
				<tr>
					<td valign="top" align="right">
					<strong><?php 
        echo $adminLanguage->A_COMP_TYPED_EXPIRES;
        ?>
</strong>
					</td>
					<td>
					<?php 
        echo "{$row->publish_down}";
        ?>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab($adminLanguage->A_COMP_CONT_IMG_TAB, "images-page");
        ?>
				<table class="adminform">
				<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'];
        ?>
					<br />
					<input class="button" type="button" value="<?php 
        echo $adminLanguage->A_COMP_ADD;
        ?>
" onClick="addSelectedToList('adminForm','imagefiles','imagelist')" />
					</td>
					<td valign="top">
					<img name="view_imagefiles" src="../images/M_images/blank.png" width="100" />
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo $adminLanguage->A_COMP_CONTENT_IMAGES;
        ?>
:
					<br />
					<?php 
        echo $lists['imagelist'];
        ?>
					<br />
					<input class="button" type="button" value="<?php 
        echo $adminLanguage->A_COMP_CONTENT_UP;
        ?>
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>
					<td valign="top">
					<img name="view_imagelist" src="../images/M_images/blank.png" width="100" />
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo $adminLanguage->A_COMP_CONTENT_EDIT_IMAGE;
        ?>
:
						<table>
						<tr>
							<td align="right">
							<?php 
        echo $adminLanguage->A_COMP_SOURCE;
        ?>
							</td>
							<td>
							<input 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 type="text" name="_alt" value="" />
							</td>
						</tr>
						<tr>
							<td align="right">
							<?php 
        echo $adminLanguage->A_COMP_CONTENT_BORDER;
        ?>
							</td>
							<td>
							<input 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 $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 $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 align="left">
					<?php 
        echo $adminLanguage->A_COMP_DESCRIPTION;
        ?>
:<br />
					<textarea class="inputbox" cols="40" rows="5" name="metadesc" style="width:300px"><?php 
        echo str_replace('&', '&amp;', $row->metadesc);
        ?>
</textarea>
					</td>
				</tr>
				<tr>
					<td align="left">
					<?php 
        echo $adminLanguage->A_COMP_CONTENT_KEYWORDS;
        ?>
:<br />
					<textarea class="inputbox" cols="40" rows="5" name="metakey" style="width:300px"><?php 
        echo str_replace('&', '&amp;', $row->metakey);
        ?>
</textarea>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        if ($row->id) {
            $tabs->startTab($adminLanguage->A_COMP_CONTENT_LINK_TO_MENU, "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_TYPED_WILL;
            ?>
					<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>

		<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="" />
		</form>
				<script language="Javascript" src="<?php 
        echo $mosConfig_live_site;
        ?>
/includes/js/overlib_mini.js"></script>
		<?php 
    }
Exemplo n.º 23
0
    /**
     * 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('&', '&amp;', $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('&', '&amp;', $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 
    }
Exemplo n.º 24
0
    /**
     * 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 
    }
Exemplo n.º 25
0
    /**
     * 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 . "&sectionid=" . $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;
        ?>
&nbsp;
			<?php 
        echo _E_CONTENT;
        ?>
 &nbsp;&nbsp;&nbsp;
			<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('&', '&amp;', $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('&', '&amp;', $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 
    }
Exemplo n.º 26
0
    function edit(&$row, &$images, &$lists, &$params, $option, &$menus)
    {
        global $mosConfig_live_site;
        //mosMakeHtmlSafe( $row );
        $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 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;
			}

			if ( pressbutton ==' resethits' ) {
				if (confirm('<?php 
        echo T_('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( "<?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;
				}
			}

			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( "<?php 
        echo T_('Content item must have a title');
        ?>
" );
			} else if (trim(form.name.value) == ""){
				alert( "<?php 
        echo T_('Content item must have a name');
        ?>
" );
			} else {
				if ( form.reset_hits.checked ) {
					form.hits.value = 0;
				} else {
				}
				<?php 
        getEditorContents('editor1', 'introtext');
        ?>
				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';
        }
        ?>
		<table class="adminheading">
		<tr>
			<th class="edit">
			<?php 
        echo T_('Static Content Item:');
        ?>
			<small>
			<?php 
        echo $row->id ? T_('Edit') : T_('New');
        ?>
			</small>
			</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>
		<form action="index2.php" method="post" name="adminForm">
		<input type ="hidden" name="simple_editing" value=''>
		
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">
				<table class="adminform">
				<tr>
					<th colspan="3">
					<?php 
        echo T_('Item Details');
        ?>
					</th>
				<tr>
				<tr>
					<td align="left">
					<?php 
        echo T_('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">
					<?php 
        echo T_('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">
					<?php 
        echo T_('Text: (required)');
        ?>
<br />
					<?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor1', $row->introtext, 'introtext', '100%;', '400', '65', '50');
        ?>
					</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_('State:');
        ?>
					</td>
					<td>
					<?php 
        echo $row->state > 0 ? 'Published' : 'Draft Unpublished';
        ?>
					</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_('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_('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="inputbox" />
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<?php 
        echo T_('Change Creator:');
        ?>
					</td>
					<td>
					<?php 
        echo $lists['created_by'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<?php 
        echo T_('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 width="20%" align="right">
					<?php 
        echo T_('Start Publishing:');
        ?>
					</td>
					<td width="80%">
					<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 width="20%" align="right">
					<?php 
        echo T_('Finish Publishing:');
        ?>
					</td>
					<td width="80%">
					<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">
				<?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_('Version');
        ?>
</strong>
					</td>
					<td>
					<?php 
        echo "{$row->version}";
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong><?php 
        echo T_('Created');
        ?>
</strong>
					</td>
					<td>
					<?php 
        echo $row->created ? "{$row->created}</td></tr><tr><td valign='top' align='right'><strong>" . T_('By') . "</strong></td><td>{$row->creator}" : T_("New document");
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong><?php 
        echo T_('Last Modified');
        ?>
</strong>
					</td>
					<td>
					<?php 
        echo $row->modified ? "{$row->modified}</td></tr><tr><td valign='top' align='right'><strong>" . T_('By') . "</strong></td><td>{$row->modifier}" : T_("Not modified");
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" align="right">
					<strong><?php 
        echo T_('Expires');
        ?>
</strong>
					</td>
					<td>
					<?php 
        echo "{$row->publish_down}";
        ?>
					</td>
				</tr>
				</table>
				<?php 
        $tabs->endTab();
        $tabs->startTab(T_("Images"), "images-page");
        ?>
				<table class="adminform">
				<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'];
        ?>
					<br />
					<input class="button" type="button" value="<?php 
        echo T_('Add');
        ?>
" onClick="addSelectedToList('adminForm','imagefiles','imagelist')" />
					</td>
					<td valign="top">
					<img name="view_imagefiles" src="../images/M_images/blank.png" width="100" />
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo T_('Content Images:');
        ?>
					<br />
					<?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">
					<img name="view_imagelist" src="../images/M_images/blank.png" width="100" />
					</td>
				</tr>
				<tr>
					<td>
					<?php 
        echo T_('Edit the image selected:');
        ?>
						<table>
						<tr>
							<td align="right">
							<?php 
        echo T_('Source');
        ?>
							</td>
							<td>
							<input type="text" name= "_source" value="" />
							</td>
						</tr>
						<tr>
							<td align="right">
							<?php 
        echo T_('Align');
        ?>
							</td>
							<td>
							<?php 
        echo $lists['_align'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							<?php 
        echo T_('Alt Text');
        ?>
							</td>
							<td>
							<input type="text" name="_alt" value="" />
							</td>
						</tr>
						<tr>
							<td align="right">
							<?php 
        echo T_('Border');
        ?>
							</td>
							<td>
							<input 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 $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 align="left">
					<?php 
        echo T_('Description:');
        ?>
<br />
					<textarea class="inputbox" cols="40" rows="5" name="metadesc" style="width:300px"><?php 
        echo str_replace('&', '&amp;', $row->metadesc);
        ?>
</textarea>
					</td>
				</tr>
				<tr>
					<td align="left">
					<?php 
        echo T_('Keywords:');
        ?>
<br />
					<textarea class="inputbox" cols="40" rows="5" name="metakey" style="width:300px"><?php 
        echo str_replace('&', '&amp;', $row->metakey);
        ?>
</textarea>
					</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 - Static Content" 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>
			
		</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="" />
		</form>
		<?php 
    }
Exemplo n.º 27
0
/**
 * Used by the frontend adminsitration to save editor field contents
 *
 * @param string $editor1 the name of the editor field no. 1
 * @param string $editor2 the name of the editor field no. 2
 */
function editorScript($editor1 = '', $editor2 = '')
{
    ?>
	 <script type="text/javascript">
	 function submitbutton(pressbutton) {
	 	var form = document.adminForm;
	 	if (pressbutton == 'cancel') {
	 		submitform( pressbutton );
	 		return;
	 	}
	 	<?php 
    if ($editor1 != '') {
        if (vmIsJoomla(1.5)) {
            jimport('joomla.html.editor');
            $editor = JEditor::getInstance($GLOBALS['mainframe']->getCfg('editor'));
            echo $editor->getContent('editor1');
        } else {
            getEditorContents('editor1', $editor1);
        }
    }
    if ($editor2 != '') {
        if (vmIsJoomla(1.5)) {
            jimport('joomla.html.editor');
            $editor = JEditor::getInstance($GLOBALS['mainframe']->getCfg('editor'));
            echo $editor->getContent('editor2');
        } else {
            getEditorContents('editor2', $editor2);
        }
    }
    ?>
	 	submitform( pressbutton );

	 }
	 </script><?php 
}
Exemplo n.º 28
0
    /**
     * 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('&', '&amp;', $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('&', '&amp;', $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 
    }
    /**
     * 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('&', '&amp;', $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('&', '&amp;', $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 
    }
Exemplo n.º 30
0
    function upload($lists)
    {
        global $my, $mainframe, $database, $option, $priTask, $subTask;
        global $WBG_CONFIG, $wbGalleryDB_cat;
        ?>

    <script language="javascript" type="text/javascript">
      function submitbutton(pressbutton, section) {
        var form = document.adminForm;
        if(pressbutton == 'image.cancel') {
          submitform( pressbutton );
          return;
        }
        <?php 
        getEditorContents('editor1', 'description');
        ?>

        submitform(pressbutton);
      }
    </script>
    <form action="index2.php" method="post" name="adminForm" enctype="multipart/form-data">
      <table class="adminheading">
        <tr><th class="install" valign="top">
          <font size="+1">wbGallery</font><br/>
          Upload Collection Image(s)<br/>
          Max Upload( <?php 
        echo ini_get('upload_max_filesize');
        ?>
 )
          Max Exec( <?php 
        echo ini_get('max_execution_time');
        ?>
s )
          Max Post( <?php 
        echo ini_get('post_max_size');
        ?>
 )
        </th></tr>
      </table>
      <table class="adminlist" width="100%">
        <tr>
          <th class="title" colspan="2">Select Upload Source</th>
        </tr>
        <tr>
          <td width="200">Single Image ( JPG, GIF, PNG ): </td>
          <td><input type="file" name="img" class="text_area" size="30" value="" /></td>
        </tr>
        <tr>
          <td>Compressed File ( ZIP, TAR.GZ ): </td>
          <td><input type="file" name="zip" class="text_area" size="30" value="" /></td>
        </tr>
        <tr>
          <td>Local Folder of Images: </td>
          <td><input type="name" name="folder" class="text_area" size="45" value="" /></td>
        </tr>
        <tr>
          <th class="title" colspan="2">Specify the Upload Default Details</th>
        </tr>
        <tr>
          <td>Default Category: </td>
          <td><?php 
        echo $lists['cat_id'];
        ?>
</td>
        </tr>
        <tr>
          <td>Name:</td>
          <td><input type="text" name="name" class="text_area" size="30" value="" /></td>
        </tr>
        <tr>
          <td>Sku:</td>
          <td><input type="text" name="sku" class="text_area" size="30" value="" /></td>
        </tr>
        <tr>
          <td>Photographer:</td>
          <td><input type="text" name="photographer" class="text_area" size="30" value="" /></td>
        </tr>
        <tr>
          <td>Price:</td>
          <td><input type="text" name="price" class="text_area" size="30" value="" /></td>
        </tr>
        <tr>
          <td>Published: </td>
          <td><?php 
        echo mosHTML::yesnoRadioList('published', '', 1);
        ?>
</td>
        </tr>
        <tr valign="top">
          <td>Description: </td>
          <td align="left"><?php 
        // parameters : areaname, content, hidden field, width, height, rows, cols
        editorArea('editor1', '', 'description', '300px;', '200px;', '60', '20');
        ?>
</td>
        </tr>
      </table>
      <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="hidemainmenu" value="0" />
    </form>
    <?php 
    }