• Main Page
  • Modules
  • Classes
  • Files
  • File List

controllers/grid/settings/category/CategoryGridCategoryRow.inc.php

00001 <?php
00002 
00015 import('lib.pkp.classes.controllers.grid.GridCategoryRow');
00016 
00017 // Link actions
00018 import('lib.pkp.classes.linkAction.request.AjaxModal');
00019 
00020 class CategoryGridCategoryRow extends GridCategoryRow {
00024    function CategoryGridCategoryRow() {
00025       parent::GridCategoryRow();
00026    }
00027 
00028    //
00029    // Overridden methods from GridCategoryRow
00030    //
00035    function initialize(&$request) {
00036       // Do the default initialization
00037       parent::initialize($request);
00038 
00039       // Is this a new row or an existing row?
00040       $categoryId = $this->getId();
00041       if (!empty($categoryId) && is_numeric($categoryId)) {
00042          $category =& $this->getData();
00043 
00044          // Only add row actions if this is an existing row
00045          import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
00046          $router =& $request->getRouter();
00047          $this->addAction(
00048             new LinkAction(
00049                'deleteCategory',
00050                new RemoteActionConfirmationModal(
00051                   __('common.confirmDelete'),
00052                   __('common.delete'),
00053                   $router->url($request, null, null, 'deleteCategory', null, array('categoryId' => $categoryId)), 'modal_delete'
00054                ),
00055                null,
00056                'delete'
00057             ), GRID_ACTION_POSITION_ROW_LEFT
00058          );
00059 
00060          $this->addAction(new LinkAction(
00061             'editCategory',
00062             new AjaxModal(
00063                $router->url($request, null, null, 'editCategory', null, array('categoryId' => $categoryId)),
00064                __('grid.category.edit'),
00065                'modal_edit'
00066             ),
00067             $category->getLocalizedTitle()
00068          ), GRID_ACTION_POSITION_ROW_CLICK);
00069       }
00070    }
00071 
00076    function getCategoryLabel() {
00077       return '';
00078    }
00079 }
00080 
00081 ?>

Generated on Mon Sep 17 2012 13:58:56 for Open Monograph Press by  doxygen 1.7.1