Example #1
0
		function where_to_editable(&$disco)
		{
			if( $disco->get_chosen_action() == 'save' )
			{
				$url = get_current_url();
			}
			else
			{
				$inline_edit =& get_reason_inline_editing($this->page_id);
				$url = carl_make_redirect($inline_edit->get_deactivation_params($this));
			}
			return $url;
		}		
Example #2
0
 function where_to_editable(&$disco)
 {
     $inline_edit =& get_reason_inline_editing($this->page_id);
     $url = carl_make_redirect($inline_edit->get_deactivation_params($this));
     return $url;
 }
Example #3
0
 function run()
 {
     $inline_edit = get_reason_inline_editing($this->page_id);
     $classes = array('loginLinkModule');
     $classes[] = $this->get_user_netid() ? 'authenticated' : 'unauthenticated';
     echo '<div class="' . implode(' ', $classes) . '">';
     if ($this->has_admin_edit_privs()) {
         if ($inline_edit->is_enabled()) {
             echo '<div class="editDiv inlineEnabled">' . "\n";
             echo '<span class="clarifyingText">In Reason Admin: </span>' . "\n";
         } else {
             echo '<div class="editDiv">' . "\n";
         }
         echo '<a href="' . $this->get_edit_page_link() . '" class="editLink editPageLink">Edit Page</a> <span class="editDivider">&#183;</span> ' . "\n";
         echo '<a href="' . $this->get_edit_site_link() . '" class="editLink editSiteLink">Edit Site</a>' . "\n";
         echo '</div>';
     }
     if ($inline_edit->reason_allows_inline_editing() && $inline_edit->is_enabled() || $inline_edit->is_available()) {
         $classes = array('inlineEditDiv');
         if ($inline_edit->is_enabled()) {
             $link = carl_make_link(array('inline_editing_availability' => 'disable'));
             $link_text = 'Stop Editing';
             $classes[] = 'inlineEnabled';
         } else {
             $link = carl_make_link(array('inline_editing_availability' => 'enable'));
             $link_text = 'Edit in Place';
         }
         $inline_html = '<div class="' . implode(' ', $classes) . '">' . "\n";
         $inline_html .= '<a href="' . $link . '" class="inlineEditLink">' . $link_text . '</a>' . "\n";
         $inline_html .= '</div>';
         echo $inline_html;
     }
     echo '<p id="footerLoginLink">';
     echo $this->get_user_netid() ? '<span class="username">' . $this->get_user_netid() . '</span>: ' : '';
     echo $this->get_user_netid() ? '<a href="' . $this->get_login_url() . '?logout=1" class="logout">Logout</a>' : '<a href="' . $this->get_login_url() . '" class="login">Login</a>';
     echo '</p>' . "\n";
     echo '</div>' . "\n";
 }
 function run()
 {
     $inline_editing =& get_reason_inline_editing($this->page_id);
     $editing_available = $inline_editing->available_for_module($this);
     $editing_active = $inline_editing->active_for_module($this);
     $html = '<div id="coursesList" class="courses ' . $this->get_api_class_string() . ' ';
     if ($editing_available) {
         $html .= 'editable';
     }
     if ($editing_active) {
         $html .= 'editing';
     }
     $html .= '"><a name="coursesRegion"></a>' . "\n";
     if ($editing_available) {
         $html .= '<div class="editRegion">';
         if ($editing_active) {
             $html .= $this->get_editing_explanation();
             $html .= $this->get_course_picker();
         } else {
             $html .= '<p class="edit"><a class="editThis" href="' . carl_make_link($inline_editing->get_activation_params($this)) . '#coursesRegion">Edit Course List</a></p>' . "\n";
         }
     }
     if (!$editing_active) {
         $count = $protected_count = 0;
         $buckets = array();
         foreach ($this->courses as $course) {
             // Increment only if we got content for this course
             if ($content = $this->get_course_html($course)) {
                 if (!$this->params['organize_by_subject']) {
                     $html .= $content;
                     $count++;
                 } else {
                     $subject = $course->get_value('org_id');
                     $buckets[$subject][] = $content;
                 }
             }
             // Stop if we've reached our limit
             if ($this->params['max_shown'] > 0 && $count >= $this->params['max_shown']) {
                 break;
             }
         }
         echo $html;
         if ($this->params['organize_by_subject']) {
             ksort($buckets);
             if ($this->params['show_subject_links']) {
                 echo '<ul class="fieldLinks">';
                 foreach ($buckets as $subject => $courses) {
                     echo '<li><a href="#' . preg_replace('/\\W/', '', $subject) . '">' . $subject . '</a></li>';
                 }
                 echo '</ul>';
             }
             foreach ($buckets as $subject => $courses) {
                 echo '<h3 class="careerField"><a name="' . preg_replace('/\\W/', '', $subject) . '">' . $subject . '</a></h3>';
                 foreach ($courses as $html) {
                     echo $html;
                 }
             }
         }
     } else {
         echo $html;
     }
     if ($editing_available) {
         echo '</div>';
     }
     echo '</div>';
 }
