Example #1
0
    function alter_data()
    {
        $this->set_display_name('show_hide', 'Visibility in Sitemap');
        $this->add_comments('show_hide', form_comment('This controls whether this site type 
(and the 
sites associated with it)  are displayed in the site map module'));
    }
Example #2
0
 function alter_data()
 {
     $authenticator = array("reason_username_has_access_to_site", $this->get_value("site_id"));
     $existing_asset_type = $this->get_value("file_type");
     $full_asset_path = $this->get_value('file_type') ? ASSET_PATH . $this->_id . '.' . $this->get_value('file_type') : false;
     $params = array('authenticator' => $authenticator, 'max_file_size' => $this->get_actual_max_upload_size(), 'head_items' => &$this->head_items, 'file_display_name' => $this->get_value('file_name'));
     if (!empty($existing_asset_type)) {
         $params = array_merge($params, array('existing_entity' => $this->_id, 'allow_upload_on_edit' => true));
     }
     $this->add_element('asset', 'ReasonUpload', $params);
     $asset = $this->get_element('asset');
     $this->set_comments('name', form_comment('A name for internal reference.'));
     $this->set_comments('content', form_comment('A long description of the document, if it needs it. This field is not required.'));
     $this->set_comments('description', form_comment('A description of the document.'));
     $this->set_comments('keywords', form_comment('A few words to aid in searching for the document.'));
     $this->set_comments('datetime', form_comment('mm/dd/yyyy'));
     $this->set_comments('asset', form_comment('Your filename may be modified if it is has already been taken, or includes spaces or unusual characters.'));
     $this->add_required('description');
     $this->set_display_name('asset', 'File');
     $this->set_display_name('datetime', 'Publication Date');
     $this->change_element_type('file_size', 'hidden');
     $this->change_element_type('file_name', 'text');
     $this->change_element_type('file_type', 'hidden');
     $this->change_element_type('mime_type', 'hidden');
     $this->add_restriction_selector();
 }
 /**
  * @todo add javascript hooks to check / uncheck all
  */
 function on_every_time()
 {
     $this->add_element('publication_id', 'select_no_sort', array('options' => $this->site_publication_names_by_id, 'display_name' => 'Choose a Publication'));
     $this->set_comments('publication_id', form_comment('<p>...Or <a href="' . $this->new_publication_link . '">create a new publication<a/></p>'));
     $this->add_element('issues', 'checkboxgroup', array('options' => $this->unattached_issue_names_by_id, 'display_name' => 'Choose Issues to Attach'));
     $this->set_value('issues', array_keys($this->unattached_issue_names_by_id));
     // check all by default
 }
Example #4
0
 function alter_data()
 {
     $defaultZoomLevel = defined('GOOGLE_MAPS_DEFAULT_ZOOM_LEVEL') ? GOOGLE_MAPS_DEFAULT_ZOOM_LEVEL : 4;
     $defaultLatitude = defined('GOOGLE_MAPS_DEFAULT_LATITUDE') ? GOOGLE_MAPS_DEFAULT_LATITUDE : 39.059325;
     $defaultLongitude = defined('GOOGLE_MAPS_DEFAULT_LONGITUDE') ? GOOGLE_MAPS_DEFAULT_LONGITUDE : -97.04547599999999;
     $this->set_comments('google_map_msid', form_comment('My places map id (e.g. 206354152960879485239.0004bd7c539131dd1e563) containing custom polygons and placemarks.<br/>Place multiple ids on a separate lines.'));
     $this->set_display_name('google_map_zoom_level', 'Zoom level');
     $this->set_display_name('google_map_latitude', 'Latitude');
     $this->set_display_name('google_map_longitude', 'Longitude');
     $this->set_display_name('google_map_msid', 'Map ID');
     $this->set_display_name('google_map_show_campus_template', 'Show Campus Template');
     $this->set_display_name('google_map_primary_pushpin_latitude', 'Primary Pushpin Latitude');
     $this->set_display_name('google_map_primary_pushpin_longitude', 'Primary Pushpin Longitude');
     $this->set_display_name('google_map_show_primary_pushpin', 'Primary Pushpin');
     $this->change_element_type('google_map_show_primary_pushpin', 'radio_no_sort', array('options' => array('show' => 'Show <span class="smallText formComment">(Drag the primary pushpin to set location)</span>', 'hide' => 'Hide <span id="destination_lat_long" class="smallText formComment">(Don\'t display primary pushpin)</span>')));
     $this->set_display_name('google_map_destination_latitude', 'Destination Latitude');
     $this->set_display_name('google_map_destination_longitude', 'Destination Longitude');
     $this->set_display_name('google_map_show_directions', 'Directions');
     $this->change_element_type('google_map_show_directions', 'radio_no_sort', array('options' => array('show' => 'Show <span class="smallText formComment">(Drag the "To" bubble to set destination)</span>', 'hide' => 'Hide <span id="destination_lat_long" class="smallText formComment">(Don\'t display the directions interface)</span>')));
     //$this->change_element_type('google_map_destination_latitude', 'hidden');
     //$this->change_element_type('google_map_destination_longitude', 'hidden');
     $this->change_element_type('no_share', 'hidden');
     if (!$this->get_value('google_map_zoom_level')) {
         $this->set_value('google_map_zoom_level', $defaultZoomLevel);
     }
     if (!$this->get_value('google_map_latitude')) {
         $this->set_value('google_map_latitude', $defaultLatitude);
     }
     if (!$this->get_value('google_map_longitude')) {
         $this->set_value('google_map_longitude', $defaultLongitude);
     }
     if (!$this->get_value('google_map_primary_pushpin_latitude') && !$this->get_value('google_map_primary_pushpin_longitude')) {
         $this->set_value('google_map_primary_pushpin_latitude', $this->get_value('google_map_latitude') + 0.0002);
         $this->set_value('google_map_primary_pushpin_longitude', $this->get_value('google_map_longitude') - 0.0002);
     }
     if (!$this->get_value('google_map_show_primary_pushpin')) {
         $this->set_value('google_map_show_primary_pushpin', 'show');
     }
     if (!$this->get_value('google_map_destination_latitude') && !$this->get_value('google_map_destination_longitude')) {
         $this->set_value('google_map_destination_latitude', $this->get_value('google_map_latitude'));
         $this->set_value('google_map_destination_longitude', $this->get_value('google_map_longitude'));
     }
     if (!$this->get_value('google_map_show_directions')) {
         $this->set_value('google_map_show_directions', 'show');
     }
     $msid = $this->get_value('google_map_msid');
     if ($msid != null) {
         $this->set_value('google_map_msid', preg_replace("|\\s|", PHP_EOL, $msid));
     }
     $this->set_order(array('name', 'unique_name', 'google_map_zoom_level', 'google_map_latitude', 'google_map_longitude', 'google_map_show_campus_template', 'google_map_show_primary_pushpin', 'google_map_primary_pushpin_latitude', 'google_map_primary_pushpin_longitude', 'google_map_show_directions', 'google_map_destination_latitude', 'google_map_destination_longitude', 'google_map_msid'));
 }
Example #5
0
 function alter_data()
 {
     $this->set_comments('description', form_comment('If provided, the short version may be used by modules that need to display quotes in a limited amount of space.'));
     $this->set_display_name('description', 'Quotation Text (Short Version)');
     $this->set_element_properties('description', array('rows' => 3));
     $this->set_display_name('content', 'Quotation Text');
     $this->add_required('content');
     if (!empty($this->fields_to_remove)) {
         foreach ($this->fields_to_remove as $field) {
             $this->remove_element($field);
         }
     }
     $this->set_order($this->field_order);
 }
 function run()
 {
     if (!reason_user_has_privs($this->admin_page->user_id, 'view_sensitive_data')) {
         echo 'Sorry; you do not have the rights to view this information.';
         return;
     }
     // get audiences in REason
     $es = new entity_selector();
     $es->add_type(id_of('audience_type'));
     $audiences = $es->run_one();
     $options = array();
     foreach ($audiences as $aud) {
         $options[$aud->get_value('directory_service_value')] = $aud->get_value('name');
     }
     $d = new disco();
     $d->add_element('active_since', 'textdatetime');
     $d->add_element('affiliations', 'checkboxgroup', array('options' => $options));
     $d->set_display_name('affiliations', 'Audiences');
     $d->add_comments('affiliations', form_comment('Leaving these checkboxes blank won\'t filter the results.'));
     $d->set_actions(array('run' => 'Run'));
     $d->run();
     if ($d->get_value('active_since')) {
         $user_ids = $this->_get_active_user_ids($d->get_value('active_since'));
         echo count($user_ids) . ' Reason users modified at least one item since ' . prettify_mysql_datetime($d->get_value('active_since')) . '<br />';
         if ($d->get_value('affiliations')) {
             $affiliations = array_values($d->get_value('affiliations'));
         } else {
             $affiliations = array();
         }
         $users = $this->_get_active_users_from_ids($user_ids, $affiliations);
         echo '<br />' . count($users) . ' of the above users currently have access to at least one site<br />';
         if (!empty($users)) {
             echo '<textarea rows="12">' . "\n";
             $usernames = array();
             foreach ($users as $user) {
                 $usernames[$user->id()] = $user->get_value('name');
             }
             echo implode(', ', $usernames);
             echo '</textarea>' . "\n";
         }
         $emails = $this->_get_email_addresses_from_users($users);
         echo '<br />' . count($emails) . ' of the users with site access have an email addresses in the directory<br />';
         if (!empty($emails)) {
             echo '<textarea rows="12">' . "\n";
             echo implode(', ', $emails);
             echo '</textarea>' . "\n";
         }
     }
 }
Example #7
0
 /**
  * Add / modify for elements for Email integration.
  */
 function social_account_on_every_time($cm)
 {
     $cm->change_element_type('account_type', 'protected');
     $cm->change_element_type('account_details', 'protected');
     $cm->set_display_name('account_id', 'LinkedIn page URL');
     $cm->add_required('account_id');
     $cm->add_comments('account_id', form_comment(''));
     // lets add a field showing the current link if one is available.
     $account_id = $cm->get_value('account_id');
     if (!empty($account_id)) {
         $link = $account_id;
         $comment_text = '<a href="' . $link . '">' . $link . '</a>';
         $cm->add_element('account_link', 'commentWithLabel', array('text' => $comment_text));
     }
 }
Example #8
0
	/**
	 * Add / modify for elements for Facebook integration.
	 */
	function social_account_on_every_time($cm)
	{
		$cm->change_element_type('account_type', 'protected');
		$cm->change_element_type('account_details', 'protected');
		$cm->set_display_name('account_id', 'Google+ ID');
		$cm->add_required('account_id');
		$cm->add_comments('account_id', form_comment('Your Google+ ID is the set of numbers after plus.google.com/ in the URL when you view your profile.'));

		// lets add a field showing the current link if one is available.		
		$account_id = $cm->get_value('account_id');
		if (!empty($account_id))
		{
			$link = 'http://plus.google.com/'.$account_id;
			$comment_text = '<a href="'.$link.'">'.$link.'</a>';
			$cm->add_element('account_link', 'commentWithLabel', array('text' => $comment_text));
		}
	}
 /**
  * Run the module
  */
 function run()
 {
     $sites = $this->_get_sites();
     if (empty($sites)) {
         echo '<p>You must have editing access to at least one live Reason site for this module to work</p>' . "\n";
         return;
     }
     $users = $this->_get_users();
     if (empty($users)) {
         echo '<p>No users available.</p>' . "\n";
         return;
     }
     echo '<div id="reviewChangesModule">' . "\n";
     $d = new disco();
     $d->add_element('start_date', 'textdate', array('prepopulate' => true, 'year_max' => carl_date('Y'), 'year_min' => '1000'));
     $d->add_required('start_date');
     $d->add_element('end_date', 'textdate', array('year_max' => carl_date('Y'), 'year_min' => '1000'));
     $d->add_comments('end_date', form_comment('If no end date given, changes will be shown for just the start date'));
     $d->add_element('type', 'select', array('options' => $this->_prep_for_disco($this->_get_types())));
     if (!empty($this->admin_page->request['type_id'])) {
         $d->set_value('type', $this->admin_page->request['type_id']);
     }
     $d->add_element('site', 'select', array('options' => $this->_prep_for_disco($sites)));
     if (!empty($this->admin_page->request['site_id'])) {
         $d->set_value('site', $this->admin_page->request['site_id']);
     }
     $d->add_element('user', 'select', array('options' => $this->_prep_for_disco($users)));
     if (!empty($this->admin_page->request['user'])) {
         $d->set_value('user', $this->admin_page->request['user']);
     }
     $d->add_element('sort', 'select', array('options' => array('DESC' => 'Descending', 'ASC' => 'Ascending')));
     $d->set_actions(array('review' => 'Review'));
     $d->run();
     if ($d->successfully_submitted()) {
         $end_date = $d->get_value('end_date') ? $d->get_value('end_date') : $d->get_value('start_date');
         if ($end_date < $d->get_value('start_date')) {
             echo 'Please pick a end date on or after the start date.';
         } else {
             echo $this->_get_changes_markup($d->get_value('start_date'), $end_date, $d->get_value('type'), $d->get_value('site'), $d->get_value('user'), $d->get_value('sort'));
         }
     }
     echo '</div>' . "\n";
 }
 function on_every_time()
 {
     $this->add_element('pub_name', 'text', array('display_name' => 'Publication Name'));
     $this->add_required('pub_name');
     $this->add_element('pub_description', 'textarea', array('display_name' => 'Publication Description'));
     $this->set_comments('pub_description', form_comment('Any text entered here will be displayed at the top of the primary page for the publication'));
     $this->add_element('pub_rss_feed_url', 'text', array('display_name' => 'Publication RSS Feed URL'));
     $this->add_required('pub_rss_feed_url');
     $this->add_element('pub_posts_per_page', 'text', array('display_name' => 'Posts per page'));
     $this->add_required('pub_posts_per_page');
     $this->add_element('pub_unique_name', 'text', array('display_name' => 'Publication Unique Name'));
     $this->add_element('date_format', 'select_no_sort', array('options' => array('F j, Y \\a\\t g:i a' => date('F j, Y \\a\\t g:i a'), 'n/d/y \\a\\t g:i a' => date('n/d/y \\a\\t g:i a'), 'l, F j, Y' => date('l, F j, Y'), 'F j, Y' => date('F j, Y'), 'n/d/y' => date('n/d/y'), 'n.d.y' => date('n.d.y'), 'j F Y' => date('j F Y'), 'j F Y \\a\\t  g:i a' => date('j F Y \\a\\t  g:i a'), 'j F Y \\a\\t  g:i a' => date('j F Y \\a\\t  H:i'))));
     // if the site does not have any publications yet, we'll guess at certain values
     if (empty($this->site_publication_names_by_id)) {
         $this->set_value('pub_rss_feed_url', $this->helper->guess_desired_publication_rss_feed_url());
         $this->set_value('pub_description', $this->helper->guess_desired_publication_description());
         $this->set_value('pub_name', $this->helper->guess_desired_publication_name());
     }
     // we always guess at posts per page
     $this->set_value('pub_posts_per_page', $this->helper->guess_desired_publication_posts_per_page());
 }
Example #11
0
 function on_every_time()
 {
     $site_list = $this->get_site_list();
     $existing_file = $this->get_value('wordpress_xml');
     if (!empty($existing_file)) {
         $source_file_name = $this->get_value('xml_file_name');
         $this->set_comments('wordpress_xml', form_comment('<p>A file (' . $source_file_name . ') has been uploaded - only upload a file if you want to change the source file</p>'));
     }
     if ($site_list) {
         $this->change_element_type('reason_site', 'select_no_sort', array('options' => $site_list));
     } else {
         $this->change_element_type('reason_site', 'solidtext');
         $this->set_value('reason_site', 'There are no sites available');
     }
     $this->uid = uniqid('', true);
     $this->set_value('xml_id', $this->uid);
     $this->add_element('blog_page_name');
     $this->set_comments('blog_page_name', form_comment('Leave blank if you want the blog to be created on the home page.'));
     if (is_developer()) {
         $this->add_element('kill_all_label', 'comment', array('text' => '<h3>Developer Tools</h3><p>If "Zap site" is checked, we will expunge all the contents of the site instead of parsing/importing XML. Mainly this is for developers who are tweaking an import.</p>'));
         $this->add_element('kill_all', 'checkbox', array('display_name' => 'Zap site'));
         //$this->set_comments('kill_all', form_comment());
     }
 }
 function on_every_time()
 {
     $this->setup_default_actions();
     $category_options = $this->model->get_classified_category_names();
     $this->change_element_type('category', 'radio', array('options' => $category_options));
     if (!empty($this->classified_form_comments)) {
         foreach ($this->classified_form_comments as $k => $v) {
             $this->set_comments($k, form_comment($v));
         }
     }
     if (!empty($this->classified_form_display_names)) {
         foreach ($this->classified_form_display_names as $k => $v) {
             if ($this->get_element($k)) {
                 $this->set_display_name($k, $v);
             }
         }
     }
     $this->alter_classified_form_elements();
 }
Example #13
0
						</form>
				<?php 
} else {
    if ($rezult->uid_winner == $firma) {
        ?>
					<div class="sa_comment_reply"><?php 
        echo JText::_('SAUTO_COMMENT_REPLY');
        ?>
</div>
						
					<form method="post" action="<?php 
        echo $link_comment;
        ?>
" enctype="multipart/form-data" name="submit_comm" id="submit_comm">
						<?php 
        form_comment($r_id, $multiple_id, $anunt_id, $proprietar, $firma);
        echo loadImg($r_id, $multiple_id);
        ?>
					
					</form>
		<?php 
    }
}
?>
	<div>
	<div onClick="document.forms['submit_comm'].submit();" class="someClass">
					<?php 
echo JText::_('SAUTO_COMMENT_BUTTON');
?>
					</div>
	<div class="someClass" style="vertical-align: top;" onclick="window.history.go(-1)"><?php 
 function alter_data()
 {
     $this->set_order(array('name', 'unique_name', 'slot_description', 'registration_slot_capacity', 'registrant_data'));
     $this->change_element_type('registrant_data', 'solidtext');
     $this->set_comments('registrant_data', form_comment('Registrant data is managed from the event listing on the public site'));
 }
 /**
  * Simple form manipulation happens in this method related to kaltura-integrated things.
  */
 function do_basic_kaltura_field_modification()
 {
     $this->manager->add_required('av_type');
     $this->manager->set_display_name('av_type', 'Media Type');
     $this->manager->change_element_type('av_type', 'radio_no_sort', array('options' => array('Audio' => 'Audio <span class="smallText formComment">(e.g. sound-only music, speech, etc.)</span>', 'Video' => 'Video <span class="smallText formComment">(e.g. movies, videos, etc.)</span>')));
     if ($this->manager->get_value('media_duration')) {
         $this->manager->change_element_type('media_duration', 'solidtext');
     } else {
         $this->manager->change_element_type('media_duration', 'protected');
     }
     $this->manager->change_element_type('integration_library', 'protected');
     $this->manager->set_comments('description', form_comment('(e.g. "A Tour of Northfield")'));
     $this->manager->add_element('file_info_header', 'comment', array('text' => '<h4>Media Info</h4>'));
     $this->manager->add_element('access_header', 'comment', array('text' => '<h4>Access and Sharing</h4>'));
     $this->manager->change_element_type('transcoding_status', 'protected');
     $this->manager->change_element_type('entry_id', 'protected');
     $this->manager->change_element_type('email_notification', 'checkbox');
     $this->manager->set_display_name('email_notification', 'Email Alert');
     $this->manager->set_comments('email_notification', '<span class="smallText">Check this box to receive an email when your media finishes processing.</span>');
     $this->manager->set_value('email_notification', true);
     $this->manager->change_element_type('show_embed', 'checkbox');
     $this->manager->change_element_type('show_download', 'checkbox');
     if ($this->manager->get_value('transcoding_status') == 'ready') {
         $download_links_url = carl_make_link(array('cur_module' => 'MediaDownloadLinks'));
         $download_links_link = '<a href="' . $download_links_url . '"><strong>View download links for this media</strong></a>';
         $this->manager->add_element('download_links', 'commentWithLabel', array('text' => $download_links_link));
         $this->manager->set_display_name('download_links', '');
     }
 }
Example #16
0
 function add_relationship_element($name, $type_id, $rel_id, $direction = 'right', $element_type = 'checkbox', $limit_to_site = true, $sort = 'entity.name ASC')
 {
     static $directions = array('right', 'left');
     static $element_types = array('checkbox' => array('plasmature_type' => 'checkboxgroup_no_sort'), 'radio' => array('plasmature_type' => 'radio_no_sort'), 'select' => array('plasmature_type' => 'select_no_sort', 'args' => array('add_empty_value_to_top' => true)), 'multiple_select' => array('plasmature_type' => 'select_no_sort', 'args' => array('size' => 7, 'multiple' => true), 'comment' => 'Control-click (PC) or Command-click (Mac) to choose multiple items'));
     static $single_item_element_types = array('radio', 'select');
     if (!array_key_exists($element_type, $element_types)) {
         trigger_error($element_type . ' is not an acceptable parameter for add_relationship_element(). Try one of the following: ' . implode(', ', $element_types));
         return;
     }
     if (!in_array($direction, $directions)) {
         trigger_error($direction . ' is not an acceptable parameter for add_relationship_element(). Try one of the following: ' . implode(', ', $directions));
         return;
     }
     $rel_info = $this->get_relationship_info($rel_id);
     if ($direction == 'right' && $rel_info['connections'] == 'one_to_many' || $direction == 'left' && $rel_info['connections'] == 'many_to_one') {
         $can_relate_multiple_items = false;
     } else {
         $can_relate_multiple_items = true;
     }
     if (!empty($rel_info)) {
         if (!in_array($element_type, $single_item_element_types)) {
             if (!$can_relate_multiple_items) {
                 trigger_error('Rel type mismatch -- only these element types can be used with a one_to_many relationship: ' . implode(', ', $single_item_element_types));
                 return;
             }
         }
     } else {
         trigger_error($rel_id . ' does not appear to be an allowable relationship ID');
         return;
     }
     if ($limit_to_site) {
         $es = new entity_selector($this->get_value('site_id'));
     } else {
         $es = new entity_selector();
     }
     $es->add_type($type_id);
     if ($this->get_value('site_id')) {
         $es->set_env('site', $this->get_value('site_id'));
     }
     $rel_es = carl_clone($es);
     if ($direction == 'right') {
         $rel_es->add_right_relationship($this->get_value('id'), $rel_id);
     } else {
         $rel_es->add_left_relationship($this->get_value('id'), $rel_id);
         $rel_es->add_right_relationship_field('owns', 'entity', 'id', 'owner_id');
     }
     if (in_array($element_type, $single_item_element_types)) {
         $rel_es->set_num(1);
     }
     //$rel_es->add_field('relationship','id','rel_id');
     $rel_es->set_order($sort);
     $rel_es->add_field('relationship', 'site', 'rel_site_id');
     $related_entities = $rel_es->run_one();
     $related_keys = array();
     $untouchables = array();
     foreach ($related_entities as $entity) {
         if ($direction == 'right' || $entity->get_value('owner_id') == $this->get_value('site_id') || $entity->get_value('rel_site_id') == $this->get_value('site_id')) {
             $related_keys[] = $entity->id();
         } else {
             $untouchables[$entity->id()] = strip_tags($entity->get_display_name());
         }
     }
     if (!empty($untouchables)) {
         $es->add_relation('entity.id NOT IN (' . implode(',', array_keys($untouchables)) . ')');
     }
     $es->set_order($sort);
     $entities = $es->run_one();
     $values = array();
     foreach ($entities as $entity) {
         $values[$entity->id()] = strip_tags($entity->get_display_name());
     }
     $args = array();
     if (!empty($element_types[$element_type]['args'])) {
         $args = $element_types[$element_type]['args'];
     }
     $args['options'] = $values;
     $this->add_element($name, $element_types[$element_type]['plasmature_type'], $args);
     if (!empty($related_keys)) {
         if (in_array($element_type, $single_item_element_types)) {
             $this->set_value($name, current($related_keys));
         } else {
             $this->set_value($name, $related_keys);
         }
     }
     if ($direction == 'right' && $rel_info['required'] == 'yes') {
         if (!empty($entities)) {
             $this->add_required($name);
         } else {
             $this->add_comments($name, '<em>None available</em>');
         }
     }
     if (!empty($untouchables)) {
         $this->add_comments($name, '<div class="otherSiteRelation"><strong>Attached to this item by another site:</strong><ul class="smallText"><li>' . implode('</li><li>', $untouchables) . '</li></ul></div>', 'before');
     }
     if (!empty($element_types[$element_type]['comment'])) {
         $this->add_comments($name, form_comment($element_types[$element_type]['comment']));
     }
     $this->_relationship_elements[$name] = array('type_id' => $type_id, 'rel_id' => $rel_id, 'direction' => $direction, 'options' => array_keys($entities), 'related_at_prep' => $related_keys);
     if (!in_array($name, $this->_no_tidy)) {
         $this->_no_tidy[] = $name;
     }
 }
 /**
  * The upload element is added to the form.
  */
 function _add_file_upload_element()
 {
     if ($this->manager->manages_media && $this->manager->get_value('transcoding_status') != 'converting') {
         $authenticator = array("reason_username_has_access_to_site", $this->manager->get_value("site_id"));
         $params = array('authenticator' => $authenticator, 'acceptable_extensions' => $this->recognized_extensions, 'max_file_size' => $this->_get_actual_max_upload_size(), 'head_items' => &$this->manager->head_items);
         $this->manager->add_element('upload_file', 'ReasonUpload', $params);
         $this->manager->set_comments('upload_file', form_comment('If the file is on your computer, browse to it here.') . form_comment('File must have one of the following extensions: .' . implode(', .', $this->recognized_extensions)) . form_comment('<div class="maxUploadSizeNotice">Maximum file size for uploading is ' . format_bytes_as_human_readable($this->_get_actual_max_upload_size()) . '. </div>'));
         $this->manager->add_element('upload_url');
         $this->manager->add_comments('upload_url', form_comment('Or, you can place the media in any web-accessible location and paste its web address in here. <em>Tip: try pasting the address into another tab first, to make sure you have the address right!</em>'));
         if ($this->manager->get_value('transcoding_status') == 'ready') {
             $this->manager->set_display_name('upload_file', 'Upload Replacement File');
         }
     }
 }
 protected function _get_form()
 {
     $d = new Disco();
     $d->set_form_class("StackedBox");
     $d->add_element('name', 'text');
     $d->set_display_name('name', 'Creator\'s Name');
     $d->add_required('name');
     $d->add_element('email', 'text');
     $d->set_display_name('email', 'Creator\'s Email Address');
     $d->add_required('email');
     $d->add_element('class_year', 'text');
     $d->set_display_name('class_year', 'Creators\'s Class Year (if Applicable)');
     $d->add_element('media_title', 'text');
     $d->set_display_name('media_title', 'Title');
     $d->add_required('media_title');
     $d->add_element('description', 'textarea');
     $d->set_display_name('description', 'Media Description');
     $d->add_required('description');
     $d->add_element('av_type', 'radio_no_sort', array('options' => array('Audio' => 'Audio <span class="smallText formComment">(e.g. sound-only music, speech, etc.)</span>', 'Video' => 'Video <span class="smallText formComment">(e.g. movies, videos, etc.)</span>')));
     $d->set_display_name('av_type', 'Media Type');
     $d->add_required('av_type');
     //$authenticator = array("reason_username_has_access_to_site", $this->get_value("site_id"));
     $params = array('acceptable_extensions' => KalturaShim::get_recognized_extensions(), 'max_file_size' => $this->_get_actual_max_upload_size(), 'head_items' => &$this->head_items);
     $d->add_element('upload_file', 'ReasonUpload', $params);
     $d->set_display_name('upload_file', 'Media to Upload');
     //$d->add_required('upload_file');
     $d->add_comments('upload_file', form_comment('If the file is on your computer, browse to it here.'));
     $d->add_comments('upload_file', form_comment('File must have one of the following extensions: .' . implode(', .', KalturaShim::get_recognized_extensions())));
     $d->add_comments('upload_file', form_comment('<div class="maxUploadSizeNotice">Maximum file size for uploading is 100MB. </div>'));
     $d->add_element('url', 'text');
     $d->set_display_name('url', 'Media url');
     $d->add_comments('url', form_comment('If you are uploading a file larger than 100MB, enter the url of the file you are uploading here.'));
     $d->add_comments('url', form_comment('Example: http://people.carleton.edu/~huderlem/reason_import_only/video.mp4'));
     $d->add_element('permission', 'checkboxfirst');
     $d->set_display_name('permission', 'I give Carleton College the right to reproduce, display, and use this media in any manner.');
     $d->add_required('permission');
     $d->add_element('rights', 'checkboxfirst');
     $d->set_display_name('rights', 'I am the creator of this media and have full rights to its use.');
     $d->add_required('rights');
     $d->set_actions(array('save' => 'Submit your Media'));
     $d->form_enctype = 'multipart/form-data';
     $this->_populate_author($d);
     $d->add_callback(array($this, 'get_intro'), 'pre_show_form');
     $d->add_callback(array($this, 'error_check_form'), 'run_error_checks');
     $d->add_callback(array($this, 'process_form'), 'process');
     $d->add_callback(array($this, 'get_thank_you_url'), 'where_to');
     return $d;
 }
Example #19
0
	/**
	 * Add / modify for elements for Facebook integration.
	 */
	function social_account_on_every_time($cm)
	{
		$cm->change_element_type('account_type', 'protected');
		$cm->change_element_type('account_details', 'protected');
		$cm->set_display_name('account_id', 'Facebook ID');
		$cm->add_required('account_id');
		$cm->set_comments('account_id', form_comment('This is usually the number at the end of your Facebook profile or page. If you cannot find it, try your username instead.'));
			
		// lets add a field showing the current link if one is available.
		
		$account_details = $cm->get_value('account_details');
		if (!empty($account_details))
		{
			$details = json_decode($account_details, true);
			if (isset($details['link']))
			{
				$comment_text = '<a href="'.$details['link'].'">'.$details['link'].'</a>';
				$cm->add_element('account_link', 'commentWithLabel', array('text' => $comment_text));
			}
		}
	}
Example #20
0
 function alter_data()
 {
     $this->add_required('directory_service_value');
     $this->_no_tidy[] = 'audience_filter';
     $this->add_comments('directory_service_value', form_comment('If Reason is integrated with a directory service, this should be the same as the string that identifies the affiliation in your directory service.'));
 }
Example #21
0
					</div>
					</div>
					<div style="clear:both;"></div>
				</td>
			</tr>
			<?php 
    }
    ?>
		<tr class="sa_table_row">
			<td class="sa_table_cell" colspan="3">
				<form method="post" action="<?php 
    echo $link_comment;
    ?>
