Source for file addAjax.act.php

Documentation is available at addAjax.act.php

  1. <?php
  2. /**
  3. * @package polyphony.basket
  4. *
  5. * @copyright Copyright &copy; 2005, Middlebury College
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  7. *
  8. * @version $Id: addAjax.act.php,v 1.4 2007/09/19 14:04:54 adamfranco Exp $
  9. */
  10.  
  11. require_once(POLYPHONY."/main/library/AbstractActions/MainWindowAction.class.php");
  12. require_once(POLYPHONY."/main/library/Basket/Basket.class.php");
  13.  
  14. /**
  15. *
  16. *
  17. * @package polyphony.basket
  18. *
  19. * @copyright Copyright &copy; 2005, Middlebury College
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  21. *
  22. * @version $Id: addAjax.act.php,v 1.4 2007/09/19 14:04:54 adamfranco Exp $
  23. */
  24. class addAjaxAction
  25. extends Action
  26. {
  27. /**
  28. * Check Authorizations
  29. *
  30. * @return boolean
  31. * @access public
  32. * @since 4/26/05
  33. */
  34. function isAuthorizedToExecute () {
  35. // Check that the user can access this collection
  36. return TRUE;
  37. }
  38. /**
  39. * Return the heading text for this action, or an empty string.
  40. *
  41. * @return string
  42. * @access public
  43. * @since 4/26/05
  44. */
  45. function getHeadingText () {
  46. return _("Add an Item to Your Selection");
  47. }
  48. /**
  49. * Build the content for this action
  50. *
  51. * @return boolean
  52. * @access public
  53. * @since 4/26/05
  54. */
  55. function execute () {
  56. $harmoni = Harmoni::instance();
  57. $harmoni->request->startNamespace("basket");
  58. $idManager = Services::getService("Id");
  59. $authZ = Services::getService("AuthZ");
  60. $basket = Basket::instance();
  61. $viewAZ =$idManager->getId("edu.middlebury.authorization.view");
  62. $assetIdList = RequestContext::value("assets");
  63. $assetIdArray = explode(",", trim($assetIdList));
  64. foreach ($assetIdArray as $id) {
  65. $assetId =$idManager->getId($id);
  66. if ($authZ->isUserAuthorized(
  67. $viewAZ,
  68. $assetId))
  69. {
  70. $basket->addItem($assetId);
  71. }
  72. }
  73. $harmoni->request->endNamespace();
  74. print $basket->getSmallBasketHtml();
  75. exit;
  76. }
  77. }

Documentation generated on Wed, 19 Sep 2007 10:21:20 -0400 by phpDocumentor 1.3.0RC3