コード例 #1
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 = '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 
    }
コード例 #2
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 = "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 
    }
コード例 #3
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 
    }
コード例 #4
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 
    }
コード例 #5
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 
    }