当前位置: 首页>>代码示例>>PHP>>正文


PHP encode_field函数代码示例

本文整理汇总了PHP中encode_field函数的典型用法代码示例。如果您正苦于以下问题:PHP encode_field函数的具体用法?PHP encode_field怎么用?PHP encode_field使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了encode_field函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_event_fields

 /**
  * get parameters for one meeting facility
  *
  * @see overlays/event.php
  *
  * @return an array of fields or NULL
  */
 function get_event_fields()
 {
     global $context;
     // returned fields
     $fields = array();
     // chairman
     $label = i18n::s('Chairman');
     $input = $this->get_chairman_input();
     $fields[] = array($label, $input);
     // number of seats
     $label = i18n::s('Seats');
     $input = $this->get_seats_input();
     $hint = i18n::s('Maximum number of participants.');
     $fields[] = array($label, $input, $hint);
     // dimdim account
     $label = i18n::s('Account');
     if (!isset($this->attributes['account'])) {
         $this->attributes['account'] = '';
     }
     $input = '<input type="text" name="account" value ="' . encode_field($this->attributes['account']) . '" />';
     $hint = sprintf(i18n::s('Enter a valid %s account'), Skin::build_link('http://www.dimdim.com/', 'DimDim', 'basic'));
     $fields[] = array($label, $input, $hint);
     // dimdim password
     $label = i18n::s('Password');
     if (!isset($this->attributes['password'])) {
         $this->attributes['password'] = '';
     }
     $input = '<input type="text" name="password" value ="' . encode_field($this->attributes['password']) . '" />';
     $fields[] = array($label, $input);
     // add these tabs
     return $fields;
 }
开发者ID:rair,项目名称:yacs,代码行数:39,代码来源:dimdim_meeting.php

示例2: get_fields

 /**
  * build the list of fields for one overlay
  *
  * @see overlays/overlay.php
  *
  * @param the hosting attributes
  * @return a list of ($label, $input, $hint)
  */
 function get_fields($host, $field_pos = NULL)
 {
     global $context;
     // the number of plates
     $label = i18n::s('Persons to be served');
     $input = '<input type="text" name="people" value ="' . encode_field($this->attributes['people']) . '" />';
     $hint = i18n::s('Try to standardize your recipes for four people');
     $fields[] = array($label, $input, $hint);
     // the time for the preparation
     $label = i18n::s('Time to prepare');
     $input = '<input type="text" name="preparation_time" value ="' . encode_field($this->attributes['preparation_time']) . '" />';
     $hint = i18n::s('Do not take into account cooking time');
     $fields[] = array($label, $input, $hint);
     // the time for cooking
     $label = i18n::s('Time to cook');
     $input = '<input type="text" name="cooking_time" value ="' . encode_field($this->attributes['cooking_time']) . '" />';
     $hint = i18n::s('Do not take into account time to heat the owen');
     $fields[] = array($label, $input, $hint);
     // the ingredients
     $label = i18n::s('Ingredients');
     $input = '<textarea name="ingredients" rows="6" cols="50">' . encode_field($this->attributes['ingredients']) . '</textarea>';
     $hint = i18n::s('Type each ingredient on one separate line starting with a \'-\' character');
     $fields[] = array($label, $input, $hint);
     return $fields;
 }
开发者ID:rair,项目名称:yacs,代码行数:33,代码来源:recipe.php

示例3: get_fields

 /**
  * preserve content across page modification
  *
  * @see overlays/overlay.php
  *
  * @param the hosting attributes
  * @return a list of ($label, $input, $hint)
  */
 function get_fields($host, $field_pos = NULL)
 {
     global $context;
     // form fields
     $fields = array();
     // item identifier
     if (!isset($this->attributes['overlay_id'])) {
         $this->attributes['overlay_id'] = '';
     }
     // only associates can change the overlay id
     if (Surfer::is_associate()) {
         // isset($host['anchor']) && ($parent =&  Anchors::get($host['anchor'])) && $parent->is_assigned()) {
         $label = i18n::s('Overlay identifier');
         $input = '<input type="text" name="overlay_id" value="' . encode_field($this->attributes['overlay_id']) . '" />';
     } else {
         $label = 'hidden';
         $input = '<input type="hidden" name="overlay_id" value="' . encode_field($this->attributes['overlay_id']) . '" />';
     }
     // hidden attributes
     foreach ($this->attributes as $name => $value) {
         if (preg_match('/_content$/', $name)) {
             $input .= '<input type="hidden" name="' . encode_field($name) . '" value="' . encode_field($value) . '" />';
         }
     }
     // we do have something to preserve
     $fields[] = array($label, $input);
     // job done
     return $fields;
 }
