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 Aug 2002 21:14:42postnuke_official/html/modules/categoriespnvisualapi.php,1.6,1.7Mike
 start templating pnvisualapi & fix some pnSecAuthAction

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

Modified Files:
	pnvisualapi.php 
Log Message:
start templating pnvisualapi & fix some pnSecAuthAction


Index: pnvisualapi.php
===================================================================
RCS file: /home/cvsroot/postnuke_official/html/modules/categories/pnvisualapi.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** pnvisualapi.php	11 Aug 2002 00:46:48 -0000	1.6
--- pnvisualapi.php	27 Aug 2002 21:14:40 -0000	1.7
***************
*** 29,33 ****
  // ----------------------------------------------------------------------
  
! 
  function categories_visualapi_findimages()
  {
--- 29,35 ----
  // ----------------------------------------------------------------------
  
! /**
!  * Get a list of images from images/categories (relative to PN html dir !)
!  */
  function categories_visualapi_findimages()
  {
***************
*** 69,73 ****
      // Needs to be properly worked out
      // Security check
!     if (!pnSecAuthAction(0, 'categories::category', "ID::$cid", ACCESS_ADD)) {
          $output->Text(_CATEGORIESNOAUTH);
          return $output->GetOutput();
--- 71,75 ----
      // Needs to be properly worked out
      // Security check
!     if (!pnSecAuthAction(0, 'categories::category', "::$cid", ACCESS_ADD)) {
          $output->Text(_CATEGORIESNOAUTH);
          return $output->GetOutput();
***************
*** 174,186 ****
  function categories_visualapi_makeselect ($args)
  {
- // Old Stuff
- /* 
-     if (!isset($args['return_var'])) 
-     {
-         $args['return_var'] = 'categoryid';
-     }
- // Old way
- //    $select = "<select name='$args[return_var]".(($args[multiple] == 1)?"[]' multiple":'').">";
- */    
      $tree_array = categories_visualapi_treearray ($args);
  
--- 176,179 ----
***************
*** 189,194 ****
      }
  
- //    if (count($tree_array) > 0) {
- // New way -> Makes cids[] Array
      $select = "<select name='cids[]'".(($args['multiple'] == 1)?" multiple":'').">";
      $already_passed = false;
--- 182,185 ----
***************
*** 207,216 ****
      }
      $select .= "</select>";
- //    } else {
- //        $select = _ARTICLENOCAT . "<input hidden='$args[return_var]' value=0>";
- //    }
      
      return $select;
- 
  }
  
--- 198,203 ----
***************
*** 488,493 ****
  
      if (!isset($return_url)) {
!         $output->Text(_NOURLTORETURN);
!         return $output->GetOutput();
      }
  
--- 475,479 ----
  
      if (!isset($return_url)) {
!         return _NOURLTORETURN;
      }
  
***************
*** 507,511 ****
  
      // Security check
!     if (!pnSecAuthAction(0, 'categories::category', "ID::$cid", ACCESS_EDIT)) {
          $output->Text(_CATEGORIESNOAUTH);
          return $output->GetOutput();
--- 493,497 ----
  
      // Security check
!     if (!pnSecAuthAction(0, 'categories::category', "::$cid", ACCESS_EDIT)) {
          $output->Text(_CATEGORIESNOAUTH);
          return $output->GetOutput();
***************
*** 635,648 ****
      }
  
!     // Create output object
!     $output = new pnHTML();
  
      // Title
!     $output->Title(_CATEGORIESVIEW);
  
      // Load user API to obtain item information function
      if (!pnModAPILoad('categories', 'user')) {
!         $output->Text(_LOADFAILED);
!         return $output->GetOutput();
      }
  
--- 621,633 ----
      }
  
!     $data = array();
  
      // Title
!     $data['title'] = _CATEGORIESVIEW;
  
      // Load user API to obtain item information function
      if (!pnModAPILoad('categories', 'user')) {
!         $data['message'] = _LOADFAILED;
!         return pnModTemplate('categories','visual','viewcats',$data);
      }
  
***************
*** 663,681 ****
  
      if (!is_array($categories)) {
!         $output->Text(_CATEGORIESGETFAILED);
!         return $output->GetOutput();
      }
  
      // Start output table
!     $output->TableStart('',
!                         array(_CATEGORYINDENTATION,
!                               _CATEGORIESNAME,
!                               _CATEGORIESDESCRIPTION,
!                               _CATEGORIESIMAGE,
!                               _CATEGORIESOPTIONS),
!                         3);
  
      $last_indentation = 0;
  
      foreach ($categories as $category) {
  
--- 648,668 ----
  
      if (!is_array($categories)) {
!         $data['message'] = _CATEGORIESGETFAILED;
!         return pnModTemplate('categories','visual','viewcats',$data);
      }
+     $data['message'] = '';
  
      // Start output table
!     $data['theaders'] = array(
!                             array('tname' => _CATEGORYINDENTATION),
!                             array('tname' => _CATEGORIESNAME),
!                             array('tname' => _CATEGORIESDESCRIPTION),
!                             array('tname' => _CATEGORIESIMAGE),
!                             array('tname' => _CATEGORIESOPTIONS),
!                         );
  
      $last_indentation = 0;
  
+     $data['trows'] = array();
      foreach ($categories as $category) {
  
***************
*** 695,712 ****
  
          // Indentation
!         $this_row = Array();
!         $this_row['content'] = $indentation_output;
!         $this_row['align'] = 'left';
!         $row[] = $this_row;
  
          // Name
!         $this_row = Array();
!         $this_row['content'] = pnVarPrepHTMLDisplay($category['name']);
!         $row[] = $this_row;
  
          // Description
!         $this_row = Array();
!         $this_row['content'] = pnVarPrepHTMLDisplay($category['description']);
!         $row[] = $this_row;
          
          // Image
--- 682,693 ----
  
          // Indentation
!         $row[] = array('content' => $indentation_output,
!                        'align'   => 'left');
  
          // Name
!         $row[] = array('content' => pnVarPrepHTMLDisplay($category['name']));
  
          // Description
!         $row[] = array('content' => pnVarPrepHTMLDisplay($category['description']));
          
          // Image
***************
*** 722,727 ****
          // Options
          $options = array();
!         $output->SetOutputMode(_PNH_RETURNOUTPUT);
!         if (pnSecAuthAction(0, 'categories::category', "ID::$category[cid]", ACCESS_EDIT)) {
              if ($cid) {
                  $temp_array = Array ('cid' => $category['cid'],
--- 703,707 ----
          // Options
          $options = array();
!         if (pnSecAuthAction(0, 'categories::category', "::$category[cid]", ACCESS_EDIT)) {
              if ($cid) {
                  $temp_array = Array ('cid' => $category['cid'],
***************
*** 732,759 ****
                  $temp_array = Array ('cid' => $category['cid']);
              }
!             $options[] = $output->URL(pnModURL(pnModGetName(),
!                                                'admin',
!                                                'modifycat',
!                                                $temp_array),
!                                       _EDIT);
!             if (pnSecAuthAction(0, 'categories::category', "ID::$category[cid]", ACCESS_DELETE)) {
!                 $options[] = $output->URL(pnModURL(pnModGetName(),
!                                                    'admin',
!                                                    'deletecat',
!                                                    $temp_array),
!                                           _DELETE);
              }
          }
  
!         $options = join(' | ', $options);
!         $output->SetInputMode(_PNH_VERBATIMINPUT);
!         $this_row = Array();
!         $this_row['content'] = $output->Text($options);
!         $row[] = $this_row;
!         $output->SetOutputMode(_PNH_KEEPOUTPUT);
!         $output->TableAddRow($row, 'left');
!         $output->SetInputMode(_PNH_PARSEINPUT);
      }
!     $output->TableEnd();
  
      $output->Pager($pagerstart,
--- 712,739 ----
                  $temp_array = Array ('cid' => $category['cid']);
              }
!             $options[] = array('olink'  => pnModURL(pnModGetName(),
!                                                     'admin',
!                                                     'modifycat',
!                                                     $temp_array),
!                                'otitle' => _EDIT,
!                                'ojoin'  => '');
!             if (pnSecAuthAction(0, 'categories::category', "::$category[cid]", ACCESS_DELETE)) {
!                 $options[] = array('olink'  => pnModURL(pnModGetName(),
!                                                         'admin',
!                                                         'deletecat',
!                                                         $temp_array),
!                                    'otitle' => _DELETE,
!                                    'ojoin'  => ' | ');
              }
          }
+         $row[] = array('content' => $options);
  
!         $data['trows'][] = array('tcolumns' => $row);
      }
! 
! // TODO: replace with BL pager widget
! 
!     // Create output object
!     $output = new pnHTML();
  
      $output->Pager($pagerstart,
***************
*** 765,774 ****
                                    'pagertotal' => $pagertotal)),
                     10);
  
!     return $output->GetOutput();
  }
  
  
- 
  /**
   * Main administration menu
--- 745,754 ----
                                    'pagertotal' => $pagertotal)),
                     10);
+     $data['pager'] = $output->GetOutput();
  
!     return pnModTemplate('categories','visual','viewcats',$data);
  }
  
  
  /**
   * Main administration menu
***************
*** 778,812 ****
  function categories_visualapi_adminmenu()
  {
!     // Create output object
!     $output = new pnHTML();
  
      // Display status message if any
!     $output->Text(pnGetStatusMsg());
!     $output->Linebreak(2);
  
      // Start options menu
!     $output->TableStart(_CATEGORIES);
  
      // Menu options
!     $columns = array();
!     $output->SetOutputMode(_PNH_RETURNOUTPUT);
!     $columns[] = $output->URL(pnModURL('categories',
!                                         'admin',
!                                         'newcat'),
!                               _CATEGORIESNEW); 
!     $columns[] = $output->URL(pnModURL('categories',
!                                         'admin',
!                                         'viewcats'),
!                               _CATEGORIESVIEW); 
!     $output->SetOutputMode(_PNH_KEEPOUTPUT);
! 
!     $output->SetInputMode(_PNH_VERBATIMINPUT);
!     $output->TableAddRow($columns);
!     $output->SetInputMode(_PNH_PARSEINPUT);
! 
!     $output->TableEnd();
  
      // Return output
!     return $output->GetOutput();
  }
  ?>
--- 758,781 ----
  function categories_visualapi_adminmenu()
  {
!     $data = array();
  
      // Display status message if any
!     $data['status'] = pnGetStatusMsg();
  
      // Start options menu
!     $data['mheader'] = _CATEGORIES;
  
      // Menu options
!     $data['mcolumns'] = array();
!     $data['mcolumns'][] = array(
!                           'mlink'  => pnModURL('categories','admin','newcat'),
!                           'mtitle' => _CATEGORIESNEW);
!     $data['mcolumns'][] = array(
!                           'mlink'  => pnModURL('categories','admin','viewcats'),
!                           'mtitle' => _CATEGORIESVIEW);
  
      // Return output
!     return pnModTemplate('categories','visual','menu',$data);
  }
+ 
  ?>


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