Logo Search packages:      
Sourcecode: gallery2 version File versions  Download package

AdminToolkitPriorityController::handleRequest ( form )
See also:
GalleryController::handleRequest

Definition at line 41 of file AdminToolkitPriority.inc.

References GalleryToolkitOperationMimeTypeMap::updateMapEntry().

                                  {
      global $gallery;

      $ret = GalleryCoreApi::assertUserIsSiteAdministrator();
      if ($ret->isError()) {
          return array($ret->wrap(__FILE__, __LINE__), null);
      }

      $status = array();
      if (isset($form['action']['save'])) {
          GalleryCoreApi::relativeRequireOnce(
            'modules/core/classes/GalleryToolkitOperationMimeTypeMap.class');
          list ($ret, $list) = GalleryCoreApi::getRedundantToolkitPriorities();
          if ($ret->isError()) {
            return array($ret->wrap(__FILE__, __LINE__), null);
          }
          foreach ($form['priority'] as $priority => $toolkit) {
            if ($priority != $list[$toolkit]) {
                $ret = GalleryToolkitOperationMimeTypeMap::updateMapEntry(
                  array('toolkitId' => $toolkit), array('priority' => $priority));
                if ($ret->isError()) {
                  return array($ret->wrap(__FILE__, __LINE__), null);
                }
            }
          }
          GalleryDataCache::removeByPattern('GalleryToolkitHelper::');
          $status['saved'] = 1;
      } /* else $form['action']['reset'] */

      $results['return'] = 0;
      $results['redirect']['view'] = 'core.SiteAdmin';
      $results['redirect']['subView'] = 'core.AdminToolkitPriority';
      $results['status'] = $status;
      $results['error'] = array();

      return array(GalleryStatus::success(), $results);
    }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index