开发者ID:rair,项目名称:yacs,代码行数:37,代码来源:mutable.php

示例4: get_fields

 /**
  * build the list of fields for one overlay
  *
  * @see overlays/overlay.php
  *
  * @param the hosting attributes
  * @return a list of ($label, $input, $hint)
  */
 function get_fields($host, $field_pos = NULL)
 {
     global $context;
     // a placeholder for new answers
     if (!isset($this->attributes['answers']) || !is_array($this->attributes['answers'])) {
         $this->attributes['answers'] = array();
         $this->attributes['answers'][] = array(i18n::s('Answer 1'), 0);
         $this->attributes['answers'][] = array(i18n::s('Answer 2'), 0);
         $this->attributes['answers'][] = array(i18n::s('Answer 3'), 0);
     }
     // list existing answers
     if (is_array($this->attributes['answers'])) {
         foreach ($this->attributes['answers'] as $answer) {
             list($text, $count) = $answer;
             $label = i18n::s('Answer');
             $input = '<input type="text" name="answer_texts[]" size="55" value="' . encode_field($text) . '" maxlength="64" />';
             $hint = i18n::s('Delete to suppress');
             $fields[] = array($label, $input, $hint);
             $label = i18n::s('Count');
             $input = '<input type="text" name="answer_counts[]" size="10" value="' . encode_field($count) . '" maxlength="64" />';
             $fields[] = array($label, $input);
         }
     }
     // append one answer
     $label = i18n::s('Add an answer');
     $input = '<input type="text" name="answer_texts[]" size="55" maxlength="64" />';
     $hint = i18n::s('Check this is a valid answer to your question');
     $fields[] = array($label, $input, $hint);
     $label = i18n::s('Count');
     $input = '<input type="text" name="answer_counts[]" size="10" value="0" maxlength="64" />';
     $hint = i18n::s('Do not trick your polls; Start at zero');
     $fields[] = array($label, $input, $hint);
     return $fields;
 }
开发者ID:rair,项目名称:yacs,代码行数:42,代码来源:poll.php