" enctype="multipart/form-data" name="submit_comm" id="submit_comm">
				<?php 
    form_comment($r_id, $multiple_id, $list->anunt_id, $uid, $list->comp);
    echo loadImg($r_id, $multiple_id);
    ?>
					
				</form>	
				
				<div onClick="document.forms['submit_comm'].submit();" class="sa_add_comment sa_submit_form">
					<?php 
    echo JText::_('SAUTO_COMMENT_BUTTON');
    ?>
				</div>
			</td>
		</tr>
		<tr class="sa_table_row">
			<td class="sa_table_cell" colspan="2"  align="left">
			<?php 
 function add_file_upload_element()
 {
     if ($this->manages_media) {
         $authenticator = array("reason_username_has_access_to_site", $this->manager->get_value("site_id"));
         $params = array('authenticator' => $authenticator, 'acceptable_types' => $this->get_acceptable_mime_types(), 'max_file_size' => $this->get_actual_max_upload_size(), 'head_items' => &$this->manager->head_items);
         $this->manager->add_element('upload_file', 'ReasonUpload', $params);
         $this->manager->add_comments('upload_file', form_comment('If the file is on your computer, browse to it here.'));
         $this->manager->add_comments('upload_file', form_comment('Maximum file size for uploading is ' . format_bytes_as_human_readable($this->get_actual_max_upload_size())));
         $this->manager->add_comments('upload_file', form_comment('File must have one of the following extensions: .' . implode(', .', $this->recognized_extensions)));
     }
 }
