[Linpha-cvs] SF.net SVN: linpha: [4892] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2008-02-22 09:26:25
|
Revision: 4892 http://linpha.svn.sourceforge.net/linpha/?rev=4892&view=rev Author: fangehrn Date: 2008-02-22 01:26:16 -0800 (Fri, 22 Feb 2008) Log Message: ----------- 2008-02-22 flo * implemented jscookmenu * changed templates with new rounded corners (not yet finished, found another problem when the page is too long) * temporary fix for "lindivtab undefined" 2008-02-20 flo * moved func.watermark.php to classes/linpha.color.class.php they are used at several other places * fixed some php stricts notices * implemented new rounded corners * changed to html strict * fixed some html strict javascript bugs Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/index.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/lib/include/sql/sql.data.php trunk/linpha2/lib/js/LinGlobal.js trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/plugins/maps/LinMaps.js trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/default.html.php trunk/linpha2/templates/default/fragments.php trunk/linpha2/templates/default/global.html.php trunk/linpha2/templates/default/home.html.php trunk/linpha2/templates/default/maps.html.php trunk/linpha2/templates/default/menu.html.php trunk/linpha2/templates/default/search.html.php trunk/linpha2/templates/default/themes/default/colorsettings.php trunk/linpha2/templates/default/themes/default/css/global.css trunk/linpha2/templates/default/themes/default/css/home.css trunk/linpha2/templates/default/view_albmeta.html.php trunk/linpha2/templates/default/view_basket.html.php trunk/linpha2/templates/default/view_img.html.php trunk/linpha2/templates/default/view_img_static.html.php trunk/linpha2/templates/default/view_thumb.html.php trunk/linpha2/templates/default/view_thumb_static.html.php trunk/linpha2/templates/misc/box.php Added Paths: ----------- trunk/linpha2/lib/js/JSCookMenu/ trunk/linpha2/lib/js/JSCookMenu/JSCookMenu.js trunk/linpha2/lib/js/JSCookMenu/JSCookMenu.yui.js trunk/linpha2/lib/js/JSCookMenu/effect.js trunk/linpha2/templates/default/menu.head.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2008-02-21 20:36:08 UTC (rev 4891) +++ trunk/linpha2/ChangeLog 2008-02-22 09:26:16 UTC (rev 4892) @@ -1,7 +1,17 @@ +2008-02-22 flo + * implemented jscookmenu + * changed templates with new rounded corners + (not yet finished, found another problem when the page is too long) + * temporary fix for "lindivtab undefined" + 2008-02-20 flo * moved func.watermark.php to classes/linpha.color.class.php they are used at several other places + * fixed some php stricts notices + * implemented new rounded corners + * changed to html strict + * fixed some html strict javascript bugs 2008-02-17 flo * implemented adodb datadict Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2008-02-21 20:36:08 UTC (rev 4891) +++ trunk/linpha2/index.php 2008-02-22 09:26:16 UTC (rev 4892) @@ -31,6 +31,7 @@ */ switch($_GET['linCat']) { +case 'home': case 'alb': require_once(LINPHA_DIR.'/lib/modules/module.albums.php'); break; Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2008-02-21 20:36:08 UTC (rev 4891) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2008-02-22 09:26:16 UTC (rev 4892) @@ -274,50 +274,39 @@ */ function setMenu() { - /** - * Menu My Settings - */ - if($GLOBALS['linpha']->sql->isLoggedIn()) - { - if( isset($GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable']) - && $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable'] == 1 ) - { - $GLOBALS['linpha']->template->output['menu_My Settings']['filemanager'] = - array('name' => i18n("Filemanager"), 'value' => LINPHA_LINK.'&linCat=filemanager'); - } - } + /** * Menu Admin */ if($GLOBALS['linpha']->sql->isAdmin()) { - $GLOBALS['linpha']->template->output['menu_Admin']['import'] = + $GLOBALS['linpha']->template->menu['admin']['import'] = array( 'name' => i18n("Import"), - 'value' => array( - array('name' => i18n("Start Import Of This Folder/File"), 'value' => LINPHA_CLIENT.'/admin/?cat=maintenance_import&album_select[]='.$this->id_parent), - array('name' => i18n("Detect File Changes"), 'value' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=force_import') + 'link' => array( + array('name' => i18n("Start Import Of This Folder/File"), 'link' => LINPHA_CLIENT.'/admin/?cat=maintenance_import&album_select[]='.$this->id_parent), + array('name' => i18n("Detect File Changes"), 'link' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=force_import') ) ); - $GLOBALS['linpha']->template->output['menu_Admin']['permissions'] = + $GLOBALS['linpha']->template->menu['admin']['permissions'] = array( 'name' => i18n("Permissions"), - 'value' => array( - array('name' => i18n("Set Permissions"), 'value' => LINPHA_CLIENT.'/admin/?cat=permissions_view&cmd=edit&linId='.$GLOBALS['linpha']->template->idCurrent) + 'link' => array( + array('name' => i18n("Set Permissions"), 'link' => LINPHA_CLIENT.'/admin/?cat=permissions_view&cmd=edit&linId='.$GLOBALS['linpha']->template->idCurrent) ) ); - if($this->mode == 'thumb' OR $this->mode == 'image') + if($this->mode == 'thumb' || $this->mode == 'image') { /** * append to "admin - import" entry */ - $GLOBALS['linpha']->template->output['menu_Admin']['import']['value'][] = array( + $GLOBALS['linpha']->template->menu['admin']['import']['value'][] = array( 'name' => i18n("Recreate This Thumbnail"), - 'value' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=recreate' + 'link' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=recreate' ); } } @@ -331,9 +320,9 @@ * more than one time used stuff */ $array = linGetSortOrders(); - foreach($array AS $value) // i18n() already called + foreach($array as $value) // i18n() already called { - $array_sort_orders_links[] = array('name' => $value, 'value' => $GLOBALS['linpha']->template->URL_full.'&order_by='.$value); + $array_sort_orders_links[] = array('name' => $value, 'link' => $GLOBALS['linpha']->template->URL_full.'&order_by='.$value); } $open_basket_link = LINPHA_LINK.'&linCat=basket'; @@ -342,99 +331,99 @@ { case 'thumb': - $GLOBALS['linpha']->template->output['menu_More']['basket'] = + $GLOBALS['linpha']->template->menu['more']['basket'] = array( 'name' => i18n("Basket"), - 'value' => array( - array('name' => i18n("Add All To Basket"), 'value' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all'), - array('name' => i18n("Switch To Basket View"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=basket'), - array('name' => i18n("Open Basket").' ('.count($_SESSION['basket_ids']).' '.i18n("Images").')', 'value' => $open_basket_link) + 'link' => array( + array('name' => i18n("Add All To Basket"), 'link' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all'), + array('name' => i18n("Switch To Basket View"), 'link' => $GLOBALS['linpha']->template->URL_full.'&view=basket'), + array('name' => i18n("Open Basket").' ('.count($_SESSION['basket_ids']).' '.i18n("Images").')', 'link' => $open_basket_link) ) ); if( linUseAjax() ) { $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectsizes']); - foreach($array AS $value) + foreach($array as $value) { - $array_tn_sizes_links[] = array('name' => $value.' '.i18n("Pixel"), 'value' => 'javascript:myLinThumbnails.setTnSize('.$value.')'); + $array_tn_sizes_links[] = array('name' => $value.' '.i18n("Pixel"), 'link' => 'javascript:myLinThumbnails.setTnSize('.$value.')'); } $array = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_thumb_selectnrimages']); - foreach($array AS $value) + foreach($array as $value) { - $array_nr_links[] = array('name' => $value, 'value' =>"javascript:myLinThumbnails.setNrImages('".$value."')"); + $array_nr_links[] = array('name' => $value, 'link' =>"javascript:myLinThumbnails.setNrImages('".$value."')"); } - $array_views_links[] = array('name' => i18n("Normal"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumb'); - $array_views_links[] = array('name' => i18n("Detail"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=thumbdetail'); + $array_views_links[] = array('name' => i18n("Normal"), 'link' => $GLOBALS['linpha']->template->URL_full.'&view=thumb'); + $array_views_links[] = array('name' => i18n("Detail"), 'link' => $GLOBALS['linpha']->template->URL_full.'&view=thumbdetail'); - $GLOBALS['linpha']->template->output['menu_More']['view'] = + $GLOBALS['linpha']->template->menu['more']['view'] = array( 'name' => i18n("View"), - 'value' => array( - array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), - array('name' => i18n("View"), 'value' => $array_views_links), - array('name' => i18n("Thumb Size"), 'value' => $array_tn_sizes_links), - array('name' => i18n("Thumb Nr"), 'value' => $array_nr_links) + 'link' => array( + array('name' => i18n("Sort"), 'link' => $array_sort_orders_links), + array('name' => i18n("View"), 'link' => $array_views_links), + array('name' => i18n("Thumb Size"), 'link' => $array_tn_sizes_links), + array('name' => i18n("Thumb Nr"), 'link' => $array_nr_links) ) ); } else { - $GLOBALS['linpha']->template->output['menu_More']['view'] = + $GLOBALS['linpha']->template->menu['more']['view'] = array( 'name' => i18n("View"), - 'value' => array( - array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), + 'link' => array( + array('name' => i18n("Sort"), 'link' => $array_sort_orders_links), ) ); } if($GLOBALS['linpha']->sql->photoIsAllowed( $this->id_parent, 'write')) { - $GLOBALS['linpha']->template->output['menu_More']['edit']['name'] = i18n("Edit"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['name'] = i18n("Open Filemanager"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&linId='.$this->id_parent; + $GLOBALS['linpha']->template->menu['more']['edit']['name'] = i18n("Edit"); + $GLOBALS['linpha']->template->menu['more']['edit']['value'][2]['name'] = i18n("Open Filemanager"); + $GLOBALS['linpha']->template->menu['more']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&linId='.$this->id_parent; } if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { - $GLOBALS['linpha']->template->output['menu_More']['metainfo'] = + $GLOBALS['linpha']->template->menu['more']['metainfo'] = array( 'name' => i18n("Metainfo"), - 'value' => array( - array('name' => i18n("Edit Album Information"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=albmeta'), + 'link' => array( + array('name' => i18n("Edit Album Information"), 'link' => $GLOBALS['linpha']->template->URL_full.'&view=albmeta'), ) ); } break; case 'image': - $GLOBALS['linpha']->template->output['menu_More']['basket'] = + $GLOBALS['linpha']->template->menu['more']['basket'] = array( 'name' => i18n("Basket"), - 'value' => array( - array('name' => i18n("Add To Basket"), 'value' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_this'), - array('name' => i18n("Open Basket").' ('.count($_SESSION['basket_ids']).' '.i18n("Images").')', 'value' => $open_basket_link) + 'link' => array( + array('name' => i18n("Add To Basket"), 'link' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_this'), + array('name' => i18n("Open Basket").' ('.count($_SESSION['basket_ids']).' '.i18n("Images").')', 'link' => $open_basket_link) ) ); - $GLOBALS['linpha']->template->output['menu_More']['view'] = + $GLOBALS['linpha']->template->menu['more']['view'] = array( 'name' => i18n("View"), - 'value' => array( - array('name' => i18n("Sort"), 'value' => $array_sort_orders_links), - array('name' => i18n("View at"), 'value' => + 'link' => array( + array('name' => i18n("Sort"), 'link' => $array_sort_orders_links), + array('name' => i18n("View at"), 'link' => array( - array('name' => '640x480', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=640&height=480', 'target' => '_blank'), - array('name' => '800x600', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=800&height=600', 'target' => '_blank'), - array('name' => '1024x768', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1024&height=768', 'target' => '_blank'), - array('name' => '1280x800', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=800', 'target' => '_blank'), - array('name' => '1280x960', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=960', 'target' => '_blank'), - array('name' => '1280x1024', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=1024', 'target' => '_blank'), - array('name' => '1600x1200', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1600&height=1200', 'target' => '_blank'), - array('name' => '1920x1200', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1920&height=1200', 'target' => '_blank'), - array('id' => 'linLiViewAtFullscreen', 'name' => $this->org_width.'x'.$this->org_height.' ('.i18n("Fullscreen").')', 'value' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), + array('name' => '640x480', 'link' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=640&height=480', 'target' => '_blank'), + array('name' => '800x600', 'link' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=800&height=600', 'target' => '_blank'), + array('name' => '1024x768', 'link' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1024&height=768', 'target' => '_blank'), + array('name' => '1280x800', 'link' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=800', 'target' => '_blank'), + array('name' => '1280x960', 'link' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=960', 'target' => '_blank'), + array('name' => '1280x1024', 'link' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1280&height=1024', 'target' => '_blank'), + array('name' => '1600x1200', 'link' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1600&height=1200', 'target' => '_blank'), + array('name' => '1920x1200', 'link' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width=1920&height=1200', 'target' => '_blank'), + array('id' => 'linLiViewAtFullscreen', 'name' => $this->org_width.'x'.$this->org_height.' ('.i18n("Fullscreen").')', 'link' => LINPHA_CLIENT.'/get_image.php?linId='.$GLOBALS['linpha']->template->idCurrent.'&width='.$this->org_width.'&height='.$this->org_height, 'target' => '_blank'), ) ) ) @@ -443,28 +432,28 @@ if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { - $GLOBALS['linpha']->template->output['menu_More']['edit']['name'] = i18n("Edit"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][0]['name'] = i18n("Rotate Left"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][0]['value'] = $GLOBALS['linpha']->template->URL_full.'&admin_cmd=rotate_left'; - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][1]['name'] = i18n("Rotate Right"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][1]['value'] = $GLOBALS['linpha']->template->URL_full.'&admin_cmd=rotate_right'; + $GLOBALS['linpha']->template->menu['more']['edit']['name'] = i18n("Edit"); + $GLOBALS['linpha']->template->menu['more']['edit']['value'][0]['name'] = i18n("Rotate Left"); + $GLOBALS['linpha']->template->menu['more']['edit']['value'][0]['value'] = $GLOBALS['linpha']->template->URL_full.'&admin_cmd=rotate_left'; + $GLOBALS['linpha']->template->menu['more']['edit']['value'][1]['name'] = i18n("Rotate Right"); + $GLOBALS['linpha']->template->menu['more']['edit']['value'][1]['value'] = $GLOBALS['linpha']->template->URL_full.'&admin_cmd=rotate_right'; } if($GLOBALS['linpha']->sql->photoIsAllowed( $this->id_parent, 'write')) { - $GLOBALS['linpha']->template->output['menu_More']['edit']['name'] = i18n("Edit"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['name'] = i18n("Open Filemanager"); - $GLOBALS['linpha']->template->output['menu_More']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&linId='.$this->id_parent; + $GLOBALS['linpha']->template->menu['more']['edit']['name'] = i18n("Edit"); + $GLOBALS['linpha']->template->menu['more']['edit']['value'][2]['name'] = i18n("Open Filemanager"); + $GLOBALS['linpha']->template->menu['more']['edit']['value'][2]['value'] = LINPHA_LINK.'&linCat=filemanager&linId='.$this->id_parent; } if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { - $GLOBALS['linpha']->template->output['menu_More']['metainfo'] = + $GLOBALS['linpha']->template->menu['more']['metainfo'] = array( 'name' => i18n("Metainfo"), - 'value' => array( - array('name' => i18n("Edit Image Information"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=meta') + 'link' => array( + array('name' => i18n("Edit Image Information"), 'link' => $GLOBALS['linpha']->template->URL_full.'&view=meta') ) ); } @@ -476,39 +465,32 @@ /** * Icons */ - $GLOBALS['linpha']->template->output['menu_Icons'] = ''; if($this->mode == 'thumb') { - /** - * basket icons - */ - if( $GLOBALS['linpha']->sql->checkPermission('basket_download')) - { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all_with_checkout&checkout_as=download">'. - '<img src="'.$GLOBALS['linpha']->template->themeFile('images/download.png').'" border="0" title="'.i18n("Download Images").'" />' - .'</a>'."\n"; - } - if( $GLOBALS['linpha']->sql->checkPermission('basket_print')) - { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all_with_checkout&checkout_as=print">'. - '<img src="'.$GLOBALS['linpha']->template->themeFile('images/print.png').'" border="0" title="'.i18n("Print Images").'" />' - .'</a>'."\n"; - } - if( $GLOBALS['linpha']->sql->checkPermission('basket_mail')) - { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all_with_checkout&checkout_as=mail">'. - '<img src="'.$GLOBALS['linpha']->template->themeFile('images/slideshow.png').'" border="0" title="'.i18n("Mail Images").'" />' - .'</a>'."\n"; - } - /** - * slideshow icon - */ - if( linUseAjax() ) { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:myLinThumbnails.loadSlideshow()">'. - '<img src="'.$GLOBALS['linpha']->template->themeFile('images/slideshow.png').'" border="0" title="'.i18n("Play Slideshow").'" />' - .'</a>'."\n"; - } - + /** + * basket icons + */ + if( $GLOBALS['linpha']->sql->checkPermission('basket_download')) + { + $GLOBALS['linpha']->template->menu['icon_download'] = $GLOBALS['linpha']->template->URL_full. + '&admin_cmd=basket_add_all_with_checkout&checkout_as=download'; + } + if( $GLOBALS['linpha']->sql->checkPermission('basket_print')) + { + $GLOBALS['linpha']->template->menu['icon_print'] = $GLOBALS['linpha']->template->URL_full. + '&admin_cmd=basket_add_all_with_checkout&checkout_as=print'; + } + if( $GLOBALS['linpha']->sql->checkPermission('basket_mail')) + { + $GLOBALS['linpha']->template->menu['icon_mail'] = $GLOBALS['linpha']->template->URL_full. + '&admin_cmd=basket_add_all_with_checkout&checkout_as=mail'; + } + /** + * slideshow icon + */ + if( linUseAjax() ) { + $GLOBALS['linpha']->template->menu['icon_slideshow'] = 'javascript:myLinThumbnails.loadSlideshow()'; + } } elseif($this->mode == 'image') { @@ -517,30 +499,24 @@ */ if( $GLOBALS['linpha']->sql->checkPermission('download')) { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.LINPHA_LINK.'&linCat=download&linId='.$GLOBALS['linpha']->template->idCurrent.'">'. - '<img src="'.$GLOBALS['linpha']->template->themeFile('images/download.png').'" border="0" title="'.i18n("Download Image").'" />' - .'</a>'."\n"; + $GLOBALS['linpha']->template->menu['icon_download'] = LINPHA_LINK.'&linCat=download&linId='.$GLOBALS['linpha']->template->idCurrent; } if( $GLOBALS['linpha']->sql->checkPermission('basket_print')) { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_this_with_checkout&checkout_as=print">'. - '<img src="'.$GLOBALS['linpha']->template->themeFile('images/print.png').'" border="0" title="'.i18n("Print Image").'" />' - .'</a>'."\n"; + $GLOBALS['linpha']->template->menu['icon_print'] = $GLOBALS['linpha']->template->URL_full. + '&admin_cmd=basket_add_this_with_checkout&checkout_as=print'; } if( $GLOBALS['linpha']->sql->checkPermission('basket_mail')) { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_this_with_checkout&checkout_as=mail">'. - '<img src="'.$GLOBALS['linpha']->template->themeFile('images/slideshow.png').'" border="0" title="'.i18n("Mail Image").'" />' - .'</a>'."\n"; + $GLOBALS['linpha']->template->menu['icon_mail'] = $GLOBALS['linpha']->template->URL_full. + '&admin_cmd=basket_add_this_with_checkout&checkout_as=mail'; } /** * slideshow icon */ if( linUseAjax() ) { - $GLOBALS['linpha']->template->output['menu_Icons'] .= '<a href="javascript:myLinImage.fullscreenStart()">'. - '<img src="'.$GLOBALS['linpha']->template->themeFile('images/slideshow.png').'" border="0" title="'.i18n("Play Slideshow").'" />' - .'</a>'."\n"; + $GLOBALS['linpha']->template->menu['icon_slideshow'] = 'javascript:myLinThumbnails.fullscreenStart()'; } } } Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2008-02-21 20:36:08 UTC (rev 4891) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2008-02-22 09:26:16 UTC (rev 4892) @@ -221,62 +221,13 @@ } /** - * start template - * this must be at execatly this place, because: - * 1. it needs to be after the database is connected, because - * in the constructor of linTemplate() are configs from the db read - * 2. we need the template already in startSession(), because of the - * syslog after loggin in - * - * the same with the language file + * include language file + * must be after dbConnnect, but before login */ - $GLOBALS['linpha']->template = new linTemplate(); - global $linTpl; - $linTpl = $GLOBALS['linpha']->template; // this is just a reference - linIncludeLanguageFile(); /** - * set idCurrent - * add support for static links - * linpha2/index.php/album1/file.jpg - * will set the correct id - */ - if(isset($_GET['linId'])) - { - $GLOBALS['linpha']->template->idCurrent = intval($_GET['linId']); - } - else - { - /** - * u-oh... take care when handling with $_SERVER['PATH_INFO'], it is not secure - * and may contain cross site scripting. in common.php all htmlentities have been - * replaced - * - * LinSql::getIdFromFullFilename does not output to the browser, always uses addslashes() - * and returns false if it is not a valid album, so as far as i know it's safe to use it this way - */ - if( isset($_SERVER['PATH_INFO']) ) - { - $id = LinSql::getIdFromFullFilename( substr($_SERVER['PATH_INFO'],1) ); // PATH_INFO starts with a '/' -> remove this - - if($id === false) - { - $GLOBALS['linpha']->template->idCurrent = 0; - } - else - { - $GLOBALS['linpha']->template->idCurrent = $id; - } - } - else - { - $GLOBALS['linpha']->template->idCurrent = 0; - } - } - - /** * maybe the session is already started * this should be no problem, hopefully */ @@ -327,7 +278,7 @@ if($data = $query->FetchRow()) { linLog(LOG_TYPE_USER,LOG_NOTICE,'login','User '.$data['username'].': successfully logged in (cookie).'); - linSysLog(i18n("Successfully Logged In!")); + $sysLogMsg[] = i18n("Successfully Logged In!"); $this->setUserInformation($data['username'],$_COOKIE['linpha_userid'],$data['display_name']); } @@ -363,13 +314,13 @@ setcookie('linpha_password'); // delete cookie linpha_password } - linSysLog(i18n("Logged out.")); + $sysLogMsg[] = i18n("Logged out."); } elseif($_POST['cmd']=='login') { if( !isset($_POST['username']) OR !isset($_POST['password']) OR empty($_POST['username']) OR empty($_POST['password'])) { - linSysLog(i18n("Please Fill In All Fields!")); + $sysLogMsg[] = i18n("Please Fill In All Fields!"); } else { @@ -388,7 +339,7 @@ */ linLog(LOG_TYPE_USER,LOG_NOTICE,'login','User '.$_POST['username'].': successfully logged in.'); - linSysLog(i18n("Successfully Logged In!")); + $sysLogMsg[] = i18n("Successfully Logged In!"); $this->setUserInformation($_POST['username'],$data['id'],$data['display_name']); @@ -408,9 +359,8 @@ /** * failed login */ - linLog(LOG_TYPE_USER,LOG_WARNING,'login','User '.$_POST['username'].': login failed!'); - linSysLog(i18n("Login Failed!")); + $sysLogMsg[] = i18n("Login Failed!"); } } } @@ -491,6 +441,24 @@ $GLOBALS['linpha']->sql->config->value[$data['option_name']] = $data['option_value']; } } + + /** + * start template + * this must be after login stuff + * template requires login information + */ + $GLOBALS['linpha']->template = new linTemplate(); + global $linTpl; + $linTpl = $GLOBALS['linpha']->template; // this is just a reference + + /** + * add previously added log messages + */ + if (isset($sysLogMsg)) { + foreach($sysLogMsg as $msg) { + linSysLog($msg); + } + } } // end function startSession Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2008-02-21 20:36:08 UTC (rev 4891) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2008-02-22 09:26:16 UTC (rev 4892) @@ -31,13 +31,15 @@ public $layoutimagespath; public $output; public $URL_base, $URL_full, $idCurrent; + public $hideMenu = false, $hideTitle = false; + public $menu, $menuFinal, $nofMenuEntries = 0; + public $arrayDefaultMenuEntries; public $bgcolor, $bodybgcolor, $fontcolor, $albumsbgcolor, $linkscolor, $linkshovercolor; public $fnCallback = ''; - private $body_name; private $head_name; private $css_name; @@ -59,8 +61,69 @@ $this->albumsbgcolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_albumsbg']; $this->linkscolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_links']; $this->linkshovercolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_linkshover']; - $this->fieldscolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_fields']; + $this->formscolor = $GLOBALS['linpha']->sql->config->value['sys_style_layout_color_fields']; + /** + * set idCurrent + * add support for static links + * linpha2/index.php/album1/file.jpg + * will set the correct id + */ + if(isset($_GET['linId'])) + { + $this->idCurrent = intval($_GET['linId']); + } + else + { + /** + * u-oh... take care when handling with $_SERVER['PATH_INFO'], it is not secure + * and may contain cross site scripting. in common.php all htmlentities have been + * replaced + * + * LinSql::getIdFromFullFilename does not output to the browser, always uses addslashes() + * and returns false if it is not a valid album, so as far as i know it's safe to use it this way + */ + if( isset($_SERVER['PATH_INFO']) ) + { + $id = LinSql::getIdFromFullFilename( substr($_SERVER['PATH_INFO'],1) ); // PATH_INFO starts with a '/' -> remove this + + if($id === false) + { + $this->idCurrent = 0; + } + else + { + $this->idCurrent = $id; + } + } + else + { + $this->idCurrent = 0; + } + } + + /** + * Initial menu entries + */ + if($GLOBALS['linpha']->sql->isLoggedIn()) + { + if( isset($GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable']) + && $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable'] == 1 ) + { + $GLOBALS['linpha']->template->menu['settings']['filemanager'] = + array('name' => i18n("Filemanager"), 'link' => LINPHA_LINK.'&linCat=filemanager'); + } + } + + $this->arrayDefaultMenuEntries = array( + 'home' => i18n("Home"), + 'search' => i18n("Search"), + 'login' => i18n("Login"), + 'more' => i18n("More"), + 'admin' => i18n("Admin"), + 'settings' => i18n("Settings") + ); + } /** @@ -74,20 +137,23 @@ { case 'body': $filename = LINPHA_DIR.'/templates/'.$this->template_name.'/'.$this->body_name.'.html.php'; - if(file_exists($filename)) - { + if (file_exists($filename)) { include_once( $filename ); } break; + case 'menu': + $filename = LINPHA_DIR.'/templates/'.$this->template_name.'/menu.html.php'; + if (file_exists($filename)) { + include_once( $filename ); + } + + break; case 'head': /** * do some common definitions in head */ -?> -<!-- css includes --> -<?php /** * Prepare http url */ @@ -98,72 +164,48 @@ 'albumsbg' => ''.$this->albumsbgcolor.'', 'links' => ''.$this->linkscolor.'', 'linkshover' => ''.$this->linkshovercolor.'', - 'fieldscolor' => ''.$this->fieldscolor.'' + 'forms' => ''.$this->formscolor.'' ); +/** + * colorsettings.php + */ ?> -<!-- colorsettings.php --> - -<link rel='stylesheet' - href='<?php echo LINPHA_CLIENT.'/templates/'. +<link rel="stylesheet" href="<?php echo LINPHA_CLIENT.'/templates/'. $this->template_name.'/themes/default/colorsettings.php?'. - http_build_query($urlParams);?>' type='text/css'> + http_build_query($urlParams);?>" type="text/css" /> +<?php +$filename = '/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/colorsettings.php'; +if ($this->layout_name != 'default' && file_exists(LINPHA_DIR.$filename)) { ?> +<link rel="stylesheet" href="<?php echo LINPHA_CLIENT.$filename.'?'. + http_build_query($urlParams); ?>" type="text/css" /> +<?php } +/** + * global.css + */ +?> +<link rel="stylesheet" href="<?php echo LINPHA_CLIENT.'/templates/'. + $this->template_name.'/themes/default/css/global.css'; ?>" type="text/css" /> +<?php +$filename = '/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/global.css'; +if ($this->layout_name != 'default' && file_exists(LINPHA_DIR.$filename)) { ?> +<link rel="stylesheet" href="<?php echo LINPHA_CLIENT.$filename; ?>" type="text/css" /> +<?php } +/** + * body css + */ +?> +<link rel="stylesheet" href="<?php echo LINPHA_CLIENT.'/templates/'. + $this->template_name.'/themes/default/css/'.$this->css_name.'.css'; ?>" type="text/css" /> +<?php +$filename = '/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/'.$this->css_name.'.css'; +if ($this->layout_name != 'default' && file_exists(LINPHA_DIR.$filename)) { ?> +<link rel="stylesheet" href="<?php echo LINPHA_CLIENT.$filename; ?>" type="text/css" /> +<?php } -<?php if($this->layout_name != 'default' && - file_exists(LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'. - $this->layout_name.'/colorsettings.php')) - { ?> - - <link rel='stylesheet' - href='<?php echo LINPHA_CLIENT.'/templates/'. - $this->template_name.'/themes/'.$this->layout_name."/colorsettings.php?". - http_build_query($urlParams); ?>' type='text/css'> -<?php } ?> - -<!-- global.css --> - -<link rel='stylesheet' - href='<?php echo LINPHA_CLIENT.'/templates/'. - $this->template_name.'/themes/default/css/global.css'; ?>' type='text/css'> - -<?php if($this->layout_name != 'default' && - file_exists(LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'. - $this->layout_name.'/css/global.css')) - { ?> - <link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/templates/'. - $this->template_name.'/themes/'.$this->layout_name.'/css/global.css'; ?>' - type='text/css'> -<?php } ?> - -<!-- body css --> - -<link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/templates/'. - $this->template_name.'/themes/default/css/'.$this->css_name.'.css'; ?>' - type='text/css'> - -<?php if($this->layout_name != 'default' && - file_exists(LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'. - $this->layout_name.'/css/'.$this->css_name.'.css')) - { ?> - <link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/templates/'. - $this->template_name.'/themes/'.$this->layout_name.'/css/'. - $this->css_name.'.css'; ?>' type='text/css'> -<?php } ?> - - <!--[if IE]> - <style type="text/css" media="screen"> - #menu ul { width: 1em; } /* this will be a *min* width */ - #menu ul ul { width: 12em; } - #menu ul li { float: left; width: 100%; } -<?php /* </style> - <![endif]--> - <!--[if lt IE 7]> - <style type="text/css" media="screen">*/ ?> - body { behavior: url(<?php echo LINPHA_CLIENT; ?>/templates/misc/csshover.htc); font-size: 100%; } - #menu ul li a { height: 1%; } - #menu a, #menu span { font: bold 0.7em/1.4em arial, helvetica, sans-serif; } - </style> - <![endif]--> - +/** + * javascript + */ +?> <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/prototype.js"></script> <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/LinGlobal.js"></script> <script type="text/javascript" language="JavaScript"> @@ -172,6 +214,7 @@ var linUrlBase = '<?php echo linConvertAmp($linTpl->URL_base); ?>'; var startIdCurrent = <?php echo $this->idCurrent; ?>; var IdCurrent = startIdCurrent; +var myThemePanelBase = '<?php echo $this->themeFile('menu/'); ?>'; <?php if(! isset($_SESSION['use_js']) && ! isset($_SESSION['disable_ajax'])) { //echo "var checkAjaxCompatibility = true;"."\n"; @@ -181,11 +224,17 @@ }*/ ?> </script> +<?php +/* menu must be after myThemePanelBase definition */ +$filename = LINPHA_DIR.'/templates/'.$this->template_name.'/menu.head.php'; +if (file_exists($filename)) { + include_once( $filename ); +} +?> <?php $filename = LINPHA_DIR.'/templates/'.$this->template_name.'/'.$this->head_name.'.head.php'; - if(file_exists($filename)) - { + if (file_exists($filename)) { include_once( $filename ); } @@ -217,229 +266,175 @@ } } - /** - * print the whole menu - * @uses global.html.php, module.ajax.php - */ - function printMenus($modules,$comingfrom_ajax=false) - { - $array = explode(',',$modules); - foreach($array AS $value) - { - switch($value) - { - case 'more': - if( isset( $this->output['menu_More'] ) ) { - $this->printMenu("More",i18n("More")); - } - break; - case 'settings': - if($GLOBALS['linpha']->sql->isLoggedIn()) { - echo '<!-- my settings -->'."\n"; - $this->printMenu("My Settings",i18n("My Settings"),LINPHA_LINK."&linCat=settings"); - } - break; - case 'admin': - if($GLOBALS['linpha']->sql->isLoggedIn()) { - echo '<!-- admin links -->'."\n"; - $this->printMenu("Admin",i18n("Admin"),LINPHA_CLIENT."/admin/"); - } - break; - default: // all other, like home, search, login, guestbook, icons, more - $fragment = 'menu_'.$value; - include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); - break; - } - } - - if($comingfrom_ajax && isset($this->output['sys_log']) && !empty($this->output['sys_log'])) - { - echo '<script language="JavaScript" type="text/javascript">myLinGlobal.linSyslog("'.$this->output['sys_log'].'");</script>'; - } - } - /** - * print the main menu entries (more, admin, ...) - */ - function printMenu($index,$text,$link='') - { - if( ! isset( $GLOBALS['linpha']->template->output['menu_'.$index] ) ) - { - echo "\n".'<ul>'."\n"; - echo "\t".'<li><a href="'.$link.'">'.$text.'</a>'."\n"; - echo "\n".'</ul>'."\n"; - } - else - { - echo "\n".'<ul>'."\n"; - if(!empty($link)) - { - echo "\t".'<li><a href="'.$link.'">'.$text.'</a>'."\n"; - } - else - { - echo "\t".'<li><span>'.$text.' </span>'."\n"; - } - echo "\n".'<ul id="linMenu'.$index.'" onmouseover="myLinGlobal.reloadMenu()">'."\n"; - - foreach($GLOBALS['linpha']->template->output['menu_'.$index] AS $key=>$value) - { - if(!is_array($value['value'])) - { - if(isset($value['target'])) { - $target_str = ' target="'.$value['target'].'"'; - } else { - $target_str = ''; - } - - if(isset($value['id'])) { - $id_str = ' id="'.$value['id'].'"'; - } else { - $id_str = ''; - } + function setMenu() + { + $arrayMenuEntries = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_menu_list']); + + foreach($arrayMenuEntries as $menuEntry) + { + if ($menuEntry == 'more' || $menuEntry == 'admin' || $menuEntry == 'settings') + { + if (!isset($this->menu[$menuEntry])) { + continue; + } + } + + if (isset($this->arrayDefaultMenuEntries[$menuEntry])) { + $this->menuFinal[ $menuEntry ] = array( + 'name' => $this->arrayDefaultMenuEntries[$menuEntry], + 'link' => LINPHA_LINK.'&linCat='.$menuEntry + ); + } elseif ( strpos($menuEntry, 'plugin_') !== false ) { + $menuEntry = substr($menuEntry, 7); + $this->menuFinal[ $menuEntry ] = array( + 'name' => i18n(ucfirst($menuEntry)), // this will not be detected by the language translater, but thats no problem because this plugin name is for sure somewhere else + 'link' => LINPHA_LINK.'&linCat='.$menuEntry + ); + } elseif ( strpos($menuEntry, 'icon_') !== false ) { + if (isset($this->menu[$menuEntry])) { + $this->menuFinal[ $menuEntry ] = array( + 'name' => $menuEntry, + 'link' => $this->menu[$menuEntry] + ); + } + } elseif ( strpos($GLOBALS['linpha']->sql->config->value['sys_style_menu_userlink1'], $menuEntry) !== false ) { + $arrayMenu = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_menu_userlink1']); + $this->menuFinal[ $menuEntry ] = array( + 'name' => $arrayMenu[1], + 'link' => $arrayMenu[2] + ); + } elseif ( strpos($GLOBALS['linpha']->sql->config->value['sys_style_menu_userlink2'], $menuEntry) !== false ) { + $arrayMenu = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_menu_userlink2']); + $this->menuFinal[ $menuEntry ] = array( + 'name' => $arrayMenu[1], + 'link' => $arrayMenu[2] + ); + } elseif ( strpos($GLOBALS['linpha']->sql->config->value['sys_style_menu_userlink3'], $menuEntry) !== false ) { + $arrayMenu = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_menu_userlink3']); + $this->menuFinal[ $menuEntry ] = array( + 'name' => $arrayMenu[1], + 'link' => $arrayMenu[2] + ); + } elseif ( strpos($GLOBALS['linpha']->sql->config->value['sys_style_menu_userlink4'], $menuEntry) !== false ) { + $arrayMenu = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_menu_userlink4']); + $this->menuFinal[ $menuEntry ] = array( + 'name' => $arrayMenu[1], + 'link' => $arrayMenu[2] + ); + } elseif ( strpos($GLOBALS['linpha']->sql->config->value['sys_style_menu_userlink5'], $menuEntry) !== false ) { + $arrayMenu = explode(',',$GLOBALS['linpha']->sql->config->value['sys_style_menu_userlink5']); + $this->menuFinal[ $menuEntry ] = array( + 'name' => $arrayMenu[1], + 'link' => $arrayMenu[2] + ); + } else { + $this->menuFinal[ $menuEntry ] = array( + 'name' => $menuEntry, + 'link' => LINPHA_LINK.'&linCat='.$menuEntry + ); + } + + $this->nofMenuEntries++; + } + } + + function createJSCookMenu() + { + foreach ($this->menu as $key=>$arrayMenuEntry) + { + if (strpos($key,'icon_')===false) { + $this->menuJSCook[$key][] = "[null, '".$this->arrayDefaultMenuEntries[$key]."', null, null, null, "."\n"; + $this->createJSCookMenuEntry($key, $arrayMenuEntry); + $this->menuJSCook[$key][] = "]"; + } + } + } + + function createJSCookMenuEntry($key, &$arrayMenuEntry) + { + //print_r($arrayMenuEntry); + + foreach ($arrayMenuEntry as $arraySubMenuEntry) + { + $this->menuJSCook[$key][] = "[null, '".htmlentities($arraySubMenuEntry['name'], ENT_QUOTES)."', "; + if (is_array($arraySubMenuEntry['link'])) { + $this->menuJSCook[$key][] = "null, null, null, "."\n"; + $this->createJSCookMenuEntry($key, $arraySubMenuEntry['link']); + } else { + $link = linConvertAmp($arraySubMenuEntry['link']); + $link = str_replace("'",'\\\'', $link); + $this->menuJSCook[$key][] = "'".$link."', null, null,"; + } + + $this->menuJSCook[$key][] = "],"."\n"; + } + /* + [null, 'More', null, null, 'Some more options', + [null, 'Basket', null, null, 'Download/Mail/Print a batch of images', + [null, 'Add All To Basket', 'url', 'target', 'description'], + [null, 'Switch To Basket View', 'url', 'target', 'description'], + [null, 'Open Basket (0 Images)', 'url', 'target', 'description'] + ], + [null, 'View', null, null, 'description', + [null, 'Sort', 'url', 'target', 'description', + [null, 'Name Asc', 'url', 'target', 'description'], + [null, 'Name Desc', 'url', 'target', 'description'], + [null, 'Date Asc', 'url', 'target', 'description'], + [null, 'Date Desc', 'url', 'target', 'description'] + ], + [null, 'View', 'url', 'target', 'description', + [null, 'Normal', 'url', 'target', 'description'], + [null, 'Detail', 'url', 'target', 'description'] + ], + [null, 'Thumb Size', 'url', 'target', 'description', + [null, '50 Pixel', 'url', 'target', 'description'], + [null, '75 Pixel', 'url', 'target', 'description'], + [null, '100 Pixel', 'url', 'target', 'description'], + [null, '150 Pixel', 'url', 'target', 'description'], + [null, '200 Pixel', 'url', 'target', 'description'], + [null, '250 Pixel', 'url', 'target', 'description'], + [null, '300 Pixel', 'url', 'target', 'description'], + [null, '400 Pixel', 'url', 'target', 'description'], + [null, '500 Pixel', 'url', 'target', 'description'] + ], + [null, 'Thumb Nr', 'url', 'target', 'description' + [null, 'auto', 'url', 'target', 'description'], + [null, '10', 'url', 'target', 'description'], + [null, '25', 'url', 'target', 'description'], + [null, '50', 'url', 'target', 'description'], + [null, '100', 'url', 'target', 'description'], + [null, '200', 'url', 'target', 'description'], + [null, 'all', 'url', 'target', 'description'] + ] + ], + ], + */ + } - echo "\t".'<li'.$id_str.'><a href="'.$value['value'].'"'.$target_str.'>'.$value['name'].'</a></li>'."\n"; - } - else - { - echo "\t".'<li><span>'.$value['name'].' </span>'."\n"; - - echo "\t".'<ul>'."\n"; - - foreach($value['value'] AS $sub_value) - { - if(!is_array($sub_value['value'])) - { - if(isset($sub_value['target'])) { - $target_str = ' target="'.$sub_value['target'].'"'; - } else { - $target_str = ''; - } - - if(isset($sub_value['id'])) { - $id_str = ' id="'.$sub_value['id'].'"'; - } else { - $id_str = ''; - } - - echo "\t\t".'<li'.$id_str.'><a href="'.$sub_value['value'].'"'.$target_str.'>'.$sub_value['name'].'</a></li>'."\n"; - } - else - { - echo "\t\t".'<li><span>'.$sub_value['name'].' </span>'."\n"; - - echo "\t\t".'<ul>'."\n"; - - foreach($sub_value['value'] AS $subsub_value) - { - if(isset($subsub_value['target'])) { - $target_str = ' target="'.$subsub_value['target'].'"'; - } else { - $target_str = ''; - } - - if(isset($subsub_value['id'])) { - $id_str = ' id="'.$subsub_value['id'].'"'; - } else { - $id_str = ''; - } - - echo "\t\t\t".'<li'.$id_str.'><a href="'.$subsub_value['value'].'"'.$target_str.'>'.$subsub_value['name'].'</a></li>'."\n"; - - } - - echo "\t\t".'</ul>'."\n"; - echo "\t\t".'</li>'."\n"; - } - } - - echo "\t".'</ul>'."\n"; - echo "\t".'</li>'."\n"; - } - } - - echo "\t".'</ul>'."\n"; - echo "\t".'</li>'."\n"; - echo '</ul>'."\n"; - } - } - - /** - * rounded corner stuff - */ - function divRoundCorners($top_bottom,$alpha='',$type='') - { - $size = 15; - - if(empty($type)) // default - { - $color = $this->bgcolor; - $bgcolor = $this->bodybgcolor; - } - elseif($type=='albums') - { - $color = $this->albumsbgcolor; - $bgcolor = $this->bgcolor; - } - - if($top_bottom == 'top') - { - $alignleft = 'tl'; - $alignright = 'tr'; - } - elseif($top_bottom == 'bottom') - { - $alignleft = 'bl'; - $alignright = 'br'; - } + /** + * rounded corner stuff + */ + function divRoundCorners($top_bottom,$type='') + { + if ($type=='main') { + $class = 'linCornMain'; + } elseif($type=='album') { + $class = 'linCornFolder'; + } else { + $class = ''; + } - /** - * Prepare http url - */ - $lcornerParam = array( - 'color' => ''.$color.'', - 'bgcolor' => ''.$bgcolor.'', - 'size' => ''.$size.'', - 'align' => ''.$alignleft.'' - ); - - $rcornerParam = array( - 'color' => ''.$color.'', - 'bgcolor' => ''.$bgcolor.'', - 'size' => ''.$size.'', - 'align' => ''.$alignright.'' - ); - - if(empty($alpha)) // default - { - $str = '<div style="background: - url('.LINPHA_CLIENT.'/templates/misc/roundcorners.php?'. - http_build_query($rcornerParam).') no-repeat top right;">'; - - $str .= '<img src="'.LINPHA_CLIENT.'/templates/misc/roundcorners.php?'. - http_build_query($lcornerParam).'" - alt="" width="'.$size.'" height="'.$size.'" />'; - - $str .= '</div>'; - } - else // currently only used in slideshow, sucks with IE - { - $str = '<div style="position: relative; background: - url('.LINPHA_CLIENT.'/templates/misc/roundcorners.php?'. - http_build_query($rcornerParam).'&alpha) no-repeat top right;">'; - - $str .= '<div class="roundAlphabottomInner"> </div>'; - - $str .= '<img src="'.LINPHA_CLIENT.'/templates/misc/roundcorners.php?'. - http_build_query($lcornerParam).'&alpha" - alt="" width="'.$size.'" height="'.$size.'" class="AlphaCorner" />'; - - $str .= '</div>'; - } + if ($top_bottom == 'top') + { + return '<div class="linCorn '.$class.'"><div class="linCornC"><div class="linCornT"></div>'; + } + elseif($top_bottom == 'bottom') + { + return '</div><div class="linCornB"><div></div></div></div>'; + } + } - return $str; - } - function themeFile( $filename ) { if( file_exists( LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/'.$filename ) ) Modified: trunk/linpha2/lib/include/sql/sql.data.php =================================================================== --- trunk/linpha2/lib/include/sql/sql.data.php 2008-02-21 20:36:08 UTC (rev 4891) +++ trunk/linpha2/lib/include/sql/sql.data.php 2008-02-22 09:26:16 UTC (rev 4892) @@ -99,6 +99,13 @@ 'sys_style_layout_template' => 'default', 'sys_style_layout_title' => 'Linpha 2.0', + 'sys_style_menu_list' => 'home,search,login,more,icon_slideshow,icon_download,icon_mail,icon_print,admin,settings', + 'sys_style_menu_userlink1' => '', + 'sys_style_menu_userlink2' => '', + 'sys_style_menu_userlink3' => '', + 'sys_style_menu_userlink4' => '', + 'sys_style_menu_userlink5' => '', + 'sys_style_others_sortorder' => 'nameasc', ); Added: trunk/linpha2/lib/js/JSCookMenu/JSCookMenu.js =================================================================== --- trunk/linpha2/lib/js/JSCookMenu/JSCookMenu.js (rev 0) +++ trunk/linpha2/lib/js/JSCookMenu/JSCookMenu.js 2008-02-22 09:26:16 UTC (rev 4892) @@ -0,0 +1,1658 @@ +/* + JSCookMenu v2.0.3 (c) Copyright 2002-2006 by Heng Yuan + + http://jscook.sourceforge.net/JSCookMenu/ + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +// default node properties +var _cmNodeProperties = +{ + // theme prefix + prefix: '', + + // main menu display attributes + // + // Note. When the menu bar is horizontal, + // mainFolderLeft and mainFolderRight are + // put in <span></span>. When the menu + // bar is vertical, they would be put in + // a separate TD cell. + + // HTML code to the left of the folder item + mainFolderLeft: '', + // HTML code to the right of the folder item + mainFolderRight: '', + // HTML code to the left of the regular item + mainItemLeft: '', + // HTML code to the right of the regular item + mainItemRight: '', + + // sub menu display attributes + + // HTML code to the left of the folder item + folderLeft: '', + // HTML code to the right of the folder item + folderRight: '', + // HTML code to the left of the regular item + itemLeft: '', + // HTML code to the right of the regular item + itemRight: '', + // cell spacing for main menu + mainSpacing: 0, + // cell spacing for sub menus + subSpacing: 0, + + // optional settings + // If not set, use the default + + // auto disappear time for submenus in milli-seconds + delay: 500, + + // 1st layer sub menu starting index + zIndexStart: 1000, + // z-index incremental step for subsequent layers + zIndexInc: 5, + + // sub menu header appears before the sub menu table + subMenuHeader: null, + // sub menu header appears after the sub menu table + subMenuFooter: null, + + // submenu location adjustments + // + // offsetHMainAdjust for adjusting the first submenu + // of a 'hbr' menu. + // offsetVMainAdjust for adjusting the first submenu + // of a 'vbr' menu. + // offsetSubAdjust for subsequent level of submenus + // + offsetHMainAdjust: [0, 0], + offsetVMainAdjust: [0, 0], + offsetSubAdjust: [0, 0], + + // act on click to open sub menu + // not yet implemented + // 0 : use default behavior + // 1 : hover open in all cases + // 2 : click on main, hover on sub + // 3 : click open in all cases (illegal as of 1.5) + clickOpen: 1, + + // special effects on open/closing a sub menu + effect: null +}; + +// Globals +var _cmIDCount = 0; +var _cmIDName = 'cmSubMenuID'; // for creating submenu id + +var _cmTimeOut = null; // how long the menu would stay +var _cmCurrentItem = null; // the current menu item being selected; + +var _cmNoAction = new Object (); // indicate that the item cannot be hovered. +var _cmNoClick = new Object (); // similar to _cmNoAction but does not respond to mouseup/mousedown events +var _cmSplit = new Object (); // indicate that the item is a menu split + +var _cmMenuList = new Array (); // a list of the current menus +var _cmItemList = new Array (); // a simple list of items + +var _cmFrameList = new Array (); // a pool of reusable iframes +var _cmFrameListSize = 0; // keep track of the actual size +var _cmFrameIDCount = 0; // keep track of the frame id +var _cmFrameMasking = true; // use the frame masking + +// disable iframe masking for IE7 +/*@cc_on + @if (@_jscript_version >= 5.6) + if (_cmFrameMasking) + { + var v = navigator.appVersion; + var i = v.indexOf ("MSIE "); + if (i >= 0) + { + if (parseInt (navigator.appVersion.substring (i + 5)) >= 7) + _cmFrameMasking = false; + } + } + @end +@*/ + +var _cmClicked = false; // for onClick + +// flag for turning on off hiding objects +// +// 0: automatic +// 1: hiding +// 2: no hiding +var _cmHideObjects = 0; + +// Utility function to do a shallow copy a node property +function cmClone (nodeProperties) +{ + var returnVal = new Object (); + for (v in nodeProperties) + returnVal[v] = nodeProperties[v]; + return returnVal; +} + +// +// store the new menu information into a structure to retrieve it later +// +function cmAllocMenu (id, menu, orient, nodeProperties, prefix) +{ + var info = new Object (); + info.div = id; + info.menu = menu; + info.orient = orient; + info.nodeProperties = nodeProperties; + info.prefix = prefix; + var menuID = _cmMenuList.length; + _cmMenuList[menuID] = info; + return menuID; +} + +// +// request a frame +// +function cmAllocFrame () +{ + if (_cmFrameListSize > 0) + return cmGetObject (_cmFrameList[--_cmFrameListSize]); + var frameObj = document.createElement ('iframe'); + var id = _cmFrameIDCount++; + frameObj.id = 'cmFrame' + id; + frameObj.frameBorder = '0'; + frameObj.style.display = 'none'; + frameObj.src = 'javascript:false'; + document.body.appendChild (frameObj); + frameObj.style.filter = 'alpha(opacity=0)'; + frameObj.style.zIndex = 99; + frameObj.style.position = 'absolute'; + frameObj.style.border = '0'; + frameObj.scrolling = 'no'; + return frameObj; +} + +// +// make a frame resuable later +// +function cmFreeFrame (frameObj) +{ + _cmFrameList[_cmFrameListSize++] = frameObj.id; +} + +////////////////////////////////////////////////////////////////////// +// +// Drawing Functions and Utilit... [truncated message content] |