本文整理汇总了PHP中form_comment函数的典型用法代码示例。如果您正苦于以下问题:PHP form_comment函数的具体用法?PHP form_comment怎么用?PHP form_comment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_comment函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: alter_data
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'));
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:7,代码来源:site_type.php
示例2: alter_data
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();
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:26,代码来源:asset.php
示例3: on_every_time
/**
* @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
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:11,代码来源:migrator_screen_6.php
示例4: alter_data
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'));
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:51,代码来源:google_map.php
示例5: alter_data
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);
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:14,代码来源:quote.php
示例6: run
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";
}
}
}
开发者ID:natepixel,项目名称:reason_package,代码行数:49,代码来源:active_users.php
示例7: social_account_on_every_time
/**
* 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));
}
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:18,代码来源:linkedin.php
示例8: social_account_on_every_time
/**
* 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));
}
}
开发者ID:natepixel,项目名称:reason_package,代码行数:20,代码来源:googleplus.php
示例9: run
/**
* 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";
}
开发者ID:natepixel,项目名称:reason_package,代码行数:46,代码来源:review_changes.php
示例10: on_every_time
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());
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:21,代码来源:migrator_screen_3.php
示例11: on_every_time
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());
}
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:24,代码来源:SetupForm.php
示例12: on_every_time
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();
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:19,代码来源:classified_view.php
示例13: form_comment
</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
开发者ID:grchis,项目名称:Site-Auto,代码行数:31,代码来源:comment_list_d.php
示例14: alter_data
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'));
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:6,代码来源:event_slot_registration.php
示例15: do_basic_kaltura_field_modification
/**
* 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', '');
}
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:32,代码来源:media_work_content_manager_modifier.php
示例16: add_relationship_element
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;
//.........这里部分代码省略.........
开发者ID:hunter2814,项目名称:reason_package,代码行数:101,代码来源:disco.php
示例17: _add_file_upload_element
/**
* 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');
}
}
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:17,代码来源:media_work_content_manager_modifier.php
示例18: _get_form
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;
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:48,代码来源:kaltura_import.php
示例19: social_account_on_every_time
/**
* 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));
}
}
}
开发者ID:natepixel,项目名称:reason_package,代码行数:24,代码来源:facebook.php
示例20: alter_data
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.'));
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:6,代码来源:audience.php
注:本文中的form_comment函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论