/**
  * Standard Module init function
  *
  * @return void
  */
 function init()
 {
     parent::init();
     if (!reason_user_has_privs($this->admin_page->user_id, 'delete')) {
         $this->_ok_to_run = false;
         $this->_not_ok_message = 'Sorry; you don\'t have the privileges to delete items on this site.';
     } elseif (empty($this->admin_page->site_id)) {
         $this->_ok_to_run = false;
         $this->_not_ok_message = 'Sorry; you need to specify a site before batch deleting items.';
     } elseif (empty($this->admin_page->type_id)) {
         $this->_ok_to_run = false;
         $this->_not_ok_message = 'Sorry; you need to specify a type before batch deleting items.';
     }
     if ($this->_ok_to_run) {
         $this->_type = new entity($this->admin_page->type_id);
         $this->admin_page->title = 'Batch Delete ' . $this->_type->get_value('plural_name');
         $es = new entity_selector($this->admin_page->site_id);
         $es->add_type($this->admin_page->type_id);
         $es->set_sharing('owns');
         $es->set_order('entity.last_modified DESC');
         // pray($this->admin_page->request);
         if (isset($this->admin_page->request['state']) && $this->admin_page->request['state'] == 'pending') {
             $status = 'Pending';
         } else {
             $status = 'Live';
         }
         $this->_items = $es->run_one('', $status);
         foreach (array_keys($this->_items) as $id) {
             if (!$this->admin_page->is_deletable($id)) {
                 unset($this->_items[$id]);
             }
         }
     }
 }
 /**
  * Standard Module init function
  *
  * @return void
  */
 function init()
 {
     parent::init();
     $this->head_items->add_stylesheet(REASON_HTTP_BASE_PATH . 'css/forms/form_data.css');
     $form =& $this->get_form();
     if ($form) {
         $this->admin_page->title = 'Data Manager for Form "' . $form->get_value('name') . '"';
     }
     $ta =& $this->get_thor_admin();
     // biobooks use a non-standard thor db structure ... until this is fixed we want to disable
     // row creation and editing for bio book thor forms. After this is fixed this check should
     // be zapped for a little performance boost.
     if ($ta) {
         $tc = $ta->get_thor_core();
         $allow_edit_and_new = $tc->column_exists('formkey') ? false : true;
         $ta->set_allow_delete(true);
         if ($allow_edit_and_new) {
             $ta->set_allow_edit(true);
             $ta->set_allow_new(true);
             // can we make sure its valid first?
         }
         $ta->set_allow_row_delete(true);
         $ta->set_allow_download_files(true);
         $ta->init_thor_admin();
     }
 }
