wcmf logo wemove logo

class.ListboxController.php

Go to the documentation of this file.
00001 <?php
00002 /**
00003  * wCMF - wemove Content Management Framework
00004  * Copyright (C) 2005-2009 wemove digital solutions GmbH
00005  *
00006  * Licensed under the terms of any of the following licenses 
00007  * at your choice:
00008  *
00009  * - GNU Lesser General Public License (LGPL)
00010  *   http://www.gnu.org/licenses/lgpl.html
00011  * - Eclipse Public License (EPL)
00012  *   http://www.eclipse.org/org/documents/epl-v10.php
00013  *
00014  * See the license.txt file distributed with this work for 
00015  * additional information.
00016  *
00017  * $Id: class.ListboxController.php 929 2009-02-22 23:20:49Z iherwig $
00018  */
00019 require_once(BASE."wcmf/lib/presentation/class.Controller.php");
00020 require_once(BASE."wcmf/lib/util/class.Obfuscator.php");
00021 
00022 /**
00023  * @class ListboxController
00024  * @ingroup Controller
00025  * @brief ListboxController is a controller that uses g_getOIDs to retrieve listbox data.
00026  * 
00027  * <b>Input actions:</b>
00028  * - unspecified: List Nodes of given type
00029  *
00030  * <b>Output actions:</b>
00031  * - @em ok In any case
00032  * 
00033  * @param[in] type The entity type to list
00034  * @param[in] filter A query passed to g_getOIDs
00035  * @param[out] totalCount The total number of all entities that match the criteria
00036  * @param[out] objects An associative array with keys 'key' and 'val'
00037  *
00038  * @author      ingo herwig <ingo@wemove.com>
00039  */
00040 class ListboxController extends Controller
00041 {
00042   /**
00043    * @see Controller::hasView()
00044    */
00045   function hasView()
00046   {
00047     return false;
00048   }
00049   /**
00050    * Do processing and assign Node data to View.
00051    * @return False in every case.
00052    * @see Controller::executeKernel()
00053    */
00054   function executeKernel()
00055   {
00056     // unveil the filter value if it is ofuscated
00057     $filter = $this->_request->getValue('filter');
00058     $unveiled = Obfuscator::unveil($filter);
00059     if (strlen($filter) > 0 && strlen($unveiled) > 0)
00060       $filter = $unveiled;
00061 
00062     $objects = g_getOIDs($this->_request->getValue('type'), $filter);
00063 
00064     $this->_response->setValue('totalCount', sizeof($objects));
00065     $responseObjects = array();
00066     foreach($objects as $key => $val)
00067       array_push($responseObjects, array('key' => $key, 'val' => $val));
00068     $this->_response->setValue('objects', $responseObjects);
00069     
00070     // success
00071     $this->_response->setAction('ok');
00072     return false;
00073   }
00074 }
00075 ?>

This page generated via doxygen 1.5.8 Mon Mar 30 01:58:34 2009.
Copyright © 2009 wemove digital solutions GmbH.
sourceforge logo