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


PHP utf8::strtoupper方法代码示例

本文整理汇总了PHP中utf8::strtoupper方法的典型用法代码示例。如果您正苦于以下问题:PHP utf8::strtoupper方法的具体用法?PHP utf8::strtoupper怎么用?PHP utf8::strtoupper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utf8的用法示例。


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

示例1: _ucfirst

/**
 * utf8::ucfirst
 *
 * @package    Core
 * @author     Kohana Team
 * @copyright  (c) 2007 Kohana Team
 * @copyright  (c) 2005 Harry Fuecks
 * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
 */
function _ucfirst($str)
{
    if (utf8::is_ascii($str)) {
        return ucfirst($str);
    }
    preg_match('/^(.?)(.*)$/us', $str, $matches);
    return utf8::strtoupper($matches[1]) . $matches[2];
}
开发者ID:darkcolonist,项目名称:kohana234-doctrine115,代码行数:17,代码来源:ucfirst.php

示例2: request

 /**
  * Method that allows sending any kind of HTTP request to remote url
  *
  * @param string $method
  * @param string $url
  * @param array $headers
  * @param array $data
  * @return HTTP_Response
  */
 public static function request($method, $url, $headers = array(), $data = array())
 {
     $valid_methods = array('POST', 'GET', 'PUT', 'DELETE');
     $method = utf8::strtoupper($method);
     if (!valid::url($url, 'http')) {
         return FALSE;
     }
     if (!in_array($method, $valid_methods)) {
         return FALSE;
     }
     // Get the hostname and path
     $url = parse_url($url);
     if (empty($url['path'])) {
         // Request the root document
         $url['path'] = '/';
     }
     // Open a remote connection
     $remote = fsockopen($url['host'], 80, $errno, $errstr, 5);
     if (!is_resource($remote)) {
         return FALSE;
     }
     // Set CRLF
     $CRLF = "\r\n";
     $path = $url['path'];
     if ($method == 'GET' and !empty($url['query'])) {
         $path .= '?' . $url['query'];
     }
     $headers_default = array('Host' => $url['host'], 'Connection' => 'close', 'User-Agent' => 'Ushahidi Scheduler (+http://ushahidi.com/)');
     $body_content = '';
     if ($method != 'GET') {
         $headers_default['Content-Type'] = 'application/x-www-form-urlencoded';
         if (count($data) > 0) {
             $body_content = http_build_query($data);
         }
         $headers_default['Content-Length'] = strlen($body_content);
     }
     $headers = array_merge($headers_default, $headers);
     // Send request
     $request = $method . ' ' . $path . ' HTTP/1.0' . $CRLF;
     foreach ($headers as $key => $value) {
         $request .= $key . ': ' . $value . $CRLF;
     }
     // Send one more CRLF to terminate the headers
     $request .= $CRLF;
     if ($body_content) {
         $request .= $body_content . $CRLF;
     }
     fwrite($remote, $request);
     $response = '';
     while (!feof($remote)) {
         // Get 1K from buffer
         $response .= fread($remote, 1024);
     }
     // Close the connection
     fclose($remote);
     return new HTTP_Response($response, $method);
 }
开发者ID:pablohernandezb,项目名称:reportachacao-server,代码行数:66,代码来源:MY_remote.php

示例3: __construct

 function __construct($filehandle)
 {
     $this->filehandle = $filehandle;
     // 1000 chars is max line length
     if (($fields = fgetcsv($filehandle, 1000)) !== FALSE) {
         $colnum = 0;
         foreach ($fields as $field) {
             $this->colnames[utf8::strtoupper($field)] = $colnum;
             $colnum++;
         }
     }
 }
开发者ID:Dirichi,项目名称:Ushahidi_Web,代码行数:12,代码来源:Csvtable.php

