Changeset 9270


Ignore:
Timestamp:
02/17/11 18:35:25 (9 years ago)
Author:
patdenice
Message:

Additional pages can now be standalone

Location:
extensions/AdditionalPages
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdditionalPages/additional_page.php

    r9263 r9270  
    1414 
    1515// Récupération des données de la page 
    16 $query = 'SELECT id, title , content, users, groups, permalink 
     16$query = 'SELECT id, title , content, users, groups, permalink, standalone 
    1717FROM ' . ADD_PAGES_TABLE . ' 
    1818'; 
     
    3939  'title' => trigger_event('AP_render_content', $row['title']), 
    4040  'content' => trigger_event('AP_render_content', $row['content']), 
     41  'standalone' => ($row['standalone'] == 'true') 
    4142); 
    4243 
     
    6465        page_forbidden(l10n('You are not authorized to access the requested page')); 
    6566  } 
     67} 
     68 
     69if ($page['additional_page']['standalone']) 
     70{ 
     71  echo $page['additional_page']['content']; 
     72  exit; 
    6673} 
    6774 
  • extensions/AdditionalPages/admin/add_page.inc.php

    r9264 r9270  
    4848  $group_access = !empty($_POST['groups']) ? '"'.implode(',', $_POST['groups']).'"' : 'NULL'; 
    4949  $user_access = !empty($_POST['users']) ? '"'.implode(',', $_POST['users']).'"' : 'NULL'; 
     50  $standalone = isset($_POST['standalone']) ? '"true"' : '"false"'; 
    5051 
    5152  if (empty($page['errors'])) 
     
    6061  users = '.$user_access.', 
    6162  groups = '.$group_access.', 
    62   permalink = '.$permalink.' 
     63  permalink = '.$permalink.', 
     64  standalone = '.$standalone.' 
    6365WHERE id = '.$edited_page['id'] .' 
    6466;'; 
     
    7173       
    7274      $query = ' 
    73 INSERT INTO ' . ADD_PAGES_TABLE . ' ( pos , lang , title , content , users , groups , permalink) 
    74 VALUES ('.($position+1).' , '.$language.' , "'.$_POST['title'].'" , "'.$_POST['ap_content'].'" , '.$user_access.' , '.$group_access.' , '.$permalink.');'; 
     75INSERT INTO ' . ADD_PAGES_TABLE . ' ( pos , lang , title , content , users , groups , permalink, standalone) 
     76VALUES ('.($position+1).' , '.$language.' , "'.$_POST['title'].'" , "'.$_POST['ap_content'].'" , '.$user_access.' , '.$group_access.' , '.$permalink.' , '.$standalone.');'; 
    7577      pwg_query($query); 
    7678      $edited_page['id'] = mysql_insert_id(); 
     
    108110  $edited_page['users'] = !empty($_POST['users']) ? trim($user_access, '"') :  ''; 
    109111  $edited_page['homepage'] = isset($_POST['homepage']); 
     112  $edited_page['standalone'] = isset($_POST['standalone']); 
    110113} 
    111114 
     
    154157    'PERMALINK' => $edited_page['permalink'], 
    155158    'HOMEPAGE' => $edited_page['homepage'], 
     159    'STANDALONE' => $edited_page['standalone'], 
    156160    'CONTENT' => $edited_page['content'])); 
    157161} 
  • extensions/AdditionalPages/admin/admin.php

    r9262 r9270  
    3535if ($page['tab'] == 'edit_page') 
    3636{ 
    37   $tabsheet->add('edit_page', l10n('ap_edit_page'), $my_base_url.'&tab=edit_page'); 
     37  $tabsheet->add('edit_page', l10n('ap_edit_page'), $my_base_url.'&tab=edit_page&edit='.$_GET['edit']); 
    3838} 
    3939$tabsheet->select($page['tab']); 
  • extensions/AdditionalPages/admin/edit_page.inc.php

    r9264 r9270  
    2121} 
    2222 
    23 $q = 'SELECT id , lang , title , content , users , groups , permalink 
     23$q = 'SELECT id , lang , title , content , users , groups , permalink, standalone 
    2424FROM ' . ADD_PAGES_TABLE . ' 
    2525WHERE id = '.$_GET['edit'].';'; 
     
    2828$page_title = l10n('ap_modify'); 
    2929$edited_page['homepage'] = $conf['additional_pages']['homepage'] == $edited_page['id']; 
     30$edited_page['standalone'] = ($edited_page['standalone'] == 'true'); 
    3031 
    3132// Lien de suppression 
  • extensions/AdditionalPages/admin/template/add_page.tpl

    r9261 r9270  
    3535                        </td> 
    3636                </tr> 
     37    <tr><td>&nbsp;</td></tr> 
    3738                <tr> 
    3839                        <td align="right">{'ap_set_as_homepage'|@translate} &nbsp;&nbsp;</td> 
    39                         <td><input type="checkbox" name="homepage" {if isset($HOMEPAGE) and $HOMEPAGE}checked="checked"{/if}"/></td> 
     40                        <td><input type="checkbox" name="homepage" {if isset($HOMEPAGE) and $HOMEPAGE}checked="checked"{/if}"/> 
     41      &nbsp; <i>{'ap_homepage_tip'|@translate}</i></td> 
     42                </tr> 
     43                <tr> 
     44                        <td align="right">{'ap_standalone_page'|@translate} &nbsp;&nbsp;</td> 
     45                        <td><input type="checkbox" name="standalone" {if isset($STANDALONE) and $STANDALONE}checked="checked"{/if}"/> 
     46      &nbsp; <i>{'ap_standalone_tip'|@translate}</i></td> 
    4047                </tr> 
    4148 
  • extensions/AdditionalPages/admin/upgrade_from_21.php

    r9262 r9270  
    1212ADD `users` VARCHAR( 255 ) NULL DEFAULT NULL , 
    1313ADD `groups` VARCHAR( 255 ) NULL DEFAULT NULL , 
    14 ADD `permalink` VARCHAR( 64 ) NULL DEFAULT NULL;'; 
     14ADD `permalink` VARCHAR( 64 ) NULL DEFAULT NULL , 
     15ADD `standalone` ENUM( "true", "false" ) NOT NULL DEFAULT "false";'; 
    1516pwg_query($query); 
    1617 
  • extensions/AdditionalPages/language/cs_CZ/plugin.lang.php

    r9261 r9270  
    4141/*TODO*/$lang['ap_edit_page'] = 'Edit a page'; 
    4242/*TODO*/$lang['ap_set_as_homepage'] = 'Set as Homepage'; 
     43/*TODO*/$lang['ap_standalone_page'] = 'Standalone Page'; 
     44/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
     45/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/language/de_DE/plugin.lang.php

    r9261 r9270  
    4141/*TODO*/$lang['ap_edit_page'] = 'Edit a page'; 
    4242/*TODO*/$lang['ap_set_as_homepage'] = 'Set as Homepage'; 
     43/*TODO*/$lang['ap_standalone_page'] = 'Standalone Page'; 
     44/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
     45/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/language/en_UK/plugin.lang.php

    r9261 r9270  
    4141$lang['ap_edit_page'] = 'Edit a page'; 
    4242$lang['ap_set_as_homepage'] = 'Set as Homepage'; 
     43$lang['ap_standalone_page'] = 'Standalone Page'; 
     44$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
     45$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/language/es_ES/plugin.lang.php

    r9261 r9270  
    4141/*TODO*/$lang['ap_edit_page'] = 'Edit a page'; 
    4242/*TODO*/$lang['ap_set_as_homepage'] = 'Set as Homepage'; 
     43/*TODO*/$lang['ap_standalone_page'] = 'Standalone Page'; 
     44/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
     45/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/language/fr_FR/plugin.lang.php

    r9261 r9270  
    4141$lang['ap_edit_page'] = 'Editer une page'; 
    4242$lang['ap_set_as_homepage'] = 'Définir comme page d\'accueil'; 
     43$lang['ap_standalone_page'] = 'Page autonome'; 
     44$lang['ap_homepage_tip'] = 'Remplace la page d\'accueil de votre galerie'; 
     45$lang['ap_standalone_tip'] = 'La page requiert une structure HTML complète'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/language/hu_HU/plugin.lang.php

    r9261 r9270  
    4141/*TODO*/$lang['ap_edit_page'] = 'Edit a page'; 
    4242/*TODO*/$lang['ap_set_as_homepage'] = 'Set as Homepage'; 
     43/*TODO*/$lang['ap_standalone_page'] = 'Standalone Page'; 
     44/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
     45/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/language/it_IT/plugin.lang.php

    r9261 r9270  
    4141/*TODO*/$lang['ap_edit_page'] = 'Edit a page'; 
    4242/*TODO*/$lang['ap_set_as_homepage'] = 'Set as Homepage'; 
     43/*TODO*/$lang['ap_standalone_page'] = 'Standalone Page'; 
     44/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
     45/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/language/lv_LV/plugin.lang.php

    r9261 r9270  
    4141/*TODO*/$lang['ap_edit_page'] = 'Edit a page'; 
    4242/*TODO*/$lang['ap_set_as_homepage'] = 'Set as Homepage'; 
     43/*TODO*/$lang['ap_standalone_page'] = 'Standalone Page'; 
     44/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
     45/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/language/pl_PL/plugin.lang.php

    r9261 r9270  
    4141/*TODO*/$lang['ap_edit_page'] = 'Edit a page'; 
    4242/*TODO*/$lang['ap_set_as_homepage'] = 'Set as Homepage'; 
     43/*TODO*/$lang['ap_standalone_page'] = 'Standalone Page'; 
     44/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
     45/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/language/ru_RU/plugin.lang.php

    r9261 r9270  
    4141/*TODO*/$lang['ap_edit_page'] = 'Edit a page'; 
    4242/*TODO*/$lang['ap_set_as_homepage'] = 'Set as Homepage'; 
     43/*TODO*/$lang['ap_standalone_page'] = 'Standalone Page'; 
     44/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
     45/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/language/sk_SK/plugin.lang.php

    r9261 r9270  
    4141/*TODO*/$lang['ap_edit_page'] = 'Edit a page'; 
    4242/*TODO*/$lang['ap_set_as_homepage'] = 'Set as Homepage'; 
     43/*TODO*/$lang['ap_standalone_page'] = 'Standalone Page'; 
     44/*TODO*/$lang['ap_homepage_tip'] = 'Replace your gallery\'s homepage'; 
     45/*TODO*/$lang['ap_standalone_tip'] = 'Page require full HTML structure'; 
    4346 
    4447?> 
  • extensions/AdditionalPages/maintain.inc.php

    r9263 r9270  
    1818groups VARCHAR( 255 ) NULL DEFAULT NULL , 
    1919permalink VARCHAR( 64 ) NULL DEFAULT NULL , 
     20standalone ENUM( "true", "false" ) NOT NULL DEFAULT "false" 
    2021PRIMARY KEY (id) , 
    2122INDEX (pos) , 
Note: See TracChangeset for help on using the changeset viewer.