Example #5
0
		function _where_to_policy_metadata(&$disco)
		{
			if( $disco->get_chosen_action() == 'save' )
			{
				$url = get_current_url();
				$url .= '#metadataEdit';
			}
			else
			{
				$inline_edit =& get_reason_inline_editing($this->page_id);
				$deactivation_params = $inline_edit->get_deactivation_params($this);
				$deactivation_params['edit_id'] = '';
				$url = carl_make_redirect($deactivation_params);
			}
			return $url;
		}		
Example #6
0
 function where_to_callback(&$form)
 {
     if ($form->chosen_action == 'save') {
         return get_current_url();
     } else {
         $inline_editing =& get_reason_inline_editing($this->page_id);
         $params = array_merge(array('blurb_id' => ''), $inline_editing->get_deactivation_params($this));
         return carl_make_redirect($params);
     }
 }
Example #7
0
	/**
	 * Show the detail view of the current event
	 *
	 * @return void
	 */
	function show_event_details()
	{
		$e =& $this->event;
		$inline_edit =& get_reason_inline_editing($this->page_id);
		$editable = $inline_edit->available_for_module($this);
		$regionclass = $active = '';
		if ($editable && $this->user_can_inline_edit_event($this->event->id()))
		{
			$active = $inline_edit->active_for_module($this);
			$class = ($active) ? 'editable editing' : 'editable';
			echo '<div class="'.$class.'">'."\n";
			if ($active) 
			{
				$this->edit_handler->disco_item->run();
			} else {
				$regionclass = 'editRegion';
			}
		}
		
		echo '<div class="eventDetails '.$regionclass.'">'."\n";
		if ($regionclass == 'editRegion')
		{
			$activation_params = $inline_edit->get_activation_params($this);
			$activation_params['edit_id'] = $e->id();
			$url = carl_make_link($activation_params);
			echo ' <a href="'.$url.'" class="editThis">Edit Event</a>'."\n";
			
		}
		
		if($active)
		{
			$this->show_back_link();
		}
		elseif($markup = $this->get_markup_object('item'))
		{
			$bundle = new functionBundle();
			$bundle->set_function('current_site_id',array($this, 'get_current_site_id'));
			$bundle->set_function('back_link',array($this,'construct_link'));
			$bundle->set_function('request_date',array($this,'get_request_date'));
			$bundle->set_function('images', array($this, 'get_event_images') );
			$bundle->set_function('media_works', array($this, 'get_event_media_works'));
			$bundle->set_function('owner_site', array($this, 'get_owner_site_info'));
			$bundle->set_function('ical_link', array($this, 'get_item_ical_link'));
			$bundle->set_function('contact_info', array($this, 'get_contact_info'));
			$bundle->set_function('categories', array($this, 'get_event_categories'));
			$bundle->set_function('audiences', array($this, 'get_event_audiences'));
			$bundle->set_function('keyword_links', array($this, 'get_event_keyword_links'));
			$bundle->set_function('is_all_day_event', array($this, 'event_is_all_day_event'));
			$bundle->set_function('map_zoom_level', array($this, 'get_map_zoom_level'));
			$bundle->set_function('registration_markup', array($this, 'get_registration_slots_markup'));
			$bundle->set_function('prettify_duration', array($this, 'prettify_duration'));
			$bundle->set_function('repetition_explanation', array($this, 'get_repetition_explanation'));
			$this->modify_item_function_bundle($bundle);
			$markup->set_bundle($bundle);
			if($head_items = $this->get_head_items())	
				$markup->modify_head_items($head_items, $e);
			echo $markup->get_markup($e);
		}
		echo '</div>'."\n";
		
		if ($editable && $this->user_can_inline_edit_event($this->event->id()))
			echo '</div>'."\n";

	}