示例4: index

 /**
  * Function: index
  *
  * Description: This is the function that renders and stores the settings for the enhanced map
  *
  * Params(POST)
  * - adminmap_height - CSS specification of the height of the map
  * - adminmap_width - CSS specification of the width of the map
  * - enable_bigmap - Is the front end big map enabled?
  * - enable_printmap - Is the print map enabled
  * - enable_iframemap - Is the iframe map enabled
  * - adminmap_height - The height of the admin map
  * - show_unapproved_backend - Should unapproved reports be shown on the back end map
  * - show_unapproved_frontend - Should unapproved reports be shown on the front end map
  * - show_hidden_categories_backend - Should hidden categories be shown on the back end map
  *
  * Views: enhancedmap/enhancedmap_settings
  *
  * Results: Enhanced map settings are updated.
  */
 public function index()
 {
     $this->template->content = new View('enhancedmap/enhancedmap_settings');
     $this->template->content->errors = array();
     $this->template->content->form_saved = false;
     $this->template->content->yesno_array = array('true' => utf8::strtoupper(Kohana::lang('ui_main.yes')), 'false' => utf8::strtoupper(Kohana::lang('ui_main.no')));
     $form = array();
     // check, has the form been submitted, if so, setup validation
     if ($_POST) {
         //print_r($_POST);
         //echo "<br><br/>";
         $post = new Validation($_POST);
         // Add some filters
         $post->pre_filter('trim', TRUE);
         // Add some rules, the input field, followed by a list of checks, carried out in order
         $post->add_rules('adminmap_height', 'required', 'length[1,99]');
         $post->add_rules('adminmap_width', 'required', 'length[1,99]');
         /*
         $post->add_rules('enable_bigmap','required','in_array["true", "false"]');
         $post->add_rules('enable_printmap','required','in_array[\'true\', \'false\']');
         $post->add_rules('enable_iframemap','required','in_array[\'true\', \'false\']');
         $post->add_rules('adminmap_height','required','in_array[\'true\', \'false\']');
         $post->add_rules('show_unapproved_backend','required','in_array[\'true\', \'false\']');
         $post->add_rules('show_unapproved_frontend','required','in_array[\'true\', \'false\']');
         $post->add_rules('show_hidden_categories_backend','required','in_array[\'true\', \'false\']');
         */
         if ($post->validate()) {
             // Yes! everything is valid
             //load in the settings from the DB
             //load up all the settings
             $settings = ORM::factory('enhancedmap_settings')->find_all();
             foreach ($settings as $setting) {
                 $setting->value = $_POST[$setting->key];
                 $setting->save();
             }
             $form = $_POST;
             $this->template->content->form_saved = true;
         } else {
             // repopulate the form fields
             $form = $_POST;
             // populate the error fields, if any
             $this->template->content->errors = $post->errors('settings');
         }
     } else {
         //load up all the settings
         $settings = ORM::factory('enhancedmap_settings')->find_all();
         foreach ($settings as $setting) {
             $form[$setting->key] = $setting->value;
         }
     }
     $this->template->content->form = $form;
 }
开发者ID:rjmackay,项目名称:enhancedmap,代码行数:72,代码来源:enhancedmap_settings.php

示例5: index

 /**
  * Lists the checkins
  */
 function index()
 {
     $this->template->content = new View('admin/checkins/main');
     $this->template->content->title = Kohana::lang('ui_admin.checkins');
     // check, has the form been submitted?
     $form_error = FALSE;
     $form_saved = FALSE;
     $form_action = '';
     $filter = '1=1';
     // Form submission wizardry
     // check, has the form been submitted, if so, setup validation
     if ($_POST) {
         // Instantiate Validation, use $post, so we don't overwrite $_POST fields with our own things
         $post = Validation::factory($_POST);
         //  Add some filters
         $post->pre_filter('trim', TRUE);
         // Add some rules, the input field, followed by a list of checks, carried out in order
         $post->add_rules('action', 'required', 'alpha', 'length[1,1]');
         $post->add_rules('message_id.*', 'required', 'numeric');
         // Test to see if things passed the rule checks
         if ($post->validate()) {
             if ($post->action == 'd') {
                 foreach ($post->checkin_id as $checkin_id) {
                     // Delete Checkin
                     ORM::factory('checkin')->delete($checkin_id);
                 }
                 $form_saved = TRUE;
                 $form_action = utf8::strtoupper(Kohana::lang('ui_admin.deleted'));
             }
         } else {
             // repopulate the form fields
             $form = arr::overwrite($form, $post->as_array());
             // populate the error fields, if any
             $errors = arr::overwrite($errors, $post->errors('checkin'));
             $form_error = TRUE;
         }
     }
     // Pagination
     $pagination = new Pagination(array('query_string' => 'page', 'items_per_page' => $this->items_per_page, 'total_items' => ORM::factory('checkin')->join('users', 'checkin.user_id', 'users.id', 'INNER')->where($filter)->count_all()));
     $checkins = ORM::factory('checkin')->join('users', 'checkin.user_id', 'users.id', 'INNER')->where($filter)->orderby('checkin_date', 'desc')->find_all($this->items_per_page, $pagination->sql_offset);
     $this->template->content->checkins = $checkins;
     $this->template->content->pagination = $pagination;
     $this->template->content->form_error = $form_error;
     $this->template->content->form_saved = $form_saved;
     $this->template->content->form_action = $form_action;
     $this->template->content->total_items = $pagination->total_items;
     // Javascript Header
     $this->themes->js = new View('admin/checkins/checkins_js');
 }