示例5: layout

 /**
  * list articles
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return some text
     $text = '';
     // empty list
     if (!SQL::count($result)) {
         return $text;
     }
     // clear flows
     $text .= '<br style="clear: left" />';
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // get the related overlay
         $overlay = Overlay::load($item, 'article:' . $item['id']);
         // the url to view this item
         $url = Articles::get_permalink($item);
         // use the title to label the link
         if (is_object($overlay)) {
             $title = Codes::beautify_title($overlay->get_text('title', $item));
         } else {
             $title = Codes::beautify_title($item['title']);
         }
         // the hovering title
         if ($item['introduction'] && $context['skins_with_details'] == 'Y') {
             $hover = strip_tags(Codes::beautify_introduction($item['introduction']));
         } else {
             $hover = i18n::s('View the page');
         }
         // title is a link to the target article
         $title =& Skin::build_link($url, $title, 'basic', $hover);
         // use the thumbnail for this article
         if ($icon = trim($item['thumbnail_url'])) {
             // fix relative path
             if (!preg_match('/^(\\/|http:|https:|ftp:)/', $icon)) {
                 $icon = $context['url_to_root'] . $icon;
             }
             // use parameter of the control panel for this one
             $options = '';
             if (isset($context['classes_for_thumbnail_images'])) {
                 $options = 'class="' . $context['classes_for_thumbnail_images'] . '" ';
             }
             // build the complete HTML element
             $icon = '<img src="' . $icon . '" alt="" title="' . encode_field($hover) . '" ' . $options . ' />';
             // use default icon if nothing to display
         } else {
             $icon = MAP_IMG;
         }
         // use the image as a link to the target page
         $icon =& Skin::build_link($url, $icon, 'basic', $hover);
         // add a floating box
         $text .= Skin::build_box($title, $icon, 'floating');
     }
     // clear flows
     $text .= '<br style="clear: left" />';
     // end of processing
     SQL::free($result);
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:67,代码来源:layout_articles_as_titles.php

示例6: encode

 /**
  * prepare a PHP variable
  *
  * @param mixed an array of variables
  * @param we escape strings only at level 1
  * @return string the corresponding XML string
  */
 public static function encode($content, $level = 0)
 {
     // the new representation
     $text = '';
     // a string
     if (is_string($content)) {
         $text .= $content;
     } elseif (is_int($content)) {
         $text .= $content;
     } elseif (is_array($content)) {
         foreach ($content as $name => $value) {
             $name = str_replace('/', 'j', encode_field($name));
             $text .= "\t" . '<' . $name . '>' . self::encode($value, $level + 1) . '</' . $name . '>' . "\n";
         }
     }
     // we need to escape the string
     if ($level == 1 && (strpos($text, '<') !== FALSE || strpos($text, '>') !== FALSE)) {
         $text = str_replace(array('<', '>', '&'), array('&lt;', '&gt;', '&amp;'), $text);
     }
     // job done
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:29,代码来源:xml.php

示例7: encode_field

 // make an url
 $url = Categories::get_permalink($attributes);
 // gather information on this category
 $prefix = $suffix = $type = $icon = '';
 $label = Skin::strip($attributes['title']);
 // add background color to distinguish this category against others
 if (isset($attributes['background_color']) && $attributes['background_color']) {
     $label = '<span style="background-color: ' . $attributes['background_color'] . '; padding: 0 3px 0 3px;">' . $label . '</span>';
 }
 // build a unlink button for this category
 if (Surfer::is_associate()) {
     $suffix .= BR . '<form method="post" action="' . $context['script_url'] . '"><div>' . '<input type="hidden" name="anchor" value="category:' . $category_id . '" />' . '<input type="hidden" name="member" value="' . encode_field($member) . '" />' . Skin::build_submit_button(i18n::s('Unlink')) . '</div></form>';
 }
 // a button to change the thumbnail of the anchored page
 if ($icon) {
     $suffix .= ' <form method="post" action="' . $context['url_to_root'] . 'categories/set_as_thumbnail.php"><div>' . '<input type="hidden" name="anchor" value="' . encode_field($member) . '" />' . '<input type="hidden" name="id" value="' . $category_id . '" />' . Skin::build_submit_button(i18n::s('Use this thumbnail as the thumbnail of the page')) . '</div></form>';
 }
 // list sub-categories to be linked, if any
 // display active and restricted items
 $where = "categories.active='Y'";
 if (Surfer::is_member()) {
     $where .= " OR categories.active='R'";
 }
 if (Surfer::is_associate()) {
     $where .= " OR categories.active='N'";
 }
 // only consider live categories
 $where = '(' . $where . ')' . ' AND ((categories.expiry_date is NULL)' . "\tOR (categories.expiry_date <= '" . NULL_DATE . "') OR (categories.expiry_date > '" . $context['now'] . "'))";
 // limit the query to top level only
 $query = "SELECT categories.id, categories.title " . " FROM " . SQL::table_name('categories') . " AS categories " . " WHERE (" . $where . ") AND (categories.anchor='category:" . $category_id . "')" . " ORDER BY categories.title";
 $result = SQL::query($query);
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:select.php

示例8: foreach

 $message = Mailer::build_multipart($text);
 // reply-to: from the letters configuration file
 if (isset($context['letter_reply_to']) && $context['letter_reply_to']) {
     $headers[] = 'Reply-To: ' . $context['letter_reply_to'];
 }
 // list and count recipients
 $recipients_errors = $recipients_processed = $recipients_ok = 0;
 if (is_array($to)) {
     $context['text'] .= i18n::s('A message has been sent to:') . "\n" . '<ul>' . "\n";
     foreach ($to as $address) {
         $context['text'] .= '<li>' . encode_field($address) . '</li>' . "\n";
     }
     $context['text'] .= '</ul>' . "\n";
     $recipients_processed = count($to);
 } elseif ($to) {
     $context['text'] .= i18n::s('A message has been sent to:') . ' ' . encode_field($to) . BR . "\n";
     $recipients_processed = 1;
 } else {
     $context['text'] .= '<b>' . i18n::s('No recipient has been defined.') . "</b>" . BR . "\n";
 }
 // do the job
 if ($recipients_processed) {
     $recipients_ok = Mailer::post($from, $to, $subject, $message, NULL, $headers);
     Mailer::close();
     // we may have more recipients than expected
     if ($recipients_ok > $recipients_processed) {
         $recipients_processed = $recipients_ok;
     }
     // reports on error
     $recipients_errors = $recipients_processed - $recipients_ok;
     if ($recipients_errors || count($context['error'])) {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:new.php

示例9: sprintf

// the current avatar, if any
if (isset($item['avatar_url']) && $item['avatar_url']) {
    $context['text'] .= '<p>' . sprintf(i18n::s('Current picture: %s'), BR . '<img src="' . $item['avatar_url'] . '" alt="" style="avatar" />') . '</p>' . "\n";
} else {
    $context['text'] .= '<p>' . i18n::s('No picture has been set for this profile.') . '</p>';
}
// list available avatars, except on error
if (!count($context['error']) && isset($item['id'])) {
    // upload an image
    //
    if (Images::allow_creation($item, null, 'user')) {
        // the form to post an image
        $text = '<form method="post" action="' . $context['url_to_root'] . 'images/edit.php" id="main_form" enctype="multipart/form-data"><div>' . '<input type="hidden" name="anchor" value="user:' . $item['id'] . '" />' . '<input type="hidden" name="action" value="set_as_avatar" />';
        $fields = array();
        // the image
        $text .= '<input type="file" name="upload" id="upload" size="30" accesskey="i" title="' . encode_field(i18n::s('Press to select a local file')) . '" />';
        $text .= ' ' . Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's');
        $text .= BR . '<span class="details">' . i18n::s('Select a .png, .gif or .jpeg image.') . ' (&lt;&nbsp;' . Skin::build_number($image_maximum_size, i18n::s('bytes')) . ')</span>';
        // end of the form
        $text .= '</div></form>';
        // the script used for form handling at the browser
        Page::insert_script('$("#upload").focus();');
        $context['text'] .= Skin::build_content(NULL, i18n::s('Upload an image'), $text);
    }
    // use the library
    //
    // where images are
    $path = 'skins/_reference/avatars';
    // browse the path to list directories and files
    if ($dir = Safe::opendir($context['path_to_root'] . $path)) {
        $text = '';
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:select_avatar.php

示例10: layout

 /**
  * list users
  *
  * @param resource the SQL result
  * @return string the rendered text
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return some text
     $text = '';
     // empty list
     if (!($count = SQL::count($result))) {
         return $text;
     }
     // allow for several lists in the same page
     static $serial;
     if (isset($serial)) {
         $serial++;
     } else {
         $serial = 1;
     }
     // don't blast too many people
     if ($count > 100) {
         $checked = '';
     } elseif (isset($this->layout_variant) && $this->layout_variant == 'unchecked') {
         $checked = '';
     } else {
         $checked = ' checked="checked"';
     }
     // div prefix
     $text .= '<div id="users_as_mail_panel_' . $serial . '">';
     // allow to select/deslect multiple rows at once
     $text .= '<input type="checkbox" class="row_selector" onclick="check_user_as_mail_panel_' . $serial . '(\'div#users_as_mail_panel_' . $serial . '\', this);"' . $checked . ' /> ' . i18n::s('Select all/none') . BR;
     // process all items in the list
     $count = 0;
     while ($item = SQL::fetch($result)) {
         // we need some address
         if (!$item['email']) {
             continue;
         }
         // do not write to myself
         if ($item['id'] == Surfer::get_id()) {
             continue;
         }
         // get the related overlay, if any
         $overlay = Overlay::load($item, 'user:' . $item['id']);
         // column to select the row
         $text .= '<input type="checkbox" name="selected_users[]" class="row_selector" value="' . encode_field($item['email']) . '"' . $checked . ' />';
         // signal restricted and private users
         if ($item['active'] == 'N') {
             $text .= PRIVATE_FLAG;
         } elseif ($item['active'] == 'R') {
             $text .= RESTRICTED_FLAG;
         }
         // the url to view this item
         $url = Users::get_permalink($item);
         // use the title to label the link
         if (is_object($overlay)) {
             $title = Codes::beautify_title($overlay->get_text('title', $item));
         } else {
             $title = Codes::beautify_title($item['full_name']);
         }
         // sanity check
         if (!$title) {
             $title = $item['nick_name'];
         }
         // link to this page
         $text .= Skin::build_link($url, $title, 'user');
         // the introductory text
         if ($item['introduction']) {
             $text .= '<span class="tiny"> - ' . Codes::beautify_introduction($item['introduction']) . '</span>';
         }
         // insert overlay data, if any
         if (is_object($overlay)) {
             $text .= $overlay->get_text('list', $item);
         }
         // display all tags
         if ($item['tags']) {
             $text .= ' <span class="tags">' . Skin::build_tags($item['tags'], 'user:' . $item['id']) . '</span>';
         }
         // append the row
         $text .= BR;
         $count++;
     }
     // the script used to check all items at once
     Page::insert_script('function check_user_as_mail_panel_' . $serial . '(scope, handle) {' . "\n" . '	$(scope + " input[type=\'checkbox\'].row_selector").each(' . "\n" . '		function() { $(this).attr("checked", $(handle).is(":checked"));}' . "\n" . '	);' . "\n" . '}' . "\n");
     // div suffix
     $text .= '</div>';
     // no valid account has been found
     if (!$count) {
         $text = '';
     }
     // end of processing
     SQL::free($result);
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:99,代码来源:layout_users_as_mail.php

示例11: encode_field

    }
    // permission denied to authenticated user
    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    Logger::error(i18n::s('You are not allowed to perform this operation.'));
    // describe the section
} else {
    // compute the url for this section
    $url = Sections::get_permalink($item);
    // get a description
    if ($item['introduction']) {
        $description = Codes::beautify($item['introduction']);
    } else {
        $description = Skin::strip(Codes::beautify($item['description']), 50);
    }
    // prepare the response
    $text = '<?xml version="1.0" encoding="' . $context['charset'] . '"?>' . "\n" . '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">' . "\n" . '	<rdf:Description rdf:about="' . $url . '">' . "\n" . '		<dc:title>' . encode_field($item['title']) . '</dc:title>' . "\n" . '		<dc:description>' . encode_field(Skin::strip($description)) . '</dc:description>' . "\n" . '		<dc:date>' . gmdate('Y-m-d') . '</dc:date>' . "\n" . '		<dc:format>text/html</dc:format>' . "\n";
    if (isset($item['language']) && $item['language'] && $item['language'] != 'none') {
        $text .= '		<dc:language>' . $item['language'] . '</dc:language>' . "\n";
    }
    $text .= '	</rdf:Description>' . "\n" . '</rdf:RDF>';
    //
    // transfer to the user agent
    //
    // handle the output correctly
    render_raw('text/xml; charset=' . $context['charset']);
    // suggest a name on download
    if (!headers_sent()) {
        $file_name = utf8::to_ascii(Skin::strip($context['page_title']) . '.opml.xml');
        Safe::header('Content-Disposition: inline; filename="' . str_replace('"', '', $file_name) . '"');
    }
    // enable 30-minute caching (30*60 = 1800), even through https, to help IE6 on download
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:describe.php

示例12: layout


//.........这里部分代码省略.........
         // signal locked profiles
         if ($item['capability'] == '?') {
             $prefix .= EXPIRED_FLAG;
         }
         // item title
         if ($item['full_name']) {
             $title = ucfirst(Skin::strip($item['full_name'], 10));
             $hover = $item['nick_name'];
         } else {
             $title = ucfirst(Skin::strip($item['nick_name'], 10));
             $hover = $item['full_name'];
         }
         // show contact information
         if (Surfer::may_contact()) {
             $suffix .= Users::build_presence($item);
         }
         // the introduction
         if ($item['introduction']) {
             if (is_callable(array('codes', 'beautify'))) {
                 $suffix .= ' -&nbsp;' . Codes::beautify($item['introduction']);
             } else {
                 $suffix .= ' -&nbsp;' . $item['introduction'];
             }
         }
         // display all tags
         if ($item['tags']) {
             $suffix .= ' <span class="tags">' . Skin::build_tags($item['tags'], 'user:' . $item['id']) . '</span>';
         }
         // details
         $details = array();
         // capability
         if ($item['capability'] == 'A') {
             $details[] = i18n::s('Associate');
         } elseif ($item['capability'] == 'S') {
             $details[] = i18n::s('Subscriber');
         } else {
             $details[] = i18n::s('Member');
         }
         // creation date
         if ($item['create_date']) {
             $details[] = sprintf(i18n::s('registered %s'), Skin::build_date($item['create_date']));
         }
         // last login
         if ($this->layout_variant == 'dates') {
             if (isset($item['login_date']) && $item['login_date'] > NULL_DATE) {
                 $address = '';
                 if ($item['login_address']) {
                     $address = ' (' . $item['login_address'] . ')';
                 }
                 $details[] = sprintf(i18n::s('last login %s'), Skin::build_date($item['login_date']) . $address);
             } else {
                 $details[] = i18n::s('no login');
             }
         }
         // last post
         if ($this->layout_variant == 'dates') {
             if (isset($item['post_date']) && $item['post_date'] > NULL_DATE) {
                 $details[] = sprintf(i18n::s('last post %s'), Skin::build_date($item['post_date']));
             }
         }
         // posts
         if (intval($item['posts']) > 1) {
             $details[] = sprintf(i18n::s('%d posts'), intval($item['posts']));
         }
         if (count($details)) {
             if ($this->layout_variant == 'full') {
                 $suffix .= ' <span class="details">(' . implode(', ', $details) . ')</span>';
             } else {
                 $suffix .= ' <span class="details">' . implode(', ', $details) . '</span>';
             }
         }
         // flag idle users
         if (isset($item['click_date']) && $item['click_date'] < $idle) {
             $class = 'idle user';
         } else {
             $class = 'user';
         }
         // item summary
         $box .= $prefix . Skin::build_link($url, $title, 'user') . $suffix;
         // use the avatar, if any
         if (isset($item['avatar_url']) && isset($context['users_with_avatars']) && $context['users_with_avatars'] == 'Y') {
             $icon = $item['avatar_url'];
         }
         // layout this item
         if ($icon) {
             // build the complete HTML element
             $icon = '<img src="' . $icon . '" alt="" title="' . encode_field(strip_tags($title)) . '" />';
             // make it a clickable link
             $icon = Skin::build_link($url, $icon, 'basic');
             $list = array(array($box, $icon));
             $items[] = array($item['score'], Skin::finalize_list($list, 'decorated'));
             // put the item in a division
         } else {
             $items[] = array($item['score'], '<div style="margin: 0 0 1em 0">' . $box . '</div>');
         }
     }
     // end of processing
     SQL::free($result);
     return $items;
 }
开发者ID:rair,项目名称:yacs,代码行数:101,代码来源:layout_users_as_search.php

示例13: array

 $input .= BR . '<input type="radio" name="root_featured_layout" value="none"';
 if (isset($context['root_featured_layout']) && $context['root_featured_layout'] == 'none') {
     $input .= ' checked="checked"';
 }
 $input .= '/> ' . i18n::s('Do not list featured pages.');
 $fields[] = array($label, $input);
 // news can be either a static or an animated list
 $label = i18n::s('News');
 if (!isset($context['root_news_count']) || $context['root_news_count'] < 1 || $context['root_news_count'] > 7) {
     $context['root_news_count'] = 5;
 }
 $input = '<input type="radio" name="root_news_layout" value="static"';
 if (!isset($context['root_news_layout']) || !preg_match('/(rotate|scroll|none)/', $context['root_news_layout'])) {
     $input .= ' checked="checked"';
 }
 $input .= '/> ' . sprintf(i18n::s('List up to %s news aside.'), '<input type="text" name="root_news_count" value="' . encode_field($context['root_news_count']) . '" size="2" />');
 $input .= BR . '<input type="radio" name="root_news_layout" value="scroll"';
 if (isset($context['root_news_layout']) && $context['root_news_layout'] == 'scroll') {
     $input .= ' checked="checked"';
 }
 $input .= '/> ' . i18n::s('Similar to the first option, except that displayed information is scrolling.');
 $input .= BR . '<input type="radio" name="root_news_layout" value="rotate"';
 if (isset($context['root_news_layout']) && $context['root_news_layout'] == 'rotate') {
     $input .= ' checked="checked"';
 }
 $input .= '/> ' . i18n::s('Similar to the first option, except that news are rotated.');
 $input .= BR . '<input type="radio" name="root_news_layout" value="none"';
 if (isset($context['root_news_layout']) && $context['root_news_layout'] == 'none') {
     $input .= ' checked="checked"';
 }
 $input .= '/> ' . i18n::s('Do not list news.');
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:configure.php

示例14: sprintf

 // the splash message
 $inbound .= '<p>' . sprintf(i18n::s('To extend the list of feeders add adequate %s.'), Skin::build_link('servers/', i18n::s('server profiles'), 'shortcut')) . "</p>\n";
 // feeding period
 if (!isset($context['minutes_between_feeds']) || !$context['minutes_between_feeds']) {
     $context['minutes_between_feeds'] = 60;
 }
 $label = i18n::s('Feeding period');
 $input = '<input type="text" name="minutes_between_feeds" size="10" value="' . encode_field($context['minutes_between_feeds']) . '" maxlength="5" />';
 $hint = i18n::s('In minutes. 60 means one hour, etc. Minimum value is 5 minutes');
 $fields[] = array($label, $input, $hint);
 // maximum_news
 if (!isset($context['maximum_news']) || !$context['maximum_news']) {
     $context['maximum_news'] = 1000;
 }
 $label = i18n::s('Maximum news');
 $input = '<input type="text" name="maximum_news" size="10" value="' . encode_field($context['maximum_news']) . '" maxlength="5" />';
 $hint = i18n::s('Oldest news entries will be deleted');
 $fields[] = array($label, $input, $hint);
 // debug_feeds
 $label = i18n::s('Debug feeds');
 $checked = '';
 if (isset($context['debug_feeds']) && $context['debug_feeds'] == 'Y') {
     $checked = 'checked="checked" ';
 }
 $input = '<input type="checkbox" name="debug_feeds" value="Y" ' . $checked . '/> ' . i18n::s('Save data sent and received in temporary/debug.txt');
 $hint = i18n::s('Use this option only for troubleshooting');
 $fields[] = array($label, $input, $hint);
 // build the form
 $inbound .= Skin::build_form($fields);
 $fields = array();
 //
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:configure.php

示例15: fpassthru

                    return;
                }
                // actual transmission except on a HEAD request
                if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
                    fpassthru($handle);
                }
                fclose($handle);
            }
            // the post-processing hook, then exit even on HEAD
            finalize_page();
            return;
        }
        // redirect to the actual file
        $target_href = $context['url_to_home'] . $context['url_to_root'] . Files::get_path($item['anchor']) . '/' . rawurlencode($item['file_name']);
    }
    // let the web server provide the actual file
    if (!headers_sent()) {
        Safe::header('Status: 302 Found', TRUE, 302);
        Safe::header('Location: ' . $target_href);
        // this one may be blocked by anti-popup software
    } else {
        $context['site_head'] .= '<meta http-equiv="Refresh" content="1;url=' . $target_href . '" />' . "\n";
    }
    // help the surfer
    $context['text'] .= '<p>' . i18n::s('You are requesting the following file:') . '</p>' . "\n";
    $context['text'] .= '<p><a href="' . encode_field($target_href) . '">' . basename($target_href) . '</a></p>' . "\n";
    // automatic or not
    $context['text'] .= '<p>' . i18n::s('The download should start automatically within seconds. Else hit the provided link to trigger it manually.') . '</p>' . "\n";
}
// render the skin
render_skin();
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:fetch.php


注:本文中的encode_field函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。