Example #23
0
        echo '<div id="add_comment_' . $z . '" style="display:none;">';
        $link_comment = JRoute::_('index.php?option=com_sauto&view=add_comment');
        ?>

<form method="post" action="<?php 
        echo $link_comment;
        ?>
" enctype="multipart/form-data" name="submit_comm_<?php 
        echo $r->id;
        ?>
" id="submit_comm_<?php 
        echo $r->id;
        ?>
">
<?php 
        form_comment($r->id, $multiple_id, $id, $rezult->proprietar, $r->firma);
        ?>
	
	<?php 
        loadImg($r->id, $multiple_id);
        ?>
					
	</form>
		
	<div onClick="document.forms['submit_comm_<?php 
        echo $r->id;
        ?>
'].submit();" class="sa_add_comment sa_submit_form">
	<?php 
        echo JText::_('SAUTO_COMMENT_BUTTON');
        ?>
 /**
  * Simple form manipulation happens in this method related to youtube-integrated things.
  */
 function do_basic_youtube_field_modification()
 {
     $this->manager->change_element_type('av_type', 'protected');
     $this->manager->set_value('av_type', 'Video');
     if ($this->manager->get_value('media_duration')) {
         $this->manager->change_element_type('media_duration', 'solidtext');
     } else {
         $this->manager->change_element_type('media_duration', 'protected');
     }
     $this->manager->change_element_type('integration_library', 'protected');
     $this->manager->set_comments('description', form_comment('(e.g. "A Tour of Northfield")'));
     $this->manager->add_element('file_info_header', 'comment', array('text' => '<h4>Media Info</h4>'));
     $this->manager->add_element('access_header', 'comment', array('text' => '<h4>Access and Sharing</h4>'));
     $this->manager->change_element_type('transcoding_status', 'protected');
     $this->manager->set_value('transcoding_status', 'ready');
     $this->manager->change_element_type('entry_id', 'protected');
     $this->manager->change_element_type('email_notification', 'protected');
     $this->manager->set_value('email_notification', false);
     $this->manager->change_element_type('show_embed', 'checkbox');
     if (!$this->manager->get_value('entry_id')) {
         $this->manager->set_value('show_embed', true);
     }
     $this->manager->change_element_type('show_download', 'protected');
     $this->manager->set_value('show_download', false);
 }