开发者ID:rjmackay,项目名称:Ushahidi_Web,代码行数:52,代码来源:checkins.php

示例6: generate_challenge

 /**
  * Generates a new Captcha challenge.
  *
  * @return string The challenge answer
  */
 public function generate_challenge()
 {
     // Load words from the current language and randomize them
     $words = Kohana::config('captcha.words');
     shuffle($words);
     // Loop over each word...
     foreach ($words as $word) {
         // ...until we find one of the desired length
         if (abs(Captcha::$config['complexity'] - utf8::strlen($word)) < 2) {
             return utf8::strtoupper($word);
         }
     }
     // Return any random word as final fallback
     return utf8::strtoupper($words[array_rand($words)]);
 }
开发者ID:upers,项目名称:kwartira.com,代码行数:20,代码来源:Word.php

示例7: index

 /**
  * Lists the reports.
  * @param int $page
  */
 public function index($page = 1)
 {
     $this->template->content = new View('members/reports');
     $this->template->content->title = Kohana::lang('ui_admin.reports');
     if (!empty($_GET['status'])) {
         $status = $_GET['status'];
         if (strtolower($status) == 'a') {
             $filter = 'incident_active = 0';
         } elseif (strtolower($status) == 'v') {
             $filter = 'incident_verified = 0';
         } else {
             $status = "0";
             $filter = '1=1';
         }
     } else {
         $status = "0";
         $filter = "1=1";
     }
     // Get Search Keywords (If Any)
     if (isset($_GET['k'])) {
         // Brute force input sanitization
         // Phase 1 - Strip the search string of all non-word characters
         $keyword_raw = preg_replace('/[^\\w+]\\w*/', '', $_GET['k']);
         // Strip any HTML tags that may have been missed in Phase 1
         $keyword_raw = strip_tags($keyword_raw);
         // Phase 3 - Invoke Kohana's XSS cleaning mechanism just incase an outlier wasn't caught
         // in the first 2 steps
         $keyword_raw = $this->input->xss_clean($keyword_raw);
         $filter .= " AND (" . $this->_get_searchstring($keyword_raw) . ")";
     } else {
         $keyword_raw = "";
     }
     // Check, has the form been submitted?
     $form_error = FALSE;
     $form_saved = FALSE;
     $form_action = "";
     if ($_POST) {
         // Setup validation
         $post = Validation::factory($_POST);
         //	 Add some filters
         $post->pre_filter('trim', TRUE);
         // Add some rules, the input field, followed by a list of checks, carried out in order
         $post->add_rules('action', 'required', 'alpha', 'length[1,1]');
         $post->add_rules('incident_id.*', 'required', 'numeric');
         if ($post->validate()) {
             // Delete Action
             if ($post->action == 'd') {
                 foreach ($post->incident_id as $item) {
                     $update = ORM::factory('incident')->where('user_id', $this->user->id)->find($item);
                     if ($update->loaded == true) {
                         $incident_id = $update->id;
                         $location_id = $update->location_id;
                         $update->delete();
                     }
                 }
                 $form_action = utf8::strtoupper(Kohana::lang('ui_admin.deleted'));
             }
             $form_saved = TRUE;
         } else {
             $form_error = TRUE;
         }
     }
     // Pagination
     $pagination = new Pagination(array('query_string' => 'page', 'items_per_page' => intval(Kohana::config('settings.items_per_page_admin')), 'total_items' => ORM::factory('incident')->join('location', 'incident.location_id', 'location.id', 'INNER')->where($filter)->where('user_id', $this->user->id)->count_all()));
     $incidents = ORM::factory('incident')->join('location', 'incident.location_id', 'location.id', 'INNER')->where($filter)->where('user_id', $this->user->id)->orderby('incident_dateadd', 'desc')->find_all((int) Kohana::config('settings.items_per_page_admin'), $pagination->sql_offset);
     $location_ids = array();
     $country_ids = array();
     foreach ($incidents as $incident) {
         $location_ids[] = $incident->location_id;
     }
     // Check if location_ids is not empty
     if (count($location_ids) > 0) {
         $locations_result = ORM::factory('location')->in('id', implode(',', $location_ids))->find_all();
         $locations = array();
         foreach ($locations_result as $loc) {
             $locations[$loc->id] = $loc->location_name;
             $country_ids[$loc->id]['country_id'] = $loc->country_id;
         }
     } else {
         $locations = array();
     }
     $this->template->content->locations = $locations;
     $this->template->content->country_ids = $country_ids;
     // GET countries
     $countries = array();
     foreach (ORM::factory('country')->orderby('country')->find_all() as $country) {
         // Create a list of all categories
         $this_country = $country->country;
         if (strlen($this_country) > 35) {
             $this_country = substr($this_country, 0, 35) . "...";
         }
         $countries[$country->id] = $this_country;
     }
     $this->template->content->countries = $countries;
     $this->template->content->incidents = $incidents;
     $this->template->content->pagination = $pagination;
//.........这里部分代码省略.........
开发者ID:pablohernandezb,项目名称:reportachacao-server,代码行数:101,代码来源:reports.php

示例8: array

    $description = $role->description;
    $access_level = $role->access_level;
    $role_permissions = array();
    foreach ($role->permissions as $perm) {
        $role_permissions[] = $perm->name;
    }
    ?>
									<tr>
										
										<td class="col-1">
											&nbsp;
										</td>
										<td class="col-2">
											<div class="post">
												<h4><?php 
    echo utf8::strtoupper($name);
    ?>
</h4>
												<p><?php 
    echo $description;
    ?>
</p>
											</div>
										</td>
										<td class="col-3">&nbsp;</td>
										<td class="col-4">
											<?php 
    if ($role_id == 1 or $role_id == 3 or $role_id == 4) {
        echo "&nbsp;";
    } else {
        ?>
开发者ID:niiyatii,项目名称:crowdmap,代码行数:31,代码来源:roles.php

示例9: verify

 /**
  * Verifies a previously sent alert confirmation code
  */
 public function verify()
 {
     // Define error codes for this view.
     define("ER_CODE_VERIFIED", 0);
     define("ER_CODE_NOT_FOUND", 1);
     define("ER_CODE_ALREADY_VERIFIED", 3);
     $code = (isset($_GET['c']) and !empty($_GET['c'])) ? $_GET['c'] : "";
     $email = (isset($_GET['e']) and !empty($_GET['e'])) ? $_GET['e'] : "";
     // HT: Mobile verification by url
     $mobile = (isset($_GET['m']) and !empty($_GET['m'])) ? $_GET['m'] : "";
     // INITIALIZE the content's section of the view
     $this->template->content = new View('alerts/verify');
     $this->template->header->this_page = 'alerts';
     $filter = " ";
     $missing_info = FALSE;
     if ($_POST and isset($_POST['alert_code']) and !empty($_POST['alert_code'])) {
         if (isset($_POST['alert_mobile']) and !empty($_POST['alert_mobile'])) {
             $filter = "alert.alert_type=1 AND alert_code='" . Database::instance()->escape_str(utf8::strtoupper($_POST['alert_code'])) . "' AND alert_recipient='" . Database::instance()->escape_str($_POST['alert_mobile']) . "' ";
         } elseif (isset($_POST['alert_email']) and !empty($_POST['alert_email'])) {
             $filter = "alert.alert_type=2 AND alert_code='" . Database::instance()->escape_str($_POST['alert_code']) . "' AND alert_recipient='" . Database::instance()->escape_str($_POST['alert_email']) . "' ";
         } else {
             $missing_info = TRUE;
         }
     } else {
         //if (empty($code) OR empty($email))
         if (empty($code) or empty($email) and empty($mobile)) {
             $missing_info = TRUE;
         } else {
             if (!empty($email)) {
                 // HT: condition to check email alert
                 $filter = "alert.alert_type=2 AND alert_code='" . Database::instance()->escape_str($code) . "' AND alert_recipient='" . Database::instance()->escape_str($email) . "' ";
             } elseif (!empty($mobile)) {
                 // HT: condition to check mobile alert
                 $filter = "alert.alert_type=1 AND alert_code='" . Database::instance()->escape_str(utf8::strtoupper($code)) . "' AND alert_recipient='" . Database::instance()->escape_str($mobile) . "' ";
             }
         }
     }
     if (!$missing_info) {
         $alert_check = ORM::factory('alert')->where($filter)->find();
         // IF there was no result
         if (!$alert_check->loaded) {
             $this->template->content->errno = ER_CODE_NOT_FOUND;
         } elseif ($alert_check->alert_confirmed) {
             $this->template->content->errno = ER_CODE_ALREADY_VERIFIED;
         } else {
             // SET the alert as confirmed, and save it
             $alert_check->set('alert_confirmed', 1)->save();
             $this->template->content->errno = ER_CODE_VERIFIED;
         }
     } else {
         $this->template->content->errno = ER_CODE_NOT_FOUND;
     }
 }
开发者ID:Dirichi,项目名称:Ushahidi_Web,代码行数:56,代码来源:alerts.php

示例10: array

    }
    ?>
		</ul>
	</div>
	<?php 
}
?>
	<div class="categories report_category">
	<h2><?php 
