/**
     * 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 
    }
Ejemplo n.º 2
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 
    }
    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 
    }
Ejemplo n.º 4
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 
    }
    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('Tem certeza que deseja reiniciar o contador de Acessos ? \nQualquer alteração não salva deste conteúdo será perdida.')){
					submitform( pressbutton );
					return;
				} else {
					return;
				}
			}

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "Por favor, selecione um menu" );
					return;
				} else if ( form.link_name.value == "" ) {
					alert( "Por favor, informe um nome para este item do menu" );
					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( "Item de conteúdo deve possuir um título" );
			} else if (trim(form.name.value) == ""){
				alert( "Item de conteúdo deve possuir um nome" );
			} 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">
			Item de Conteúdo Estático:
			<small>
			<?php 
        echo $row->id ? 'Editar' : 'Novo';
        ?>
			</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">
					Detalhes do Item
					</th>
				</tr>
				<tr>
					<td align="left">
					Título:
					</td>
					<td>
					<input class="inputbox" type="text" name="title" size="30" maxlength="100" value="<?php 
        echo $row->title;
        ?>
" />
					</td>
				</tr>
				<tr>
					<td align="left">
					Sub-título:
					</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">
					Texto: (necessário)<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("Publicar", "publish-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Info da Publicação
					</th>
				</tr>
				<tr>
					<td valign="top" align="right" width="120">
					State:
					</td>
					<td>
					<?php 
        echo $row->state > 0 ? 'Publicado' : 'Rascunho Não Publicado';
        ?>
					</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="inputbox" />
					</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">
					Alterar Data de Criação
					</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">
					Início da Publicação:
					</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">
					Fim da Publicação:
					</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>ID 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>
					<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>
				<tr>
					<td valign="top" align="right">
					<strong>Expira</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">
						Controle de 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-folder: <?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" width="100" />
						</div>
					</td>
					<td valign="top">
						<div align="center">
							Imagem Ativa:<br/>
							<img name="view_imagelist" src="../images/M_images/blank.png" width="100" />
						</div>
					</td>
				</tr>
				<tr>
					<td>
					<b>Editar a imagem selecionada:</b>
						<table>
						<tr>
							<td align="right">
							Fonte:
							</td>
							<td>
							<input 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 type="text" name="_alt" value="" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Borda:
							</td>
							<td>
							<input type="text" name="_border" value="" size="3" maxlength="1" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Legenda:
							</td>
							<td>
							<input class="text_area" type="text" name="_caption" value="" size="30" />
							</td>
						</tr>
						<tr>
							<td align="right">
							Legenda - Posição:
							</td>
							<td>
							<?php 
        echo $lists['_caption_position'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Legenda - Alinhamento:
							</td>
							<td>
							<?php 
        echo $lists['_caption_align'];
        ?>
							</td>
						</tr>
						<tr>
							<td align="right">
							Legenda - Largura:
							</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>
					<?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 align="left">
					Descrição:<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">
					Palavras Chaves:<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 para Menu", "link-page");
        ?>
				<table class="adminform">
				<tr>
					<th colspan="2">
					Link para 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="90px">
					Selecione um Menu
					</td>
					<td>
					<?php 
        echo $lists['menuselect'];
        ?>
					</td>
				</tr>
				<tr>
					<td valign="top" width="90px">
					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 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="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 
    }