Example #25
0
 function alter_data()
 {
     $this->add_required('url');
     $this->add_comments('css_media', form_comment('The media string to use when including this CSS file in the page head, e.g. "print" or "all and (min-width:500px)". Leave empty to apply to all media.'));
     $this->set_order(array('name', 'url', 'css_relative_to_reason_http_base', 'css_media', 'description', 'keywords'));
 }
Example #26
0
 function on_every_time_galleries()
 {
     $page_options = $this->get_selection_page_set($this->site_id);
     if (!empty($page_options)) {
         $this->change_element_type('attach_to_page', 'select_no_sort', array('options' => $page_options, 'add_empty_value_to_top' => true));
         $this->add_comments('attach_to_page', form_comment('&#9671;: Photo gallery/slideshow pages'));
         $this->set_display_name('attach_to_page', 'Place imported images on page');
     }
 }
 function set_disco_obj($types)
 {
     $d = new disco();
     $types = array();
     foreach ($this->types as $type) {
         $types = $types + array($type->get_value('id') => $type->get_value('name'));
     }
     $d->add_element('types', 'select_multiple', array('options' => $types));
     $d->set_display_name('types', 'Types to search:');
     $d->set_comments('types', form_comment('<a id="select_all" href="#all">Select all</a>'));
     $d->add_element('max', 'radio_inline_no_sort', array('options' => array('yes' => 'Yes', 'no' => 'No')));
     $d->set_display_name('max', 'Limit number of orphans to find:');
     $d->set_comments('max', form_comment('Searching for all orphaned entities can take a while. Limiting the number to find speeds the search.'));
     $d->set_value('max', 'yes');
     $d->add_element('max_num', 'text', array('size' => '5'));
     $d->set_display_name('max_num', 'Maximum number:');
     $d->set_value('max_num', '50');
     $d->add_element('cur_module', 'hidden');
     $d->set_value('cur_module', 'OrphanManager');
     $d->add_required('types', 'max');
     $d->add_element('mode', 'hidden');
     $d->set_value('mode', 'manager');
     $d->set_actions(array('run' => 'Find Orphaned Entities'));
     function check_phase_callback(&$disco)
     {
         if ($disco->successfully_submitted()) {
             $disco->show_form = false;
         }
     }
     $d->add_callback('check_phase_callback', 'where_to');
     $this->d = $d;
 }