echo Kohana::lang('ui_main.categories');
?>
</h2>
		
		<div style="clear: left; width: 100%; float: left;">
			<input type="checkbox" id="category_all" name="category_all" onclick="CheckAll(this.id, 'category')"/><strong><?php 
echo utf8::strtoupper(Kohana::lang('ui_main.select_all'));
?>
</strong>
		</div>
		<?php 
$selected_categories = (!empty($form['incident_category']) and is_array($form['incident_category'])) ? $selected_categories = $form['incident_category'] : array();
if (method_exists('category', 'form_tree')) {
    echo category::form_tree('category', $selected_categories, 2, TRUE);
} elseif (Kohana::config('settings.ushahidi_version') >= 2.4 and Kohana::config('settings.ushahidi_version') <= 2.5) {
    echo category::tree(ORM::factory('category')->find_all(), TRUE, $selected_categories, 'category', 2, TRUE);
} elseif (Kohana::config('settings.ushahidi_version') < 2.4) {
    echo category::tree(ORM::factory('category')->find_all(), $selected_categories, 'category', 2, TRUE);
}
?>
	</div>
	<div>
开发者ID:niiyatii,项目名称:crowdmap,代码行数:31,代码来源:download_reports.php

示例11:

        ?>
            								            <span><?php 
        echo utf8::strtoupper(Kohana::lang('ui_admin.banip_action'));
        ?>