Beispiel #3
0
 function init()
 {
     $sites = $this->admin_page->get_sites();
     if (count($sites) == 1) {
         parent::init();
     }
     $this->admin_page->title = $this->admin_page->get_name($this->admin_page->site_id);
     $this->admin_page->set_breadcrumbs(array($this->admin_page->make_link(array('site_id' => $this->admin_page->site_id, 'type_id' => '', 'id' => '')) => $this->admin_page->get_name($this->admin_page->site_id)));
 }
 function init()
 {
     parent::init();
     $this->admin_page->title = 'Re-Download File from Zencoder';
     $this->media_work = new entity($this->admin_page->id);
     if ($this->media_work->get_value('integration_library') == 'zencoder') {
         $this->user = new entity($this->admin_page->user_id);
     }
 }
 function init()
 {
     parent::init();
     $this->admin_page->title = 'Site Pages';
     $this->admin_page->set_breadcrumbs(array('' => 'Site Pages'));
     $this->head_items->add_stylesheet(REASON_HTTP_BASE_PATH . 'css/forms/form_data.css');
     $this->_get_site_page_data();
     // lets do the work in admin
 }
 /**
  * Standard Module init function
  *
  * Sets up page variables and runs the entity selctor that grabs the users
  * 
  * @return void
  */
 function init()
 {
     parent::init();
     $this->site = new entity($this->admin_page->site_id);
     $this->admin_page->title = 'Users with administrative access to ' . $this->site->get_value('name');
     $es = new entity_selector();
     $es->add_right_relationship($this->admin_page->site_id, relationship_id_of('site_to_user'));
     $this->users = $es->run_one(id_of('user'));
 }
 /**
  * Initialize the module
  *
  * Set up the page title, add appropriate css, and set up the form
  *
  * @return void
  */
 function init()
 {
     parent::init();
     $this->admin_page->title = 'Custom Image Size';
     $this->head_items->add_stylesheet(REASON_HTTP_BASE_PATH . 'css/reason_admin/image_sizer.css');
     if ($this->_ok_to_run_module() && ($image = $this->_get_image())) {
         $this->admin_page->title .= ': ' . $image->get_value('name');
         $this->_set_up_form($image);
     }
 }
 /**
  * Standard Module init function
  * 
  * @return void
  */
 function init()
 {
     parent::init();
     if (!empty($this->admin_page->id)) {
         $this->group = new entity($this->admin_page->id);
     }
     if (empty($this->group) || $this->group->get_value('type') != id_of('group_type')) {
         trigger_error('Group Tester Module run on a non-group entity', EMERGENCY);
         die;
     }
     $this->admin_page->title = 'Group tester for ' . $this->group->get_value('name');
 }
 /**
  * Standard Module init function
  *
  * Sets up page variables
  * 
  * @return void
  */
 function init()
 {
     parent::init();
     $this->site = new entity($this->admin_page->site_id);
     if (ALLOW_REASON_SITES_TO_SWITCH_THEMES && $this->site->get_value('allow_site_to_change_theme') == 'true' && reason_user_has_privs($this->admin_page->user_id, 'switch_theme')) {
         $this->self_change = true;
         $this->admin_page->title = 'Select a Site Theme';
     } else {
         $this->self_change = false;
         $this->admin_page->title = 'Site Theme';
     }
 }
 function init()
 {
     parent::init();
     $this->admin_page->title = 'Download Links for Media Work';
     $this->media_work = new entity($this->admin_page->id);
     if ($this->media_work->get_value('integration_library') == 'kaltura') {
         $this->kaltura_shim = new KalturaShim();
         $this->user = new entity($this->admin_page->user_id);
         // Grab the associated media files
         $es = new entity_selector();
         $es->add_type(id_of('av_file'));
         $es->add_right_relationship($this->media_work->id(), relationship_id_of('av_to_av_file'));
         $this->media_files = $es->run_one();
     }
 }
 function init()
 {
     parent::init();
     $this->head_items->add_stylesheet(REASON_HTTP_BASE_PATH . 'css/forms/form_data.css');
     $this->admin_page->title = 'Allowable Relationship Manager';
     if ($this->authenticate()) {
         $disco_admin = new DiscoAllowableRelationshipManager();
         $this->table_admin = new TableAdmin();
         $this->table_admin->set_allow_row_delete(true);
         $this->table_admin->set_allow_edit(true);
         $this->table_admin->set_allow_view(false);
         $this->table_admin->set_allow_new(true);
         $this->table_admin->set_admin_form($disco_admin);
         $this->table_admin->init(REASON_DB, 'allowable_relationship');
     }
 }
 function init()
 {
     parent::init();
     $this->admin_page->title = 'Select Thumbnail for Media Work';
     $this->media_work = new entity($this->admin_page->id);
     $this->user = new entity($this->admin_page->user_id);
     // Grab the initial associated image, if it exists
     $es = new entity_selector();
     $es->add_type(id_of('image'));
     $es->add_right_relationship($this->media_work->id(), relationship_id_of('av_to_primary_image'));
     $this->cur_image = current($es->run_one());
     $this->admin_page->head_items->add_javascript(JQUERY_URL, true);
     $this->admin_page->head_items->add_javascript(WEB_JAVASCRIPT_PATH . 'media_image_picker_zencoder.js');
     // fd-slider is a polyfill for the range plasmature type
     $this->admin_page->head_items->add_javascript(REASON_PACKAGE_HTTP_BASE_PATH . 'fd-slider/js/fd-slider.js');
     $this->admin_page->head_items->add_stylesheet(REASON_PACKAGE_HTTP_BASE_PATH . 'fd-slider/css/fd-slider.css');
     $this->shim = MediaWorkFactory::shim($this->media_work);
 }
 /**
  * Standard Module init function
  *
  * Sets up the entity selectors and grabs the site lists
  * 
  * @return void
  */
 function init()
 {
     parent::init();
     $this->site = new entity($this->admin_page->site_id);
     $this->admin_page->title = 'Site Listing';
     $lm = new entity_selector();
     $lm->add_type(id_of('site'));
     $lm->set_order('entity.name');
     $lm->add_relation('site.site_state = "Live"');
     $this->ls_count = $lm->get_one_count();
     $this->live_sites_list = $lm->run_one();
     if (reason_user_has_privs($this->admin_page->user_id, 'view_sensitive_data')) {
         $nm = new entity_selector();
         $nm->add_type(id_of('site'));
         $nm->set_order('entity.name');
         $nm->add_relation('site.site_state != "Live"');
         $this->nls_count = $nm->get_one_count();
         $this->not_live_site_list = $nm->run_one();
     }
 }
 /**
  * Standard Module init function
  *
  * @return void
  */
 function init()
 {
     parent::init();
     if (!empty($this->admin_page->id)) {
         $this->issue = new entity($this->admin_page->id);
     }
     if (empty($this->issue) || $this->issue->get_value('type') != id_of('issue_type')) {
         trigger_error('Sort Posts module run on a non-issue entity', EMERGENCY);
         die;
     }
     $this->admin_page->title = 'Sort Posts on issue "' . $this->issue->get_value('name') . '"';
     $es = new entity_selector($this->admin_page->site_id);
     $es->add_type(id_of('news'));
     $es->set_sharing('owns');
     $es->add_left_relationship($this->issue->id(), relationship_id_of('news_to_issue'));
     $es->set_order('dated.datetime DESC');
     $this->posts = $es->run_one();
     $user = new entity($this->admin_page->user_id);
     foreach ($this->posts as $id => $post) {
         if (!$post->user_can_edit_field('datetime', $user)) {
             $this->locked_posts[$id] = $post;
         }
     }
 }
 /**
  * Standard Module init function
  *
  * Sets up the entity selectors and grabs the site lists
  * 
  * @return void
  */
 function init()
 {
     parent::init();
     $this->site = new entity($this->admin_page->site_id);
     $this->admin_page->title = 'Unused Theme Listing';
 }
Beispiel #16
0
 /**
  * Standard Module init function
  *
  * Sets up page variables and runs the entity selctor that grabs the site's page url_fragments
  * 
  * @return void
  */
 function init()
 {
     parent::init();
     $this->site = new entity($this->admin_page->site_id);
     $this->admin_page->title = 'About Analytics';
     $this->head_items->add_stylesheet(REASON_HTTP_BASE_PATH . 'modules/google_api/analytics/analytics.css');
 }
 /**
  * Verify that we are running on a site.
  *
  * @return void
  */
 function init()
 {
     parent::init();
     $this->admin_page->title = 'Delete Registration Slot Data';
 }