Xaraya / Postnuke CVS Notices - Message

Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites

View Statistics - Next Notice - Previous Notice

Directory filter : [ all ] / postnuke_official / html / modules / categories [ view in CVS ]

Date Directory [filter] File(s) [view] Author [filter]
27 Jul 2002 23:47:39postnuke_official/html/modules/categoriespnvisualapi.php,1.2,1.3Mike
 re-add image drop-down list

Update of /home/cvsroot/postnuke_official/html/modules/categories
In directory ns7.hostnuke.net:/tmp/cvs-serv26124

Modified Files:
	pnvisualapi.php 
Log Message:
re-add image drop-down list


Index: pnvisualapi.php
===================================================================
RCS file: /home/cvsroot/postnuke_official/html/modules/categories/pnvisualapi.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pnvisualapi.php	27 Jul 2002 19:06:07 -0000	1.2
--- pnvisualapi.php	27 Jul 2002 23:47:37 -0000	1.3
***************
*** 30,33 ****
--- 30,50 ----
  
  
+ function categories_visualapi_findimages()
+ {
+     $curdir = dirname(__FILE__);
+     $curdir .= '/../../images/categories';
+     $curdir = realpath($curdir);
+     $image_array = array();
+     //$image_array[] = '';
+     if ($dir = @opendir($curdir)) {
+         while(($file = @readdir($dir)) !== false) {
+             if (preg_match('/\.(png|gif|jpg|jpeg)$/',$file)) {
+                 $image_array[] = $file;
+             }
+         }
+     }
+     return $image_array;
+ }
+ 
  /**
   * Visual Menu to add a new category
***************
*** 91,95 ****
      $output->SetOutputMode(_PNH_RETURNOUTPUT);
      $row[] = $output->Text(pnVarPrepForDisplay(_CATEGORIESIMAGE));
!     $row[] = $output->FormText('image', '', 64, 255);
      $output->SetOutputMode(_PNH_KEEPOUTPUT);
      $output->SetInputMode(_PNH_VERBATIMINPUT);
--- 108,121 ----
      $output->SetOutputMode(_PNH_RETURNOUTPUT);
      $row[] = $output->Text(pnVarPrepForDisplay(_CATEGORIESIMAGE));
!     //$row[] = $output->FormText('image', '', 64, 255);
! // TODO: add possibility of putting images elsewhere
!     $image_array = categories_visualapi_findimages();
!     $select = '<select name="image" id="image">';
!     $select .= '<option>';
!     foreach ($image_array as $image) {
!         $select .= '<option>images/categories/' . $image;
!     }
!     $select .= '</select>';
!     $row[] = $select;
      $output->SetOutputMode(_PNH_KEEPOUTPUT);
      $output->SetInputMode(_PNH_VERBATIMINPUT);
***************
*** 407,414 ****
      $output->SetOutputMode(_PNH_RETURNOUTPUT);
      $row[] = $output->Text(pnVarPrepForDisplay(_CATEGORIESIMAGE));
!     $row[] = $output->FormText('image',
!                                pnVarPrepForDisplay($cat['image']),
!                                64,
!                                255);
      $output->SetOutputMode(_PNH_KEEPOUTPUT);
      $output->SetInputMode(_PNH_VERBATIMINPUT);
--- 433,457 ----
      $output->SetOutputMode(_PNH_RETURNOUTPUT);
      $row[] = $output->Text(pnVarPrepForDisplay(_CATEGORIESIMAGE));
!     //$row[] = $output->FormText('image',
!     //                           pnVarPrepForDisplay($cat['image']),
!     //                           64,
!     //                           255);
!     $image_array = categories_visualapi_findimages();
!     $select = '<select name="image" id="image">';
!     $select .= '<option>';
!     $seen = 0;
!     foreach ($image_array as $image) {
!         if ($cat['image'] == "images/categories/$image") {
!             $select .= '<option selected>images/categories/' . pnVarPrepHTMLDisplay($image);
!             $seen = 1;
!         } else {
!             $select .= '<option>images/categories/' . $image;
!         }
!     }
!     if (!$seen && !empty($cat['image'])) {
!         $select .= '<option selected>' . pnVarPrepHTMLDisplay($cat['image']);
!     }
!     $select .= '</select>';
!     $row[] = $select;
      $output->SetOutputMode(_PNH_KEEPOUTPUT);
      $output->SetInputMode(_PNH_VERBATIMINPUT);
***************
*** 534,538 ****
          // Image
          $this_row = Array();
!         $this_row['content'] = pnVarPrepHTMLDisplay($category['image']);
          $row[] = $this_row;
  
--- 577,586 ----
          // Image
          $this_row = Array();
!         //$this_row['content'] = pnVarPrepHTMLDisplay($category['image']);
!         if (isset($category['image']) && !empty($category['image'])) {
!             $this_row['content'] = '<img src="' . pnVarPrepHTMLDisplay($category['image']) . '" width=40 />';
!         } else {
!             $this_row['content'] = '&nbsp;';
!         }
          $row[] = $this_row;
  


Directory filter : [ all ] / postnuke_official / html / modules / categories [ view in CVS ]

View Statistics - Next Notice - Previous Notice


Visit Developer Site - Browse CVS Repository Syndicate via backend.rss
(max. once per hour please)
Powered by CVSNotice 0.1.3