</span>
            								        <?php 
    }
    ?>
            								    </li>
            								    <li>
            								        <a href="#" class="del" onclick="apiLogAction('d','DELETE', '<?php 
    echo $api_log_id;
    ?>
');">
            								            <?php 
    echo utf8::strtoupper(Kohana::lang('ui_admin.delete_action'));
    ?>
            								        </a>
            								    </li>
            								</ul>
            							</td>
            						</tr>
            					<?php 
}
?>
            			</tbody>
            		</table>
            	</div>
            	<?php 
print form::close();
?>
开发者ID:niiyatii,项目名称:crowdmap,代码行数:31,代码来源:logs.php

示例12:

"><?php 
    echo utf8::strtoupper(Kohana::lang('ui_main.approved'));
    ?>
:</a></li>
									<li><a href="#" class="<?php 
    echo $incident_verified;
    ?>
"><?php 
    echo utf8::strtoupper(Kohana::lang('ui_main.verified'));
    ?>
:</a></li>
									<li class="last"><a href="#" class="<?php 
    echo $submit_mode;
    ?>
"><?php 
    echo utf8::strtoupper(Kohana::lang('ui_main.source'));
    ?>
:</a></li>
								</ul>
								<h4><strong><?php 
    echo $incident_date;
    ?>
</strong><a href="<?php 
    echo url::site() . 'members/reports/edit/' . $incident_id;
    ?>
"><?php 
    echo $incident_title;
    ?>