Example #28
0
 function alter_data()
 {
     // Hide fields that are not used
     $this->change_element_type('keywords', 'hidden');
     if ($this->is_element('commenting_state')) {
         $this->change_element_type('commenting_state', 'hidden');
     }
     if ($this->is_element('pagination_state')) {
         $this->change_element_type('pagination_state', 'hidden');
     }
     if ($this->is_element('enable_comment_notification')) {
         $this->change_element_type('enable_comment_notification', 'hidden');
     }
     if ($this->is_element('enable_front_end_posting')) {
         $this->change_element_type('enable_front_end_posting', 'hidden');
     }
     // Name
     $this->set_display_name('name', 'Publication Name');
     // Publication type
     $this->add_required('publication_type');
     if (!$this->get_value('publication_type')) {
         $this->set_value('publication_type', 'blog');
     }
     // Posts per page
     $this->add_required('posts_per_page');
     // Date format
     $this->set_comments('date_format', form_comment('Posts on this publication will use the date format that you select to show the date (and/or) time of publication.'));
     $this->change_element_type('date_format', 'select_no_sort', array('options' => array('F j, Y \\a\\t g:i a' => date('F j, Y \\a\\t g:i a'), 'n/d/y \\a\\t g:i a' => date('n/d/y \\a\\t g:i a'), 'l, F j, Y' => date('l, F j, Y'), 'F j, Y' => date('F j, Y'), 'n/d/y' => date('n/d/y'), 'n.d.y' => date('n.d.y'), 'j F Y' => date('j F Y'), 'j F Y \\a\\t  g:i a' => date('j F Y \\a\\t  g:i a'), 'j F Y \\a\\t  g:i a' => date('j F Y \\a\\t  H:i'))));
     // RSS
     $this->add_element('rss_comment', 'comment', array('text' => '<h4>RSS</h4>'));
     $this->add_comments('rss_comment', form_comment('RSS is a way for people to suscribe to your publication and be informed when there are new posts.'));
     $this->set_display_name('blog_feed_string', 'RSS feed URL');
     $this->add_required('blog_feed_string');
     $this->add_comments('blog_feed_string', form_comment('The URL snippet that this blog / publication will use for its RSS feed.'));
     $this->set_display_name('blog_feed_include_content', 'RSS Format');
     $this->change_element_type('blog_feed_include_content', 'radio', array('options' => array('no' => 'Descriptions only (Suscribers must click to see full content)', 'yes' => 'Publish full content in RSS')));
     if (defined('PUBLICATION_HIDE_FEED_DESCRIPTION_CHECKBOX') && PUBLICATION_HIDE_FEED_DESCRIPTION_CHECKBOX) {
         $this->change_element_type('blog_feed_include_content', 'cloaked');
     }
     if (!$this->get_value('blog_feed_include_content')) {
         if (!$this->is_new_entity() || !defined('PUBLICATION_FEED_DEFAULT_TO_CONTENT') || !PUBLICATION_FEED_DEFAULT_TO_CONTENT) {
             $this->set_value('blog_feed_include_content', 'no');
         } else {
             $this->set_value('blog_feed_include_content', 'yes');
         }
     }
     if ($this->is_new_entity() || reason_user_has_privs($this->admin_page->user_id, 'edit_fragile_slugs')) {
         $this->add_comments('blog_feed_string', form_comment('Only lowercase letters and underscores are allowed in this field.'));
         if (!reason_user_has_privs($this->admin_page->user_id, 'edit_fragile_slugs')) {
             $this->add_comments('blog_feed_string', form_comment('After this publication has been "finished" the first time, this URL snippet will not be editable. So choose wisely.'));
         } else {
             $this->add_comments('blog_feed_string', form_comment('You may edit this field because you are a Reason admin.  However, if you change the URL, the feed will break in any newsreaders that are currently subscribed to this publication.'));
         }
     } else {
         $this->change_element_type('blog_feed_string', 'solidtext');
         $this->add_comments('blog_feed_string', form_comment('This field is now fixed so that newsreaders can rely on a stable URL.'));
     }
     // Description
     $this->change_element_type('description', html_editor_name($this->admin_page->site_id), html_editor_params($this->admin_page->site_id, $this->admin_page->user_id));
     // Social sharing
     $this->add_element('social_sharing_comment', 'comment', array('text' => '<h4>Social Sharing</h4>'));
     $this->add_comments('social_sharing_comment', form_comment('Would you like to provide links to share your content on social networks?'));
     $this->set_display_name('enable_social_sharing', '&nbsp;');
     $this->change_element_type('enable_social_sharing', 'radio', array('options' => array('no' => 'Don\'t provide buttons to share posts', 'yes' => 'Provide buttons to share posts on social networks')));
     if (!$this->get_value('enable_social_sharing')) {
         if (!$this->is_new_entity() || !defined('PUBLICATION_SOCIAL_SHARING_DEFAULT') || !PUBLICATION_SOCIAL_SHARING_DEFAULT) {
             $this->set_value('enable_social_sharing', 'no');
         } else {
             $this->set_value('enable_social_sharing', 'yes');
         }
     }
     // Front-end posting
     $this->add_element('posting_comment', 'comment', array('text' => '<h4>Posting on the public site</h4>'));
     $this->add_required('hold_posts_for_review');
     $this->change_element_type('hold_posts_for_review', 'radio', array('options' => array('no' => 'Publish posts automatically', 'yes' => 'Hold posts for review')));
     $this->set_display_name('hold_posts_for_review', 'New Post Moderation');
     $this->add_element('allow_front_end_posting', 'checkbox');
     $this->add_comments('allow_front_end_posting', form_comment('Check to enable simple posting on the publication'));
     $this->set_display_name('notify_upon_post', 'New Post Notification');
     $this->add_comments('notify_upon_post', form_comment('Who should be notified when a post is added to this publication? Enter usernames or email addresses, separated by commas. Leave this field blank if you don\'t want any notification to be sent.'));
     // Commenting
     $this->add_element('comment_comment', 'comment', array('text' => '<h4>Commenting</h4>'));
     $this->add_element('allow_comments', 'checkbox');
     $this->add_required('hold_comments_for_review');
     $this->change_element_type('hold_comments_for_review', 'radio', array('options' => array('no' => 'Publish comments automatically', 'yes' => 'Hold comments for review')));
     $this->set_display_name('hold_comments_for_review', 'Comment Moderation');
     $this->set_display_name('notify_upon_comment', 'New Comment Notification');
     $this->add_comments('notify_upon_comment', form_comment('Who should be notified when a comment is added to this publication? Enter usernames or email addresses, separated by commas. Leave this field blank if you don\'t want any notification to be sent.'));
     // Posting & commenting defaults
     if (site_borrows_entity($this->get_value('site_id'), id_of('nobody_group')) || site_owns_entity($this->get_value('site_id'), id_of('nobody_group'))) {
         $nobody_group = new entity(id_of('nobody_group'));
         if (!$this->entity->has_left_relation_with_entity($nobody_group, 'publication_to_authorized_posting_group')) {
             $this->set_value('allow_front_end_posting', 'true');
         }
         if (!$this->entity->has_left_relation_with_entity($nobody_group, 'publication_to_authorized_commenting_group')) {
             $this->set_value('allow_comments', 'true');
         }
     } else {
         $this->set_value('allow_comments', 'true');
         $this->set_value('allow_front_end_posting', 'true');
     }
     if (!$this->get_value('hold_comments_for_review')) {
         $this->set_value('hold_comments_for_review', 'no');
     }
     if (!$this->get_value('hold_posts_for_review')) {
         $this->set_value('hold_posts_for_review', 'no');
     }
     // Issues & Sections
     $this->add_element('issue_section_comment', 'comment', array('text' => '<h4>Issues and sections</h4>'));
     $this->set_display_name('has_issues', 'Issues');
     $this->change_element_type('has_issues', 'radio', array('options' => array('no' => 'No Issues (Display posts as they are published)', 'yes' => 'Group posts into issues, like a printed magazine (note that you will need to set up at least one issue before any posts will appear)')));
     if (!$this->get_value('has_issues')) {
         $this->set_value('has_issues', 'no');
     }
     $this->set_display_name('has_sections', 'Sections');
     $this->change_element_type('has_sections', 'radio', array('options' => array('no' => 'No sections (Display posts by date)', 'yes' => 'Display posts under section headings (note that you will need to create sections for your publication)')));
     if (!$this->get_value('has_sections')) {
         $this->set_value('has_sections', 'no');
     }
     // Reminders
     $this->add_element('reminder_comment', 'comment', array('text' => '<h4>Reminders</h4>'));
     $this->set_display_name('reminder_days', 'Days Before Reminder');
     $this->add_comments('reminder_days', form_comment('How many days of inactivity before Reason sends an email reminder? Leave blank or enter 0 to disable this feature.'));
     $this->set_display_name('reminder_emails', 'Send Reminders To');
     $this->add_comments('reminder_emails', form_comment('The emails or usernames of people who should be reminded'));
     $this->add_comments('reminder_comment', form_comment(' Reason can send an email reminder if it has been a while since the last post.'));
     if (!defined('PUBLICATION_REMINDER_CRON_SET_UP') || !PUBLICATION_REMINDER_CRON_SET_UP) {
         $this->change_element_type('reminder_days', 'hidden');
         $this->change_element_type('reminder_emails', 'hidden');
         $this->change_element_type('reminder_comment', 'hidden');
     }
     //Sharing among reason sites
     if (!$this->element_is_hidden('no_share')) {
         $this->add_element('share_comment', 'comment', array('text' => '<h4>Sharing Among Reason Sites</h4>'));
     }
     $this->set_order(array('name', 'publication_type', 'posts_per_page', 'date_format', 'description', 'rss_comment', 'blog_feed_string', 'blog_feed_include_content', 'social_sharing_comment', 'enable_social_sharing', 'posting_comment', 'allow_front_end_posting', 'notify_upon_post', 'hold_posts_for_review', 'comment_comment', 'allow_comments', 'notify_upon_comment', 'hold_comments_for_review', 'issue_section_comment', 'has_issues', 'has_sections', 'reminder_comment', 'reminder_days', 'reminder_emails', 'share_comment', 'no_share', 'unique_name'));
 }
