Ejemplo n.º 1
0
 public function browseAction()
 {
     if ($this->getRequest()->isPost()) {
         $acceptCorrectionIds = $this->getParam('accept');
         $acceptCorrectionNpIds = $this->getParam('accept-np');
         $acceptCorrectionNpIds = array();
         //temp @todo
         foreach ($acceptCorrectionNpIds as $correctionId) {
             $correction = $this->getCorrection($correctionId);
             $frontPageId = $correction->fp_id;
             $frontPage = $this->_helper->db->getTable('NewspapersFrontPage')->find($frontPageId);
             //$newspaper = $this->_helper->db->getTable('NewspapersNewspaper')->find($correctionId);
             $this->_helper->db->getTable('NewspapersFrontPage')->findOthersInNewspaper($frontPage);
             //die();
             // $this->acceptNpCorrection($correction);
         }
         foreach ($acceptCorrectionIds as $correctionId) {
             $correction = $this->getCorrection($correctionId);
             $this->acceptCorrection($correction);
         }
         parent::browseAction();
     } else {
         parent::browseAction();
     }
 }
Ejemplo n.º 2
0
 public function addAction()
 {
     //require CORRECTIONS_DIR . '/forms/Correction.php';
     $this->view->addHelperPath(CORRECTIONS_DIR . '/helpers', 'Corrections_View_Helper_');
     $itemId = $this->getParam('item_id');
     $item = $this->_helper->db->getTable('Item')->find($itemId);
     $this->view->item = $item;
     $elements = $this->getElements();
     $this->view->elements = $elements;
     $user = current_user();
     if (!$user) {
         $captcha = Omeka_Captcha::getCaptcha();
         $this->captcha = $captcha;
         $this->view->captchaScript = $captcha->render(new Zend_View());
     }
     if ($this->getRequest()->isPost()) {
         if ($user || $this->captcha->isValid(null, $_POST)) {
             $this->_helper->flashMessenger(__("Thank you for the correction. It is under review."), 'success');
             parent::addAction();
         } else {
             $this->_helper->flashMessenger(__('Your CAPTCHA submission was invalid, please try again.'), 'error');
             $this->view->corrections_correction = new CorrectionsCorrection();
         }
     } else {
         parent::addAction();
     }
 }
 public function editAction()
 {
     $timeline = $this->_helper->db->findById();
     require_once NEATLINE_TIME_FORMS_DIR . '/timeline.php';
     $form = new NeatlineTime_Form_Timeline();
     $form->setDefaults(array('title' => $timeline->title, 'description' => $timeline->description, 'public' => $timeline->public, 'featured' => $timeline->featured));
     $this->view->form = $form;
     parent::editAction();
 }
Ejemplo n.º 4
0
 /**
  * Retrieve and render a set of records for the controller's model.
  *
  * @uses Omeka_Controller_Action_Helper_Db::getDefaultModelName()
  * @uses Omeka_Db_Table::findBy()
  */
 public function browseAction()
 {
     if (!$this->hasParam('sort_field')) {
         $this->setParam('sort_field', 'modified');
     }
     if (!$this->hasParam('sort_dir')) {
         $this->setParam('sort_dir', 'd');
     }
     parent::browseAction();
 }
 public function browseAction()
 {
     if (!$this->_getParam('sort_field')) {
         $this->_setParam('sort_field', 'added');
         $this->_setParam('sort_dir', 'd');
     }
     //Must be logged in to view items specific to certain users
     if ($this->_getParam('user') && !$this->_helper->acl->isAllowed('browse', 'Users')) {
         $this->_helper->flashMessenger('May not browse by specific users.');
         $this->_setParam('user', null);
     }
     parent::browseAction();
 }
 /**
  * Browse exhibits action.
  */
 public function browseAction()
 {
     $request = $this->getRequest();
     $sortParam = $request->getParam('sort');
     $sortOptionValue = get_option('exhibit_builder_sort_browse');
     if (!isset($sortParam)) {
         switch ($sortOptionValue) {
             case 'alpha':
                 $request->setParam('sort', 'alpha');
                 break;
             case 'recent':
                 $request->setParam('sort', 'recent');
                 break;
         }
     }
     parent::browseAction();
 }
Ejemplo n.º 7
0
 /**
  * Displays the browse page for all reports.
  */
 public function browseAction()
 {
     $db = $this->_helper->db;
     if (!$this->_getParam('sort_field')) {
         $this->_setParam('sort_field', 'added');
         $this->_setParam('sort_dir', 'd');
     }
     parent::browseAction();
     $reportItemCounts = array();
     $reportUserNames = array();
     foreach ($this->view->reports_reports as $report) {
         $user = $db->getTable('User')->find($report->creator);
         $query = unserialize($report->query);
         $params = reports_convert_search_filters($query);
         $itemCount = $db->getTable('Item')->count($params);
         $reportItemCounts[(string) $report->id] = $itemCount;
     }
     $this->view->reportItemCounts = $reportItemCounts;
     $this->view->formats = reports_get_output_formats();
 }
Ejemplo n.º 8
0
 public function indexAction()
 {
     parent::browseAction();
 }
Ejemplo n.º 9
0
 public function deleteAction()
 {
     $user = $this->_helper->db->findById();
     $ua = $this->_helper->db->getTable('UsersActivations')->findByUser($user);
     if ($ua) {
         $ua->delete();
     }
     parent::deleteAction();
 }
 public function browseAction()
 {
     parent::browseAction();
     $this->view->total = $this->_helper->db->getTable()->totalEmbeds();
 }
Ejemplo n.º 11
0
 public function showAction()
 {
     parent::showAction();
     $this->view->corpus = $this->view->ngram_corpu;
     // correct poor inflection
 }
Ejemplo n.º 12
0
 /**
  * Browse the items.  Encompasses search, pagination, and filtering of
  * request parameters.  Should perhaps be split into a separate
  * mechanism.
  * 
  * @return void
  */
 public function browseAction()
 {
     //Must be logged in to view items specific to certain users
     if ($this->_getParam('user') && !$this->_helper->acl->isAllowed('browse', 'Users')) {
         $this->_setParam('user', null);
         // Zend re-reads from GET/POST on every getParams() so we need to
         // also remove these.
         unset($_GET['user'], $_POST['user']);
     }
     parent::browseAction();
 }
 /**
  * Browse the imports.
  */
 public function browseAction()
 {
     if (!$this->_getParam('sort_field')) {
         $this->_setParam('sort_field', 'added');
         $this->_setParam('sort_dir', 'd');
     }
     parent::browseAction();
 }
Ejemplo n.º 14
0
 public function editAction()
 {
     $elementSets = $this->_getFileElementSets();
     $this->view->assign(compact('elementSets'));
     parent::editAction();
 }
Ejemplo n.º 15
0
 public function browseAction()
 {
     if (!$this->_getParam('sort_field')) {
         $this->_setParam('sort_field', 'added');
         $this->_setParam('sort_dir', 'd');
     }
     $ariane['liste des expositions'] = null;
     $this->view->ariane = $ariane;
     parent::browseAction();
 }
Ejemplo n.º 16
0
 /**
  * The edit collection action
  * 
  */
 public function editAction()
 {
     // Get all the element sets that apply to the item.
     $this->view->elementSets = $this->_getCollectionElementSets();
     parent::editAction();
 }