</a></h4>
								<p><?php 
    echo $incident_description;
开发者ID:nanangsyaifudin,项目名称:HAC-2012,代码行数:31,代码来源:dashboard.php

示例13: index

 /**
  * Lists the forms.
  */
 public function index()
 {
     $this->template->content = new View('admin/manage/forms/main');
     // Setup and initialize form field names
     $form = array('action' => '', 'form_id' => '', 'form_title' => '', 'form_description' => '', 'form_active' => '', 'field_type' => '');
     // Copy the form as errors, so the errors will be stored with keys
     // corresponding to the form field names
     $errors = $form;
     $form_error = FALSE;
     $form_saved = FALSE;
     $form_action = "";
     $form_id = "";
     if ($_POST) {
         $post = Validation::factory($_POST);
         //  Add some filters
         $post->pre_filter('trim', TRUE);
         if ($post->action == 'a') {
             // Add some rules, the input field, followed by a list of checks, carried out in order
             $post->add_rules('form_title', 'required', 'length[1,1000]');
             $post->add_rules('form_description', 'required');
         } elseif ($post->action == 'd') {
             if ($_POST['form_id'] == 1) {
                 // Default Form Cannot Be Deleted
                 $post->add_error('form_id', 'default');
             }
         }
         if ($post->validate()) {
             $form_id = $post->form_id;
             $custom_form = new Form_Model($form_id);
             if ($post->action == 'd') {
                 // Delete Action
                 $custom_form->delete($form_id);
                 $form_saved = TRUE;
                 $form_action = utf8::strtoupper(Kohana::lang('ui_admin.deleted'));
             } elseif ($post->action == 'h') {
                 // Active/Inactive Action
                 if ($custom_form->loaded) {
                     // @todo Doesn't make sense, find out what the logic for this is
                     // Customary values for active and inactive are 1 and 0 respectively
                     $custom_form->form_active = $custom_form->form_active == 1 ? 0 : 1;
                     $custom_form->save();
                     $form_saved = TRUE;
                     $form_action = utf8::strtoupper(Kohana::lang('ui_admin.modified'));
                 }
             } else {
                 // Save Action
                 $custom_form->form_title = $post->form_title;
                 $custom_form->form_description = $post->form_description;
                 $custom_form->save();
                 $form_saved = TRUE;
                 $form_action = utf8::strtoupper(Kohana::lang('ui_admin.created_edited'));
             }
             // Empty $form array
             array_fill_keys($form, '');
         } else {
             // Repopulate the form fields
             $form = arr::overwrite($form, $post->as_array());
             // Populate the error fields, if any
             $errors = arr::overwrite($errors, $post->errors('form'));
             $form_error = TRUE;
         }
     }
     // Pagination
     $pagination = new Pagination(array('query_string' => 'page', 'items_per_page' => $this->items_per_page, 'total_items' => ORM::factory('form')->count_all()));
     $forms = ORM::factory('form')->orderby('id', 'asc')->find_all($this->items_per_page, $pagination->sql_offset);
     // Form Field Types
     $form_field_types = array('' => Kohana::lang('ui_admin.select_field_type'), 1 => Kohana::lang('ui_admin.text_field'), 2 => Kohana::lang('ui_admin.free_text_field'), 3 => Kohana::lang('ui_admin.date_field'), 5 => Kohana::lang('ui_admin.radio_field'), 6 => Kohana::lang('ui_admin.checkbox_field'), 7 => Kohana::lang('ui_admin.dropdown_field'), 8 => Kohana::lang('ui_admin.divider_start_field'), 9 => Kohana::lang('ui_admin.divider_end_field'));
     $this->template->content->form = $form;
     $this->template->content->form_error = $form_error;
     $this->template->content->form_saved = $form_saved;
     $this->template->content->form_action = $form_action;
     $this->template->content->pagination = $pagination;
     $this->template->content->total_items = $pagination->total_items;
     $this->template->content->forms = $forms;
     $this->template->content->form_field_types = $form_field_types;
     $this->template->content->errors = $errors;
     // Javascript Header
     $this->template->js = new View('admin/manage/forms/forms_js');
     $this->template->js->form_id = $form_id;
     $this->template->form_error = $form_error;
 }
开发者ID:nanangsyaifudin,项目名称:HAC-2012,代码行数:84,代码来源:forms.php

