Modifications linked to the move of admin.php to the root directory of PhpWebGallery
git-svn-id: http://piwigo.org/svn/trunk@228 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
5fdc7ea1e5
commit
860a39302e
8 changed files with 19 additions and 28 deletions
14
admin.php
14
admin.php
|
@ -18,10 +18,10 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
//----------------------------------------------------------- personnal include
|
//----------------------------------------------------------- personnal include
|
||||||
include_once( './include/isadmin.inc.php' );
|
include_once( './admin/include/isadmin.inc.php' );
|
||||||
//----------------------------------------------------- template initialization
|
//----------------------------------------------------- template initialization
|
||||||
$vtp = new VTemplate;
|
$vtp = new VTemplate;
|
||||||
$handle = $vtp->Open( '../template/'.$user['template'].'/admin/admin.vtp' );
|
$handle = $vtp->Open( './template/'.$user['template'].'/admin.vtp' );
|
||||||
// language
|
// language
|
||||||
$tpl = array( 'title_default','charset','install_warning' );
|
$tpl = array( 'title_default','charset','install_warning' );
|
||||||
templatize_array( $tpl, 'lang', $handle );
|
templatize_array( $tpl, 'lang', $handle );
|
||||||
|
@ -117,9 +117,9 @@ switch ( $_GET['page'] )
|
||||||
{
|
{
|
||||||
$title.= ' '.$lang['title_thumbnails_2'].' <span style="color:#006699;">';
|
$title.= ' '.$lang['title_thumbnails_2'].' <span style="color:#006699;">';
|
||||||
// $_GET['dir'] contains :
|
// $_GET['dir'] contains :
|
||||||
// ../galleries/vieux_lyon ou
|
// ./galleries/vieux_lyon ou
|
||||||
// ../galleries/vieux_lyon/visite ou
|
// ./galleries/vieux_lyon/visite ou
|
||||||
// ../galleries/vieux_lyon/visite/truc ...
|
// ./galleries/vieux_lyon/visite/truc ...
|
||||||
$dir = explode( "/", $_GET['dir'] );
|
$dir = explode( "/", $_GET['dir'] );
|
||||||
$title.= $dir[2];
|
$title.= $dir[2];
|
||||||
for ( $i = 3; $i < sizeof( $dir ) - 1; $i++ )
|
for ( $i = 3; $i < sizeof( $dir ) - 1; $i++ )
|
||||||
|
@ -237,13 +237,13 @@ $vtp->closeSession( $handle, 'summary' );
|
||||||
// back to thumbnails page
|
// back to thumbnails page
|
||||||
$vtp->addSession( $handle, 'summary' );
|
$vtp->addSession( $handle, 'summary' );
|
||||||
$vtp->setVar( $handle, 'summary.indent', '| ' );
|
$vtp->setVar( $handle, 'summary.indent', '| ' );
|
||||||
$vtp->setVar( $handle, 'summary.link', add_session_id( '../category.php' ) );
|
$vtp->setVar( $handle, 'summary.link', add_session_id( './category.php' ) );
|
||||||
$vtp->setVar( $handle, 'summary.name', $lang['menu_back'] );
|
$vtp->setVar( $handle, 'summary.name', $lang['menu_back'] );
|
||||||
$vtp->closeSession( $handle, 'summary' );
|
$vtp->closeSession( $handle, 'summary' );
|
||||||
//------------------------------------------------------------- content display
|
//------------------------------------------------------------- content display
|
||||||
if ( $page_valide )
|
if ( $page_valide )
|
||||||
{
|
{
|
||||||
include ( $_GET['page'].'.php' );
|
include ( './admin/'.$_GET['page'].'.php' );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,17 +60,12 @@ function display_pictures( $mysql_result, $maxtime, $validation_box = false )
|
||||||
$name.= ' [ '.$subrow['file'].' ]';
|
$name.= ' [ '.$subrow['file'].' ]';
|
||||||
$vtp->setVar( $sub, 'picture.title', $name );
|
$vtp->setVar( $sub, 'picture.title', $name );
|
||||||
// source of the thumbnail picture
|
// source of the thumbnail picture
|
||||||
$src = '';
|
$src = $array_cat_directories[$subrow['cat_id']];
|
||||||
if ( $array_cat_site_id[$subrow['cat_id']] == 1 )
|
|
||||||
{
|
|
||||||
$src.= '.';
|
|
||||||
}
|
|
||||||
$src.= $array_cat_directories[$subrow['cat_id']];
|
|
||||||
$src.= 'thumbnail/'.$conf['prefix_thumbnail'];
|
$src.= 'thumbnail/'.$conf['prefix_thumbnail'];
|
||||||
$src.= $file.'.'.$subrow['tn_ext'];
|
$src.= $file.'.'.$subrow['tn_ext'];
|
||||||
$vtp->setVar( $sub, 'picture.thumb_src', $src );
|
$vtp->setVar( $sub, 'picture.thumb_src', $src );
|
||||||
// link to the full size picture
|
// link to the full size picture
|
||||||
$url = '../picture.php?cat='.$subrow['cat_id'];
|
$url = './picture.php?cat='.$subrow['cat_id'];
|
||||||
$url.= '&image_id='.$row['image_id'];
|
$url.= '&image_id='.$row['image_id'];
|
||||||
$vtp->setVar( $sub, 'picture.thumb_url', add_session_id( $url ) );
|
$vtp->setVar( $sub, 'picture.thumb_url', add_session_id( $url ) );
|
||||||
// 3. for each picture, retrieving all comments
|
// 3. for each picture, retrieving all comments
|
||||||
|
|
|
@ -589,7 +589,7 @@ $vtp->addSession( $sub, 'param_line' );
|
||||||
$vtp->setVar( $sub, 'param_line.name', $lang['customize_language'] );
|
$vtp->setVar( $sub, 'param_line.name', $lang['customize_language'] );
|
||||||
$vtp->addSession( $sub, 'select' );
|
$vtp->addSession( $sub, 'select' );
|
||||||
$vtp->setVar( $sub, 'select.name', 'language' );
|
$vtp->setVar( $sub, 'select.name', 'language' );
|
||||||
$option = get_languages( '../language/' );
|
$option = get_languages( './language/' );
|
||||||
for ( $i = 0; $i < sizeof( $option ); $i++ )
|
for ( $i = 0; $i < sizeof( $option ); $i++ )
|
||||||
{
|
{
|
||||||
$vtp->addSession( $sub, 'option' );
|
$vtp->addSession( $sub, 'option' );
|
||||||
|
|
|
@ -29,7 +29,7 @@ foreach ( $categories as $category ) {
|
||||||
if ( $category == 'images' )
|
if ( $category == 'images' )
|
||||||
{
|
{
|
||||||
$vtp->addSession( $sub, 'illustration' );
|
$vtp->addSession( $sub, 'illustration' );
|
||||||
$vtp->setVar( $sub, 'illustration.pic_src', './images/admin.png' );
|
$vtp->setVar( $sub, 'illustration.pic_src', './admin/images/admin.png' );
|
||||||
$vtp->setVar( $sub, 'illustration.pic_alt', '' );
|
$vtp->setVar( $sub, 'illustration.pic_alt', '' );
|
||||||
$vtp->setVar( $sub, 'illustration.caption', $lang['help_images_intro'] );
|
$vtp->setVar( $sub, 'illustration.caption', $lang['help_images_intro'] );
|
||||||
$vtp->closeSession( $sub, 'illustration' );
|
$vtp->closeSession( $sub, 'illustration' );
|
||||||
|
|
|
@ -272,10 +272,6 @@ if ( isset( $page['cat'] ) )
|
||||||
get_complete_dir( $row['storage_category_id'] );
|
get_complete_dir( $row['storage_category_id'] );
|
||||||
}
|
}
|
||||||
$thumbnail_url = $array_cat_directories[$row['storage_category_id']];
|
$thumbnail_url = $array_cat_directories[$row['storage_category_id']];
|
||||||
if ( preg_match( '/^\.\/galleries/', $thumbnail_url ) )
|
|
||||||
{
|
|
||||||
$thumbnail_url = '.'.$thumbnail_url;
|
|
||||||
}
|
|
||||||
$thumbnail_url.= 'thumbnail/';
|
$thumbnail_url.= 'thumbnail/';
|
||||||
$thumbnail_url.= $conf['prefix_thumbnail'].$file.".".$row['tn_ext'];
|
$thumbnail_url.= $conf['prefix_thumbnail'].$file.".".$row['tn_ext'];
|
||||||
$vtp->setVar( $sub, 'picture.thumbnail_url', $thumbnail_url );
|
$vtp->setVar( $sub, 'picture.thumbnail_url', $thumbnail_url );
|
||||||
|
|
|
@ -421,7 +421,7 @@ if ( isset( $_GET['dir'] ) )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$vtp->addSession( $sub, 'directory_list' );
|
$vtp->addSession( $sub, 'directory_list' );
|
||||||
get_displayed_dirs( '../galleries', 60 );
|
get_displayed_dirs( './galleries', 60 );
|
||||||
$vtp->closeSession( $sub, 'directory_list' );
|
$vtp->closeSession( $sub, 'directory_list' );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------- sending html code
|
//----------------------------------------------------------- sending html code
|
||||||
|
|
|
@ -22,12 +22,12 @@ include_once( './admin/include/isadmin.inc.php' );
|
||||||
function insert_local_category( $cat_id )
|
function insert_local_category( $cat_id )
|
||||||
{
|
{
|
||||||
global $conf, $page, $user, $lang;
|
global $conf, $page, $user, $lang;
|
||||||
|
|
||||||
$site_id = 1;
|
$site_id = 1;
|
||||||
|
|
||||||
// 0. retrieving informations on the category to display
|
// 0. retrieving informations on the category to display
|
||||||
$cat_directory = '../galleries';
|
$cat_directory = './galleries';
|
||||||
|
|
||||||
if ( is_numeric( $cat_id ) )
|
if ( is_numeric( $cat_id ) )
|
||||||
{
|
{
|
||||||
$cat_directory.= '/'.get_local_dir( $cat_id );
|
$cat_directory.= '/'.get_local_dir( $cat_id );
|
||||||
|
@ -64,7 +64,7 @@ function insert_local_category( $cat_id )
|
||||||
while ( $row = mysql_fetch_array( $result ) )
|
while ( $row = mysql_fetch_array( $result ) )
|
||||||
{
|
{
|
||||||
// retrieving the directory
|
// retrieving the directory
|
||||||
$rep = '../galleries/'.get_local_dir( $row['id'] );
|
$rep = './galleries/'.get_local_dir( $row['id'] );
|
||||||
// is the directory present ?
|
// is the directory present ?
|
||||||
if ( !is_dir( $rep ) ) delete_category( $row['id'] );
|
if ( !is_dir( $rep ) ) delete_category( $row['id'] );
|
||||||
}
|
}
|
||||||
|
@ -588,7 +588,7 @@ if ( !isset( $_GET['update'] )
|
||||||
$vtp->setVar( $sub, 'introduction.all:url', $url );
|
$vtp->setVar( $sub, 'introduction.all:url', $url );
|
||||||
$vtp->closeSession( $sub, 'introduction' );
|
$vtp->closeSession( $sub, 'introduction' );
|
||||||
}
|
}
|
||||||
//------------------------------------------------- local update : ../galleries
|
//-------------------------------------------------- local update : ./galleries
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$count_new = 0;
|
$count_new = 0;
|
||||||
|
|
|
@ -216,7 +216,7 @@ if ( $user['status'] == 'admin' )
|
||||||
{
|
{
|
||||||
$vtp->addSession( $handle, 'summary' );
|
$vtp->addSession( $handle, 'summary' );
|
||||||
$vtp->setVar( $handle, 'summary.url',
|
$vtp->setVar( $handle, 'summary.url',
|
||||||
add_session_id( './admin/admin.php' ) );
|
add_session_id( './admin.php' ) );
|
||||||
$vtp->setVar( $handle, 'summary.title', $lang['hint_admin'] );
|
$vtp->setVar( $handle, 'summary.title', $lang['hint_admin'] );
|
||||||
$vtp->setVar( $handle, 'summary.name', replace_space( $lang['admin'] ) );
|
$vtp->setVar( $handle, 'summary.name', replace_space( $lang['admin'] ) );
|
||||||
$vtp->closeSession( $handle, 'summary' );
|
$vtp->closeSession( $handle, 'summary' );
|
||||||
|
|
Loading…
Reference in a new issue