|
From: Florin C B. <ory...@us...> - 2011-08-09 04:32:21
|
Update of /cvsroot/mxbb/mx_smartor/admin
In directory vz-cvs-4.sog:/tmp/cvs-serv9394/admin
Modified Files:
admin_album_ext.php
Log Message:
added some admin extra config. params.
Index: admin_album_ext.php
===================================================================
RCS file: /cvsroot/mxbb/mx_smartor/admin/admin_album_ext.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** admin_album_ext.php 27 Mar 2008 14:30:54 -0000 1.5
--- admin_album_ext.php 9 Aug 2011 04:32:19 -0000 1.6
***************
*** 26,29 ****
--- 26,34 ----
require($module_root_path . 'album_mod/includes/album_constants.'.$phpEx);
+ //
+ // Begin program proper
+ //
+ $mode = '';
+
// **********************************************************************
***************
*** 42,47 ****
// Mode setting
//
! $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, '');
//
// Main db settings
--- 47,67 ----
// Mode setting
//
! //
! if ($mx_request_vars->is_post('submit') )
! {
! $mode = 'submit';
! }
! else
! {
! $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, '');
! }
+ /*
+ if ($mx_request_vars->is_empty_post('fullurl') || $mx_request_vars->is_empty_post('fullurl'))
+ {
+ mx_message_die(GENERAL_ERROR, "Failed to update fullurl.");
+ }
+ */
+
//
// Main db settings
***************
*** 49,53 ****
//
$sql = "SELECT *
! FROM " . ALBUM_CONFIG_TABLE;
if ( !$result = $db->sql_query( $sql ) )
{
--- 69,73 ----
//
$sql = "SELECT *
! FROM " . ALBUM_CONFIG_TABLE;
if ( !$result = $db->sql_query( $sql ) )
{
***************
*** 56,74 ****
else
{
! while ( $row = $db->sql_fetchrow( $result ) )
{
$config_name = $row['config_name'];
$config_value = $row['config_value'];
$default_config[$config_name] = $config_value;
!
! $new[$config_name] = ( isset( $_POST[$config_name] ) ) ? $_POST[$config_name] : $default_config[$config_name];
! if ( isset( $_POST['submit'] ) )
{
$sql = "UPDATE " . ALBUM_CONFIG_TABLE . " SET
! config_value = '" . str_replace( "\'", "''", $new[$config_name] ) . "'
! WHERE config_name = '$config_name'";
if ( !$db->sql_query( $sql ) )
{
! mx_message_die( GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql );
}
$mx_cache->put('album_config', $new);
--- 76,94 ----
else
{
! while ($row = $db->sql_fetchrow($result))
{
$config_name = $row['config_name'];
$config_value = $row['config_value'];
$default_config[$config_name] = $config_value;
!
! $new[$config_name] = ( isset($_POST[$config_name]) ) ? $_POST[$config_name] : $default_config[$config_name];
! if (isset($_POST['submit']))
{
$sql = "UPDATE " . ALBUM_CONFIG_TABLE . " SET
! config_value = '" . str_replace( "\'", "''", $new[$config_name] ) . "'
! WHERE config_name = '$config_name'";
if ( !$db->sql_query( $sql ) )
{
! mx_message_die( GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql );
}
$mx_cache->put('album_config', $new);
***************
*** 76,81 ****
}
$db->sql_freeresult($result);
!
! if ( isset( $_POST['submit'] ) )
{
$message = $lang['album_config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_album_config'], "<a href=\"" . mx_append_sid( "admin_album_ext.$phpEx" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . mx_append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . "\">", "</a>" );
--- 96,100 ----
}
$db->sql_freeresult($result);
! if (isset($_POST['submit']))
{
$message = $lang['album_config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_album_config'], "<a href=\"" . mx_append_sid( "admin_album_ext.$phpEx" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . mx_append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . "\">", "</a>" );
***************
*** 83,97 ****
}
}
!
//
// Populate parameter variables
//
$album_index = $new['index'];
!
// $other = $new['other'];
-
-
$override_default_pages = $new['override_default_pages'];
$integration_enabled = $new['enable_integration'];
//
--- 102,115 ----
}
}
!
//
// Populate parameter variables
//
$album_index = $new['index'];
! $album_fullurl = str_replace('http://www.', 'http://', $new['fullurl']);
// $other = $new['other'];
$override_default_pages = $new['override_default_pages'];
$integration_enabled = $new['enable_integration'];
+ $fullurl_enabled = $new['enable_fullurl'];
//
***************
*** 99,104 ****
//
$pagelist_index = get_list_formatted('page_list', $new['index'], 'index');
!
! // $pagelist_other = get_list_formatted('page_list', $new['other'], 'other');
//
--- 117,121 ----
//
$pagelist_index = get_list_formatted('page_list', $new['index'], 'index');
! // $pagelist_other = get_list_formatted('page_list', $new['other'], 'other');
//
***************
*** 108,112 ****
$template->assign_vars( array(
! 'S_ALBUM_ACTION' => mx_append_sid( "admin_album_ext.$phpEx" ),
'L_ALBUM_TITLE' => $lang['mx_album_admin'],
--- 125,129 ----
$template->assign_vars( array(
! 'S_ALBUM_ACTION' => mx_append_sid("admin_album_ext.$phpEx"),
'L_ALBUM_TITLE' => $lang['mx_album_admin'],
***************
*** 127,134 ****
'L_ALBUM_INTEGRATION_ENABLED_YES' => $lang['integration_enabled_yes'],
'L_ALBUM_INTEGRATION_ENABLED_NO' => $lang['integration_enabled_no'],
! 'ALBUM_INTEGRATION_ENABLED_YES' => ( $integration_enabled == '1' ) ? ' checked="checked"' : '',
! 'ALBUM_INTEGRATION_ENABLED_NO' => ( $integration_enabled == '0' ) ? ' checked="checked"' : '',
!
//
// Default static settings or block settings
--- 144,157 ----
'L_ALBUM_INTEGRATION_ENABLED_YES' => $lang['integration_enabled_yes'],
'L_ALBUM_INTEGRATION_ENABLED_NO' => $lang['integration_enabled_no'],
+
+ 'L_ALBUM_FULLURL_ENABLED_YES' => $lang['fullurl_enabled_yes'],
+ 'L_ALBUM_FULLURL_ENABLED_NO' => $lang['fullurl_enabled_no'],
! 'ALBUM_INTEGRATION_ENABLED_YES' => ($integration_enabled == '1') ? ' checked="checked"' : '',
! 'ALBUM_INTEGRATION_ENABLED_NO' => ($integration_enabled == '0') ? ' checked="checked"' : '',
!
! 'ALBUM_FULLURL_ENABLED_YES' => ($fullurl_enabled == '1') ? ' checked="checked"' : '',
! 'ALBUM_FULLURL_ENABLED_NO' => ($fullurl_enabled == '0') ? ' checked="checked"' : '',
!
//
// Default static settings or block settings
***************
*** 143,152 ****
'OVERRIDE_DEFAULT_PAGES_CHECKBOX_NO' => ( $override_default_pages == '0' ) ? ' checked="checked"' : '',
-
'L_ALBUM_INDEX' => $lang['index'],
'ALBUM_INDEX' => $pagelist_index,
!
! // 'L_SUBMIT' => $lang['submit'],
! // 'L_RESET' => $lang['reset'],
'L_SUBMIT' => $lang['Submit'],
--- 166,174 ----
'OVERRIDE_DEFAULT_PAGES_CHECKBOX_NO' => ( $override_default_pages == '0' ) ? ' checked="checked"' : '',
'L_ALBUM_INDEX' => $lang['index'],
'ALBUM_INDEX' => $pagelist_index,
!
! 'L_FULLURL_INDEX' => $lang['fullurl'],
! 'ALBUM_FULLURL' => $album_fullurl,
'L_SUBMIT' => $lang['Submit'],
***************
*** 155,160 ****
));
! $template->pparse( "body" );
! include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx );
?>
--- 177,182 ----
));
! $template->pparse("body");
! include_once($mx_root_path . 'admin/page_footer_admin.' . $phpEx);
?>
|