示例14:

<?php 
Event::run('ushahidi_action.admin_checkins_custom_layout');
?>
	
<?php 
// Kill the rest of the page if this event has been utilized by a plugin
if (!Event::has_run('ushahidi_action.admin_checkins_custom_layout')) {
    ?>

	<!-- tabs -->
	<div class="tabs">
		<!-- tab -->
		<div class="tab">
			<ul>
				<li><a href="#" onClick="checkinsAction('d', 'DELETE', '')"><?php 
    echo utf8::strtoupper(Kohana::lang('ui_main.delete'));
    ?>
</a></li>
			</ul>
		</div>
	</div>
	<?php 
    if ($form_error) {
        ?>
		<!-- red-box -->
		<div class="red-box">
			<h3><?php 
        echo Kohana::lang('ui_main.error');
        ?>
</h3>
			<ul><?php 
开发者ID:rjmackay,项目名称:Ushahidi_Web,代码行数:31,代码来源:main.php

示例15: index

 public function index()
 {
     $this->template->content = new View('admin/profile');
     // setup and initialize form field names
     $form = array('current_password' => '', 'new_password' => '', 'password_again' => '', 'name' => '', 'email' => '', 'notify' => '');
     //  Copy the form as errors, so the errors will be stored with keys
     //  corresponding to the form field names
     $errors = $form;
     $form_error = FALSE;
     $form_saved = FALSE;
     // check, has the form been submitted, if so, setup validation
     if ($_POST) {
         $post = Validation::factory($_POST);
         //  Add some filters
         $post->pre_filter('trim', TRUE);
         $post->add_rules('name', 'required', 'length[3,100]');
         $post->add_rules('email', 'required', 'email', 'length[4,64]');
         $post->add_rules('current_password', 'required');
         $post->add_callbacks('email', array($this, 'email_exists_chk'));
         $post->add_callbacks('current_password', array($this, 'current_pw_valid_chk'));
         // If Password field is not blank
         if (!empty($post->new_password)) {
             $post->add_rules('new_password', 'required', 'length[' . Kohana::config('auth.password_length') . ']', 'matches[password_again]');
         }
         //for plugins that'd like to know what the user has to say about their profile
         Event::run('ushahidi_action.profile_add_admin', $post);
         if ($post->validate()) {
             $user = ORM::factory('user', $this->user_id);
             if ($user->loaded) {
                 $user->name = $post->name;
                 $user->email = $post->email;
                 $user->notify = $post->notify;
                 if ($post->new_password != '') {
                     $user->password = $post->new_password;
                 }
                 $user->save();
                 Event::run('ushahidi_action.profile_edit', $user);
                 // We also need to update the RiverID server with the new password if
                 //    we are using RiverID and a password is being passed
                 if (kohana::config('riverid.enable') == TRUE and !empty($user->riverid) and $post->new_password != '') {
                     $riverid = new RiverID();
                     $riverid->email = $user->email;
                     $riverid->password = $post->current_password;
                     $riverid->new_password = $post->new_password;
                     if ($riverid->changepassword() == FALSE) {
                         // TODO: Something went wrong. Tell the user.
                     }
                 }
             }
             $form_saved = TRUE;
             // Repopulate the form fields
             $form = arr::overwrite($form, $post->as_array());
             $form['new_password'] = "";
             $form['password_again'] = "";
         } else {
             // repopulate the form fields
             $form = arr::overwrite($form, $post->as_array());
             // populate the error fields, if any
             $errors = arr::overwrite($errors, $post->errors('auth'));
             $form_error = TRUE;
         }
     } else {
         $user = ORM::factory('user', $this->user_id);
         $form['username'] = $user->email;
         $form['name'] = $user->name;
         $form['email'] = $user->email;
         $form['notify'] = $user->notify;
     }
     $this->template->content->form = $form;
     $this->template->content->errors = $errors;
     $this->template->content->form_error = $form_error;
     $this->template->content->form_saved = $form_saved;
     $this->template->content->yesno_array = array('1' => utf8::strtoupper(Kohana::lang('ui_main.yes')), '0' => utf8::strtoupper(Kohana::lang('ui_main.no')));
     // Javascript Header
 }
开发者ID:Dirichi,项目名称:Ushahidi_Web,代码行数:75,代码来源:profile.php


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