openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 70975bd0928bf745082bf2fc0c26ac79dddb1887
parent 7ece80c2972bc7076a43163ea6b1da963cc12705
Author: dankert <devnull@localhost>
Date:   Sun, 28 Nov 2004 17:57:30 +0100

Beruecksichtigen von Berechtigungen

Diffstat:
themes/default/pages/html/folder/new.tpl.php | 45++++++++++++++++++++++++++++++++-------------
themes/default/pages/html/folder/show.tpl.php | 14+++++++++-----
2 files changed, 41 insertions(+), 18 deletions(-)

diff --git a/themes/default/pages/html/folder/new.tpl.php b/themes/default/pages/html/folder/new.tpl.php @@ -4,8 +4,8 @@ <center> <form enctype="multipart/form-data" action="<?php echo $self ?>" method="post" target="_self"> -<input type="hidden" name="subaction" value="createnew"> -<input type="hidden" name="<?php echo session_name() ?>" value="<?php echo session_id() ?>"> +<input type="hidden" name="subaction" value="createnew" /> +<input type="hidden" name="<?php echo session_name() ?>" value="<?php echo session_id() ?>" /> <table class="main" width="90%" cellspacing="0" cellpadding="4"> @@ -13,51 +13,66 @@ <th colspan="4"><?php echo lang('NEW') ?></th> </tr> - <?php if (count($templates)>0) // Nur, wenn Vorlagen vorhanden + <?php $nr = 0 ?> + <?php $tab = 0 ?> + + <?php if ($new_page) { ?> + <?php if (count($templates)>0) // Nur, wenn Vorlagen vorhanden + { ?> <tr> <td class="f1"> <input type="radio" name="type" value="page" onClick="document.forms[0].pagename.focus();"><?php echo lang('PAGE') ?> </td> <td class="f1"> <?php echo Html::selectBox('templateid',$templates) ?> - <input type="text" name="pagename" size="20" value="" onFocus="document.forms[0].type[0].checked=true;" tabindex="1"> + <input type="text" name="pagename" size="20" value="" onFocus="document.forms[0].type[<?php echo $nr++ ?>].checked=true;" tabindex="<?php echo $tab++ ?>"> </td> </tr> - <?php } - else - { ?> + <?php } + else + { ?> <tr> <td class="help" colspan="2"><?php echo lang('GLOBAL_NO_TEMPLATES_AVAILABLE_DESC') ?></td> </tr> + <?php } ?> <?php } ?> + <?php if ($new_file) + { ?> <tr> <td class="f1"> <input type="radio" name="type" value="file" onClick="document.forms[0].file.focus();"><?php echo lang('FILE') ?> </td> <td class="f1"> - <input type="file" name="file" onFocus="document.forms[0].type[1].checked=true;" tabindex="2"> + <input type="file" name="file" onFocus="document.forms[0].type[<?php echo $nr++ ?>].checked=true;" tabindex="<?php echo $tab++ ?>"> </td> </tr> + <?php } ?> + <?php if ($new_folder) + { ?> <tr> <td class="f1"> <input type="radio" name="type" value="folder" onClick="document.forms[0].foldername.focus();"><?php echo lang('FOLDER') ?> </td> <td class="f1"> - <input type="text" name="foldername" size="20" value="" onFocus="document.forms[0].type[2].checked=true;" tabindex="3"> + <input type="text" name="foldername" size="20" value="" onFocus="document.forms[0].type[<?php echo $nr++ ?>].checked=true;" tabindex="<?php echo $tab++ ?>"> </td> </tr> + <?php } ?> + <?php if ($new_link) + { ?> <tr> <td class="f1"> <input type="radio" name="type" value="link" onClick="document.forms[0].linkname.focus();"><?php echo lang('link') ?> </td> <td class="f1"> - <input type="text" name="linkname" size="20" value="" onFocus="document.forms[0].type[3].checked=true;" tabindex="4"> + <input type="text" name="linkname" size="20" value="" onFocus="document.forms[0].type[<?php echo $nr++ ?>].checked=true;" tabindex="<?php echo $tab++ ?>"> </td> </tr> + <?php } ?> <tr> <td colspan="5" class="act"> @@ -71,7 +86,11 @@ </form> </center> -<script name="JavaScript" type="text/javascript"><!-- -document.forms[0].pagename.focus(); -//--></script> +<?php + if ($new_page) Html::focusField('pagename' ); + elseif ($new_folder) Html::focusField('foldername'); + elseif ($new_file) Html::focusField('filename' ); + elseif ($new_link) Html::focusField('linkname' ); +?> + <?php include( $tpl_dir.'footer.tpl.php') ?> \ No newline at end of file diff --git a/themes/default/pages/html/folder/show.tpl.php b/themes/default/pages/html/folder/show.tpl.php @@ -10,6 +10,8 @@ <?php $table_title_text = lang('FOLDER'); $table_title_colspan = 7; include( $tpl_dir.'table_open.tpl.php'); + + $writable = isset($folder); ?> <tr> <td colspan="7" class="help"><?php echo lang('HELP_FOLDER') ?></td> @@ -20,18 +22,18 @@ { ?> <tr> <td width="50%" colspan="8" class="<?php if($f1==true) {echo'f1'; } else{echo'f2'; }?>"><a href="<?php echo $up_url ?>" target="cms_main"><img src="<?php echo $image_dir.'icon_folder.png' ?>" align="left" border="0"><strong>..</strong></a></td> -<!--<td width="50%" colspan="3" class="<?php if($f1==true) {echo'f1';$f1=false;} else{echo'f2';$f1=true;}?>">&nbsp;</td>--> </tr> <?php } if ( count( $object) > 0 ) { + $sortable = (count($object)>1 && $writable); ?> <tr> <td width="5%" class="help" >&nbsp;</td> -<td width="60%" class="help" ><a href="<?php echo $orderbytype_url ?>" title="<?php echo lang('FOLDER_ORDERBYTYPE' ) ?>"><?php echo lang('GLOBAL_TYPE') ?></a> / <a href="<?php echo $orderbyname_url ?>" title="<?php echo lang('FOLDER_ORDERBYNAME') ?>"><?php echo lang('GLOBAL_NAME') ?></a></td> -<td width="20%" class="help" ><a href="<?php echo $orderbylastchange_url ?>" title="<?php echo lang('FOLDER_ORDERBYLASTCHANGE') ?>"><?php echo lang('LASTCHANGE' ) ?></td> -<td width="30%" class="help" colspan="4"><?php if (count( $object)>1) ?><a href="<?php echo $flip_url ?>" title="<?php echo lang('FOLDER_FLIP') ?>"><?php echo lang('FOLDER_ORDER') ?></a></td> +<td width="60%" class="help" ><?php if ($sortable) { ?><a href="<?php echo $orderbytype_url ?>" title="<?php echo lang('FOLDER_ORDERBYTYPE' ) ?>"><?php } ?><?php echo lang('GLOBAL_TYPE') ?><?php if ($sortable) { ?></a><?php } ?> / <?php if ($sortable) { ?><a href="<?php echo $orderbyname_url ?>" title="<?php echo lang('FOLDER_ORDERBYNAME') ?>"><?php } ?><?php echo lang('GLOBAL_NAME') ?><?php if ($sortable) { ?></a><?php } ?></td> +<td width="20%" class="help" ><?php if ($sortable) { ?><a href="<?php echo $orderbylastchange_url ?>" title="<?php echo lang('FOLDER_ORDERBYLASTCHANGE') ?>"><?php } ?><?php echo lang('LASTCHANGE' ) ?><?php if ($sortable) { ?></a><?php } ?></td> +<td width="30%" class="help" colspan="4"><?php if ($sortable) { ?><a href="<?php echo $flip_url ?>" title="<?php echo lang('FOLDER_FLIP') ?>"><?php } ?><?php echo lang('FOLDER_ORDER') ?><?php if ($sortable) { ?></a><?php } ?></td> </tr> <?php $f1=true; @@ -40,7 +42,7 @@ $fx = fx($f1); ?> <tr> -<td width="5%" class="<?php echo $fx; ?>"><input type="checkbox" name="obj<?php echo $id ?>" value="1" /></td> +<td width="5%" class="<?php echo $fx; ?>"><?php if($writable) { ?><input type="checkbox" name="obj<?php echo $id ?>" value="1" /><?php } ?></td> <td width="40%" class="<?php echo $fx; ?>"><a href="<?php echo $z['url'] ?>" target="cms_main" title="<?php echo $z['desc'] ?>"><img src="<?php echo $image_dir.'icon_'.$z['icon'].'.png' ?>" align="left" border="0"><?php echo $z['name'] ?></a>&nbsp;</td> <td width="18%" class="<?php echo $fx; ?>"><span title="<?php echo lang('USER').': '.$z['user'] ?>"><?php echo $z['date'] ?></span></td> <td width="3%" class="<?php echo $fx; ?>"><?php if (isset($z['upurl' ])) { ?><a href="<?php echo $z['upurl' ] ?>"><img src="<?php echo $image_dir ?>up.gif" title="<?php echo lang('UP' ) ?>" border="0"></a><?php } else echo '&nbsp;' ?></td> @@ -50,6 +52,7 @@ </tr> <?php } ?> +<?php if($writable) { ?> <tr> <td colspan="7" class="<?php echo $fx; ?>"> <img src="<?php echo $image_dir ?>tree_none_end.gif" align="left" />&nbsp; @@ -83,6 +86,7 @@ <input type="submit" class="submit" value="<?php echo lang('GLOBAL_SAVE') ?>" /> </td> </tr> +<?php } ?> <?php } else { ?>