Example #29
0
 function alter_data()
 {
     $site = new entity($this->get_value('site_id'));
     if ($site->get_value('unique_name') == 'sfs_site' && !$this->get_value('job_category')) {
         $this->set_value('job_category', 'Student');
     } elseif ($site->get_value('unique_name') == 'human_resources_office_site' && !$this->get_value('job_category')) {
         $this->set_value('job_category', 'Staff');
     } elseif ($site->get_value('unique_name') == 'dean_of_the_college_office' && !$this->get_value('job_category')) {
         $this->set_value('job_category', 'Faculty');
     }
     if ($this->get_value('job_category') != 'Student') {
         //hide fields applicable to student jobs
         $this->change_element_type('supervisor', 'hidden');
         $this->change_element_type('term_job', 'hidden');
         $this->change_element_type('break_job', 'hidden');
         $this->change_element_type('dept_charge_number', 'hidden');
         $this->remove_element('author');
     }
     $this->change_element_type('content', html_editor_name($this->admin_page->site_id), html_editor_params($this->admin_page->site_id, $this->admin_page->user_id));
     $this->add_element('hr1', 'hr');
     $this->add_element('hr2', 'hr');
     $this->add_element('hr3', 'hr');
     $this->set_display_name('name', 'Title');
     $this->set_display_name('job_category', 'Position Type');
     $this->set_display_name('position_start', 'Position starts on');
     $this->set_comments('position_start', form_comment('mm/dd/yyyy'));
     $this->set_display_name('content', 'Position Information');
     $this->set_comments('content', form_comment('This should include things like the purpose of the position, an overview, the responsibilities, hours required, minimum qualifications, desired qualities, contact information, and other notes.'));
     $this->set_display_name('duration', 'How long should job be posted?');
     $this->set_display_name('posting_start', 'Posting starts on');
     $this->set_comments('posting_start', form_comment('mm/dd/yyyy'));
     $this->set_comments('duration', form_comment('Number of days'));
     $this->set_display_name('show_hide', 'Show or hide posting?');
     if (!$this->get_value('show_hide')) {
         $this->set_value('show_hide', 'show');
     }
     $this->add_required('tenure_track');
     $this->add_required('posting_start');
     $this->add_required('duration');
     $this->add_required('show_hide');
     $this->add_required('content');
     $this->add_required('job_category');
     if (!$this->get_value('tenure_track')) {
         $this->set_value('tenure_track', 'no');
     }
     if ($site->get_value('unique_name') == 'human_resources_office_site') {
         $this->change_element_type('tenure_track', 'hidden');
     } elseif ($site->get_value('unique_name') == 'dean_of_the_college_office') {
         $this->change_element_type('office', 'hidden');
     }
     $this->set_order(array('name', 'title_extension', 'office', 'position_start', 'job_category', 'hr1', 'content', 'tenure_track', 'hr2', 'posting_start', 'duration', 'show_hide', 'hr3'));
     if ($this->get_value('job_category') == 'Student') {
         $this->add_element('comment1', 'comment', array('text' => 'Position is available:'));
         $this->change_element_type('title_extension', 'hidden');
         $this->change_element_type('tenure_track', 'hidden');
         $this->set_display_name('author', 'Post Submitted By');
         $this->set_display_name('name', 'Position Title');
         $this->set_display_name('office', 'Department or Office');
         $this->set_display_name('term_job', 'During Term');
         $this->set_display_name('break_job', 'During Break');
         $this->set_display_name('content', 'Description');
         $this->set_display_name('dept_charge_number', 'Department Charge Number');
         if (!$this->get_value('duration')) {
             $this->set_value('duration', '30');
         }
         if (!$this->get_value('posting_start')) {
             $this->set_value('posting_start', time());
         }
         $this->set_order(array('name', 'office', 'dept_charge_number', 'supervisor', 'job_category', 'content', 'hr1', 'position_start', 'comment1', 'term_job', 'break_job', 'hr2', 'posting_start', 'duration', 'show_hide', 'author', 'hr3', 'unique_name'));
     }
 }
 /**
  * Called in content manager's alter_data().
  */
 function alter_data()
 {
     $this->manager->set_display_name('name', 'Title');
     $this->manager->set_display_name('datetime', 'Date Originally Recorded/Created');
     $this->manager->add_comments('datetime', form_comment('The date this work was made or released'));
     $this->manager->add_comments('description', form_comment('The brief description that will appear with the work'));
     $editor_name = html_editor_name($this->manager->admin_page->site_id);
     $wysiwyg_settings = html_editor_params($this->manager->admin_page->site_id, $this->manager->admin_page->user_id);
     $min_wysiwyg_settings = $wysiwyg_settings;
     if (strpos($editor_name, 'loki') === 0) {
         $min_wysiwyg_settings['widgets'] = array('strong', 'em', 'linebreak', 'lists', 'link');
         if (reason_user_has_privs($this->manager->admin_page->user_id, 'edit_html')) {
             $min_wysiwyg_settings['widgets'][] = 'source';
         }
     }
     $this->manager->change_element_type('description', $editor_name, $min_wysiwyg_settings);
     $this->manager->set_element_properties('description', array('rows' => 5));
     $this->manager->change_element_type('content', $editor_name, $wysiwyg_settings);
     $this->manager->set_element_properties('content', array('rows' => 12));
     $this->manager->add_comments('content', form_comment('Full content, such as a transcript of the media work. You can leave this blank if you don\'t have time to transcribe the content of the work.'));
     $this->manager->set_display_name('content', 'Transcript');
     $this->manager->change_element_type('rights_statement', $editor_name, $min_wysiwyg_settings);
     $this->manager->set_element_properties('rights_statement', array('rows' => 3));
     $this->manager->add_comments('rights_statement', form_comment('e.g. "Some rights reserved. ' . FULL_ORGANIZATION_NAME . ' licenses this work under the <a href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution 2.5 License</a>." or "Copyright Margaret Smith, 1983. All rights reserved. Used with permission." You may leave this field blank if you are not sure about what license applies to this work.'));
     $this->manager->set_display_name('show_hide', 'Show or Hide?');
     $this->manager->change_element_type('show_hide', 'radio_no_sort', array('options' => array('show' => 'Show this work on the public site', 'hide' => 'Hide this work from the public site')));
     $this->manager->add_required('show_hide');
     $show_hide_val = $this->manager->get_value('show_hide');
     if (empty($show_hide_val)) {
         $this->manager->set_value('show_hide', 'show');
     }
     $this->manager->set_display_name('author', 'Creator');
     $this->manager->add_comments('author', form_comment('The person or entity who made this work (e.g. director/producer)'));
     $this->manager->add_comments('keywords', form_comment('Help others find this by entering the key terms and ideas presented in this work.'));
     $this->manager->add_comments('transcript_status', form_comment('Choose "Published" when the transcript is finalized'));
     if ($this->manager->get_value('media_publication_datetime') && $this->manager->get_value('media_publication_datetime') != '0000-00-00 00:00:00') {
         $this->manager->change_element_type('media_publication_datetime', 'solidText', array('display_name' => 'Published'));
     }
     if (!empty($this->manager->fields_to_remove)) {
         foreach ($this->manager->fields_to_remove as $field) {
             $this->manager->remove_element($field);
         }
     }
     $this->manager->set_order($this->manager->field_order);
     $this->manager->change_element_type('tmp_file_name', 'protected');
     // Hide all of the integrated-related fields in the form
     $this->manager->change_element_type('entry_id', 'protected');
     $this->manager->change_element_type('av_type', 'protected');
     $this->manager->change_element_type('media_duration', 'protected');
     $this->manager->change_element_type('transcoding_status', 'protected');
     $this->manager->change_element_type('integration_library', 'protected');
     $this->manager->change_element_type('email_notification', 'protected');
     $this->manager->change_element_type('show_embed', 'protected');
     $this->manager->change_element_type('show_download', 'protected');
     $this->manager->change_element_type('salt', 'cloaked');
     $this->manager->change_element_type('original_filename', 'protected');
     reason_include_once('classes/media/default/displayer_chrome/default.php');
     $displayer_chrome = new DefaultDefaultDisplayerChrome();
     $displayer_chrome->set_media_work(new entity($this->manager->get_value('id')));
     $displayer_chrome->set_media_height('small');
     $html_markup = $displayer_chrome->get_html_markup();
     $es = new entity_selector();
     $es->add_type(id_of('av_file'));
     $es->add_right_relationship($this->manager->get_value('id'), relationship_id_of('av_to_av_file'));
     $results = $es->run_one();
     if (count($results) > 0) {
         $this->manager->add_element('file_preview', 'commentWithLabel', array('text' => $html_markup));
         $this->manager->set_order(array('file_preview'));
     }
 }