fisheye
[ class tree: fisheye ] [ index: fisheye ] [ all elements ]

Source for file edit.php

Documentation is available at edit.php

  1. <?php
  2. /**
  3.  * @package fisheye
  4.  * @subpackage functions
  5.  */
  6.  
  7. /**
  8.  * required setup
  9.  */
  10. require_once'../kernel/setup_inc.php' );
  11.  
  12. require_onceFISHEYE_PKG_PATH.'FisheyeGallery.php');
  13. require_onceFISHEYE_PKG_PATH.'FisheyeImage.php');
  14.  
  15. global $gBitSystem;
  16.  
  17. include_onceFISHEYE_PKG_PATH.'gallery_lookup_inc.php' );
  18.  
  19. // Ensure the user has the permission to create new image galleries
  20. if$gContent->isValid() ){
  21.     $gContent->verifyUpdatePermission();
  22. }else{
  23.     $gContent->verifyCreatePermission();
  24. }
  25.  
  26. if$gBitUser->hasPermission'p_fisheye_change_thumb_size' ) ) {
  27.     $gBitSmarty->assign'thumbnailSizes'get_image_size_optionsNULL ));
  28. }
  29.  
  30. $gBitSmarty->assign'galleryPaginationTypes'$gContent::getAllLayouts() );
  31.  
  32. if!empty$_REQUEST['savegallery') ) {
  33.     if$_REQUEST['gallery_pagination'== 'auto_flow' {
  34.         $_REQUEST['rows_per_page'$_REQUEST['total_per_page'];
  35.         $_REQUEST['cols_per_page''1';
  36.     elseif $_REQUEST['gallery_pagination'== 'simple_list' {
  37.         $_REQUEST['rows_per_page'$_REQUEST['lines_per_page'];
  38.         $_REQUEST['cols_per_page''1';
  39.     elseif $_REQUEST['gallery_pagination'== 'matteo' {
  40.         $_REQUEST['rows_per_page'$_REQUEST['images_per_page'];
  41.         $_REQUEST['cols_per_page''1';
  42.     }
  43.     if$gContent->store$_REQUEST ) ) {
  44.         $gContent->storePreference'is_public'!empty$_REQUEST['is_public'$_REQUEST['is_public'NULL );
  45.         $gContent->storePreference'allow_comments'!empty$_REQUEST['allow_comments'$_REQUEST['allow_comments'NULL );
  46.         $gContent->storePreference'gallery_pagination'!empty$_REQUEST['gallery_pagination'$_REQUEST['gallery_pagination'NULL );
  47.         $gContent->storePreference'link_original_images'!empty$_REQUEST['link_original_images'$_REQUEST['link_original_images'NULL );
  48.         // make sure var is fully stuffed with current data
  49.         $gContent->load();
  50.         // set the mappings, or if nothing checked, nuke them all
  51.         $gContent->addToGalleries!empty$_REQUEST['gallery_additions'$_REQUEST['gallery_additions'NULL );
  52.  
  53.         if!empty$_REQUEST['generate_thumbnails') ) {
  54.             $gContent->generateThumbnails();
  55.         }
  56.         header("location: ".$gContent->getDisplayUrl() );
  57.         die();
  58.     }
  59. elseif!empty$_REQUEST['delete') ) {
  60.     $gContent->hasUserPermission'p_fisheye_admin'TRUEtra"You do not have permission to delete this image gallery" ) );
  61.  
  62.     if!empty$_REQUEST['cancel') ) {
  63.         // user cancelled - just continue on, doing nothing
  64.     elseifempty$_REQUEST['confirm') ) {
  65.         $formHash['delete'TRUE;
  66.         $formHash['gallery_id'$gContent->mGalleryId;
  67.         $formHash['input'array(
  68.             '<label><input name="recurse" value="" type="radio" checked="checked" /> '.tra'Delete only images in this gallery. Sub-galleries will not be removed.' ).'</label>',
  69.             '<label><input name="recurse" value="all" type="radio" /> '.tra'Permanently delete all contents, even if they appear in other galleries.' ).'</label>',
  70.         );
  71.         $gBitSystem->confirmDialog$formHash,
  72.             array(
  73.                 'warning' => tra('Are you sure you want to delete this gallery?'' ' $gContent->getTitle(),
  74.                 'error' => tra('This cannot be undone!'),
  75.             )
  76.         );
  77.     else {
  78.         $userId $gContent->getField'user_id' );
  79.  
  80.         $recurseDelete (!empty$_REQUEST['recurse'&& ($_REQUEST['recurse'== 'all') );
  81.  
  82.         if$gContent->expunge$recurseDelete ) ) {
  83.             header"Location: ".FISHEYE_PKG_URL.'?user_id='.$userId );
  84.         }
  85.     }
  86.  
  87. elseif!empty($_REQUEST['cancelgallery') ) {
  88.     header'Location: '.$gContent->getDisplayUrl() );
  89.     die();
  90. }
  91.  
  92. // Initalize the errors list which contains any errors which occured during storage
  93. $errors (!empty($gContent->mErrors$gContent->mErrors array());
  94. $gBitSmarty->assign_by_ref('errors'$errors);
  95.  
  96. $gBitSystem->setOnloadScript'updateGalleryPagination();' );
  97.  
  98. $gallery $gContent->getParentGalleries();
  99. $gBitSmarty->assign_by_ref'parentGalleries'$gallery );
  100. $getHash array(
  101.     'user_id'       => $gBitUser->mUserId,
  102. //    'max_records'   => -1,
  103. //    'no_thumbnails' => TRUE,
  104. //    'sort_mode'     => 'title_asc',
  105. //    'show_empty'    => TRUE,
  106. );
  107. if$gContent->mContentId {
  108.     $getHash['contain_item'$gContent->mContentId;
  109. }
  110. // modify listHash according to global preferences
  111. if$gBitSystem->isFeatureActive'fisheye_show_all_to_admins' && $gBitUser->hasPermission'p_fisheye_admin' ) ) {
  112.     unset$getHash['user_id');
  113. elseif$gBitSystem->isFeatureActive'fisheye_show_public_on_upload' ) ) {
  114. //    $getHash['show_public'] = TRUE;
  115. }
  116. $galleryTree $gContent->generateList$getHash,  array'name' => "gallery_id"'id' => "gallerylist"'item_attributes' => array'class'=>'listingtitle')'radio_checkbox' => TRUE) );
  117. $gBitSmarty->assign_by_ref'galleryTree'$galleryTree );
  118.  
  119. $gContent->invokeServices'content_edit_function' );
  120.  
  121. $gBitSystem->display'bitpackage:fisheye/edit_gallery.tpl'tra('Edit Gallery: ').$gContent->getTitle(array'display_mode' => 'edit' ));
  122.  
  123. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:25 +0000 by phpDocumentor 1.5.0-lsces