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


PHP Input::Get方法代码示例

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


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

示例1: action_index

 public function action_index($search = null)
 {
     // check for admin
     if (!Auth::member(5)) {
         \Response::redirect_back('home');
     }
     if (Input::Method() === 'POST') {
         $users = Input::POST();
         if (empty($users) === false) {
             // Update the users
             foreach ($users as $user_id => $new_group) {
                 $found_user = Model_User::Find(str_replace('user_role_', '', $user_id));
                 if (empty($found_user) === false) {
                     $found_user->group_id = $new_group;
                     $found_user->save();
                 }
             }
         }
     }
     if (Input::Method() === 'GET' && Input::Get('search')) {
         $data['total_count'] = Controller_Search::get_users();
         $pagination = Settings::pagination($data['total_count']);
         $data['users'] = Controller_Search::get_users($pagination);
         $data['search'] = Input::GET('search');
     } else {
         $data['total_count'] = Model_User::query()->where('id', '!=', static::$user_id)->count();
         $pagination = Settings::pagination($data['total_count']);
         $data['users'] = Model_User::query()->where('id', '!=', static::$user_id)->order_by('username', 'ASC')->rows_offset($pagination->offset)->rows_limit($pagination->per_page)->get();
     }
     $data['pagination'] = $pagination->render();
     $this->template->content = View::Forge('admin/users', $data);
 }
开发者ID:aircross,项目名称:MeeLa-Premium-URL-Shortener,代码行数:32,代码来源:users.php

示例2: upload_article_handler

function upload_article_handler(&$request, &$session, &$files) {
	$publication = Input::Get('Pub', 'int', 0);
	$issue = Input::Get('Issue', 'int', 0);
	$section = Input::Get('Section', 'int', 0);
	$language = Input::Get('Language', 'int', 0);
	$sLanguage = Input::Get('sLanguage', 'int', 0);
	$articleNumber = Input::Get('Article', 'int', 0);

	if (!Input::IsValid()) {
		echo "Input Error: Missing input";
		return;
	}

	// Unzip the sxw file to get the content.
	$zip = zip_open($files["filename"]["tmp_name"]);
	if ($zip) {
		$xml = null;
		while ($zip_entry = zip_read($zip)) {
			if (zip_entry_name($zip_entry) == "content.xml") {
		       	if (zip_entry_open($zip, $zip_entry, "r")) {
		           	$xml = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
			        zip_entry_close($zip_entry);
		       	}
			}
		}
		zip_close($zip);

		if (!is_null($xml)) {
			// Write the XML to a file because the XSLT functions
			// require it to be in a file in order to be processed.
			$tmpXmlFilename = tempnam("/tmp", "ArticleImportXml");
			$tmpXmlFile = fopen($tmpXmlFilename, "w");
			fwrite($tmpXmlFile, $xml);
			fclose($tmpXmlFile);

			// Transform the OpenOffice document to DocBook format.
			$xsltProcessor = xslt_create();
			$docbookXml = xslt_process($xsltProcessor,
									   $tmpXmlFilename,
									   "sxwToDocbook.xsl");
			unlink($tmpXmlFilename);

			// Parse the docbook to get the data.
			$docBookParser = new DocBookParser();
			$docBookParser->parseString($docbookXml, true);

			$article = new Article($articleNumber, $language);
			$article->setTitle($docBookParser->getTitle());
			$article->setIntro($docBookParser->getIntro());
			$article->setBody($docBookParser->getBody());

			// Go back to the "Edit Article" page.
			header("Location: /$ADMIN/articles/edit.php?Pub=$publication&Issue=$issue&Section=$section&Article=$articleNumber&Language=$language&sLanguage=$sLanguage");
		} // if (!is_null($xml))
	} // if ($zip)

	// Some sort of error occurred - show the upload page again.
	include("index.php");
} // fn upload_article_handler
开发者ID:nistormihai,项目名称:Newscoop,代码行数:59,代码来源:CommandProcessor.php

示例3: smarty_function_blogcomment_edit

/**
 * Campsite blogcomment_edit function plugin
 *
 * Type:     function
 * Name:     bloganswer_edit
 * Purpose:  
 *
 * @param array
 *     $p_params the date in unixtime format from $smarty.now
 * @param object
 *     $p_smarty the date format wanted
 *
 * @return
 *     string the html form element
 *     string empty if something is wrong
 */
function smarty_function_blogcomment_edit($p_params, &$p_smarty)
{
    global $g_ado_db, $Campsite;

    require_once $p_smarty->_get_plugin_filepath('shared','escape_special_chars');

    // gets the context variable
    $campsite = $p_smarty->get_template_vars('gimme');
    $html = '';

    if (!isset($p_params['html_code']) || empty($p_params['html_code'])) {
        $p_params['html_code'] = '';
    }

    switch ($p_params['attribute']) {
        case 'title':
        case 'user_name':
        case 'user_email':
            $attr = $p_params['attribute'];
            $value = htmlspecialchars(isset($_REQUEST['f_blogcomment_'.$attr]) ? Input::Get('f_blogcomment_'.$attr) : $campsite->blogcomment->$attr);
            $html .= "<input type=\"text\" name=\"f_blogcomment_$attr\" value=\"$value\" {$p_params['html_code']} />";
        break;
            
        case 'content':
            $value = isset($_REQUEST['f_blogcomment_content']) ? Input::Get('f_blogcomment_content') : $campsite->blogcomment->content;
            $html .= "<textarea name=\"f_blogcomment_content\" id=\"f_blogcomment_content\" {$p_params['html_code']} />$value</textarea>";
            if ($p_params['wysiwyg']) {
                $html .='<script language="javascript" type="text/javascript" src="' . $Campsite['WEBSITE_URL'] . '/javascript/jquery/jquery-1.4.2.min.js"></script>'.
                        '<script language="javascript" type="text/javascript" src="' . $Campsite['WEBSITE_URL'] . '/javascript/tinymce/tiny_mce.js"></script>'.
                        '<script language="javascript" type="text/javascript">'.
                        '     tinyMCE.init({'.
                        '     	mode : "exact",'.
                        '        elements : "f_blogcomment_content",'.
                        '        theme : "advanced",'.
                        '        plugins : "emotions, paste", '.
                        '        paste_auto_cleanup_on_paste : true, '.
                        '        theme_advanced_buttons1 : "bold, italic, underline, undo, redo, link, emotions", '.
                        '        theme_advanced_buttons2 : "", '.
                        '        theme_advanced_buttons3 : "" '.
                        '     });'.
                        '</script>';
            }
        break;
        
        case 'mood':
             $value = isset($_REQUEST['f_blogcomment_mood_id']) ? Input::Get('f_blogcomment_mood_id') : $campsite->blogcomment->mood_id;
            $html = "<select name=\"f_blogcomment_mood_id\" {$params['html_code']}>";
            
            foreach (Blog::getMoodList($campsite->blog->language_id) as $key => $val) {
                $selected = $value == $key ? 'selected="selected"' : '';
                $html .= "<option value=\"$key\" $selected {$params['html_code']}>$val</option>";
            }
            
            $html .= '</select>';
        break;
    }
    
    return $html;
} // fn smarty_function_blogcomment_edit
开发者ID:nistormihai,项目名称:Newscoop,代码行数:75,代码来源:function.blogcomment_edit.php

示例4: read_utype_common_parameters

function read_utype_common_parameters()
{
	global $uType, $userOffs, $lpp;

	$uType = Input::Get('uType', 'string', '');
	$userOffs = Input::Get('userOffs', 'int', 0);
	if ($userOffs < 0)
		$userOffs = 0;
	$lpp = Input::Get('lpp', 'int', 20);
}
开发者ID:nistormihai,项目名称:Newscoop,代码行数:10,代码来源:utypes_common.php

示例5: pageController

function pageController()
{
    if (Input::Get($counter)) {
        $counter = Input::Has($counter);
    } else {
        $counter = 0;
    }
    $data = ['counter' => $counter];
    return $data;
}
开发者ID:Gregory-Bickham,项目名称:codeup_web_exercise,代码行数:10,代码来源:ping.php

示例6: post_ipbl

 public function post_ipbl()
 {
     $price = Input::Get('price');
     if (empty($price) || !is_numeric($price)) {
         return View::make('msg.error')->with('error', 'Invalid price set');
     }
     $settings = IniHandle::readini();
     $settings['ipbl'] = $price;
     IniHandle::write_ini_file($settings);
     return Redirect::to('/admin/plan/blacklist');
 }
开发者ID:albertpaulp,项目名称:PrettyBoot,代码行数:11,代码来源:plan.php

示例7: action_create

 public function action_create()
 {
     $url = Input::Get('url');
     $custom = Input::Get('custom');
     $api = Input::Get('api_key');
     if (empty($api) === true) {
         $api = true;
     }
     if (empty($url) === false) {
         // Check to see if its a valid url
         if (filter_var($url, FILTER_VALIDATE_URL) === false) {
             echo 'You did not enter a valid url in, please try again';
             die;
         }
         // Check black list!
         $blocked = Model_Blacklist::query()->get();
         if (empty($blocked) === false) {
             foreach ($blocked as $block) {
                 // Check aginst the blocked
                 if (preg_match('/' . strtolower($block['blocked']) . '/', strtolower($url))) {
                     echo 'URL Blacklisted';
                     die;
                 }
             }
         }
         // Lets generate them a url
         $safe = \Settings::Get('google_safe_api_key');
         // Is it safe?
         if (empty($safe) === false) {
             $m_url = 'https://sb-ssl.google.com/safebrowsing/api/lookup?client=api&apikey=' . $safe . '&appver=1.0&pver=3.0&url=' . $url;
             $curl_handle = curl_init();
             curl_setopt($curl_handle, CURLOPT_URL, $m_url);
             curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
             curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
             $buffer = curl_exec($curl_handle);
             curl_close($curl_handle);
             if (empty($buffer) === false) {
                 echo 'This website has been blocked because of ' . $buffer;
                 die;
             }
         }
         $length = strlen($url);
         $data['short_url_raw'] = Controller_Url::shortenit($url, $custom, $api);
         $data['url'] = $url;
         $data['short_url'] = $data['short_url_raw']['short_url'];
         echo \Uri::Create($data['short_url']);
         die;
     } else {
         echo 'Error';
         die;
     }
 }
开发者ID:aircross,项目名称:MeeLa-Premium-URL-Shortener,代码行数:52,代码来源:api.php

示例8: read_user_common_parameters

function read_user_common_parameters()
{
    global $uType, $userOffs, $ItemsPerPage;
    global $defaultUserSearchParameters, $userSearchParameters;
    $uType = Input::Get('uType', 'string', '');
    $userOffs = camp_session_get('userOffs', 0);
    if ($userOffs < 0) {
        $userOffs = 0;
    }
    $ItemsPerPage = Input::Get('ItemsPerPage', 'int', 20);
    foreach ($userSearchParameters as $parameter => $defaultValue) {
        $userSearchParameters[$parameter] = camp_session_get($parameter, $defaultUserSearchParameters[$parameter]);
    }
}
开发者ID:nidzix,项目名称:Newscoop,代码行数:14,代码来源:users_common.php

示例9: smarty_function_blogentry_edit

/**
 * Campsite blogentry_edit function plugin
 *
 * Type:     function
 * Name:     bloganswer_edit
 * Purpose:  
 *
 * @param array
 *     $p_params the date in unixtime format from $smarty.now
 * @param object
 *     $p_smarty the date format wanted
 *
 * @return
 *     string the html form element
 *     string empty if something is wrong
 */
function smarty_function_blogentry_edit($p_params, &$p_smarty)
{
    global $g_ado_db;

    require_once $p_smarty->_get_plugin_filepath('shared','escape_special_chars');

    // gets the context variable
    $campsite = $p_smarty->get_template_vars('gimme');
    $html = '';

    if (!isset($p_params['html_code']) || empty($p_params['html_code'])) {
        $p_params['html_code'] = '';
    }

    switch ($p_params['attribute']) {
        case 'title':
            $value = isset($_REQUEST['f_blogentry_title']) ? Input::Get('f_blogentry_title') : $campsite->blogentry->title;
            $html .= "<input type=\"text\" name=\"f_blogentry_title\" value=\"$value\" {$p_params['html_code']} />";
        break;
            
        case 'content':
            $value = isset($_REQUEST['f_blogentry_content']) ? Input::Get('f_blogentry_content') : $campsite->blogentry->content;
            $html .= "<textarea name=\"f_blogentry_content\" id=\"f_blogentry_content\" {$p_params['html_code']} />$value</textarea>";
            
            if ($p_params['wysiwyg']) {
                $html .='<script language="javascript" type="text/javascript" src="' . $Campsite['WEBSITE_URL'] . '/javascript/tinymce/tiny_mce.js"></script>'.
                        '<script language="javascript" type="text/javascript">'.
                        '     tinyMCE.init({'.
                        '     	mode : "exact",'.
                        '        elements : "f_blogentry_content",'.
                        '        theme : "advanced",'.
                        '        plugins : "emotions, paste", '.
                        '        paste_auto_cleanup_on_paste : true, '.
                        '        theme_advanced_buttons1 : "bold, italic, underline, undo, redo, link, emotions", '.
                        '        theme_advanced_buttons2 : "", '.
                        '        theme_advanced_buttons3 : "" '.
                        '     });'.
                        '</script>';
            }
        break;
       
        case 'mood':
            $value = isset($_REQUEST['f_blogentry_mood']) ? Input::Get('f_blogentry_mood') : $campsite->blogentry->mood;
            $html .= "<input type=\"text\" name=\"f_blogentry_mood\" value=\"$value\" {$p_params['html_code']} />";
        break; 
    }

    return $html;
} // fn smarty_function_blogentry_edit
开发者ID:nistormihai,项目名称:Newscoop,代码行数:65,代码来源:function.blogentry_edit.php

示例10: sendEmail

 public function sendEmail()
 {
     $data = Input::all();
     $user = ['name' => Input::Get('con-fullname'), 'email' => Input::Get('con-email'), 'subject' => Input::Get('con-subject'), 'message' => Input::Get('con-message')];
     $success = "Thank you for contacting us, your email with subject '" . $user['subject'] . "' will be reply by us soon. please check your spam folder as well";
     $validator = Validator::make(Input::all(), $this->rules);
     if ($validator->passes()) {
         Mail::send('emails.contactus', $data, function ($message) use($user) {
             $message->from($user['email'], $user['name'])->to('everydaysmarthotel-jakarta@protohotel.asia', 'Hotel Everyday Smart Hotel - Jakarta')->subject($user['subject']);
         });
         return Redirect::to('/yourbook')->with('success', $success);
     } else {
         return Redirect::to('/yourbook')->withErrors($validator, 'viewBook')->withInput()->with('active', 'active');
     }
 }
开发者ID:hilmysyarif,项目名称:hotel-application-laravel,代码行数:15,代码来源:YourbooksController.php

示例11: plugin_debate_init

 /**
  * @param CampContext $p_context
  */
 function plugin_debate_init(&$p_context)
 {
     $debate_nr = Input::Get("f_debate_nr", "int");
     $debate_language_id = Input::Get("f_debate_language_id", "int");
     $p_context->debate = new MetaDebate($debate_language_id, $debate_nr, $p_context->user->identifier);
     $url = $p_context->url;
     /* @var $url MetaURL */
     //if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
     //    $p_context->url->set_parameter('f_debate_ajax_request', 1);
     //}
     // reset the context urlparameters
     foreach (array('f_debate', 'f_debate_nr', 'f_debate_language_id', 'f_debate_ajax_request') as $param) {
         $p_context->url->reset_parameter($param);
         $p_context->default_url->reset_parameter($param);
     }
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:19,代码来源:debate.info.php

示例12: camp_load_translation_strings

<?php

require_once $GLOBALS['g_campsiteDir'] . "/conf/configuration.php";
require_once $GLOBALS['g_campsiteDir'] . "/classes/Input.php";
camp_load_translation_strings("localizer");
require_once dirname(__FILE__) . '/Localizer.php';
if (!SecurityToken::isValid()) {
    camp_html_display_error(getGS('Invalid security token!'));
    exit;
}
// Check permissions
if (!$g_user->hasPermission('ManageLocalizer')) {
    camp_html_display_error(getGS("You do not have the right to manage the localizer."));
    exit;
}
$prefix = Input::Get('prefix', 'string', '', true);
$newPrefix = Input::Get('new_prefix');
$moveStr = Input::Get('string');
Localizer::ChangeStringPrefix($prefix, $newPrefix, $moveStr);
header("Location: /{$ADMIN}/localizer/index.php");
exit;
开发者ID:nidzix,项目名称:Newscoop,代码行数:21,代码来源:do_string_switch_file.php

示例13: camp_html_display_error

    camp_html_display_error(getGS('You do not have the right to manage blogs.'));
    exit;
}

switch ($f_mode) {
    case 'blog_topic':// Check permissions
        $f_blog_id = Input::Get('f_blog_id', 'int');
        $topics = Blog::GetTopicTree();
        $Blog = new Blog($f_blog_id);
        $language_id = $Blog->getLanguageId();
        $object = 'BlogTopic';
        $object_id = $f_blog_id;
    break;

    case 'entry_topic':
        $f_blogentry_id = Input::Get('f_blogentry_id', 'int');
        $topics = Blog::GetTopicTree();
        $BlogEntry = new BlogEntry($f_blogentry_id);
        $language_id = $BlogEntry->getLanguageId();
        $object = 'BlogentryTopic';
        $object_id = $f_blogentry_id;
    break;

}

if (!Input::IsValid()) {
	camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI'], true);
	exit;
}
?>
<html>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:popup.php

示例14: camp_load_translation_strings

<?php

camp_load_translation_strings("plugin_debate");
// Check permissions
if (!$g_user->hasPermission('plugin_debate_admin')) {
    camp_html_display_error(getGS('You do not have the right to manage debates.'));
    exit;
}
$allLanguages = Language::GetLanguages();
$f_debate_nr = Input::Get('f_debate_nr', 'int');
$f_fk_language_id = Input::Get('f_fk_language_id', 'int');
$debate = new Debate($f_fk_language_id, $f_debate_nr);
if ($debate->exists()) {
    foreach ($debate->getTranslations() as $translation) {
        $existing[$translation->getLanguageId()] = true;
    }
    $title = $debate->getProperty('title');
    $question = $debate->getProperty('question');
    $is_used_as_default = false;
}
echo camp_html_breadcrumbs(array(array(getGS('Plugins'), $Campsite['WEBSITE_URL'] . '/admin/plugins/manage.php'), array(getGS('Debates'), $Campsite['WEBSITE_URL'] . '/admin/debate/index.php'), array(getGS('Translate Debate'), '')));
?>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;">
<TR>
    <TD><A HREF="index.php"><IMG SRC="<?php 
echo $Campsite["ADMIN_IMAGE_BASE_URL"];
?>
/left_arrow.png" BORDER="0"></A></TD>
    <TD><A HREF="index.php"><B><?php 
putGS("Debate List");
?>
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:translate.php

示例15: camp_html_display_error

<?php

require_once $GLOBALS['g_campsiteDir'] . '/classes/Input.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/ArticleType.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Translation.php';
$translator = \Zend_Registry::get('container')->getService('translator');
$request = \Zend_Registry::get('container')->get('request');
$locale = $request->getLocale();
if (!Saas::singleton()->hasPermission('ManageArticleTypes')) {
    camp_html_display_error($translator->trans("You do not have the right to manage article types.", array(), 'article_type_fields'));
    exit;
}
$articleTypeName = Input::Get('f_article_type');
// return value is sorted by language
$allLanguages = Language::GetLanguages(null, null, null, array(), array(), true);
$lang = Language::GetLanguageByCode($locale);
$languageObj = new Language($lang->getLanguageId());
$articleType = new ArticleType($articleTypeName);
$fields = $articleType->getUserDefinedColumns(null, true, true);
$crumbs = array();
$crumbs[] = array($translator->trans("Configure"), "");
$crumbs[] = array($translator->trans("Article Types"), "/{$ADMIN}/article_types/");
$crumbs[] = array($articleTypeName, "");
$crumbs[] = array($translator->trans("Article type fields", array(), 'article_type_fields'), "");
echo camp_html_breadcrumbs($crumbs);
$row_rank = 0;
if ($g_user->hasPermission("ManageArticleTypes")) {
    include_once $GLOBALS['g_campsiteDir'] . "/{$ADMIN_DIR}/javascript_common.php";
    ?>
<script>
var field_ids = new Array;
开发者ID:alvsgithub,项目名称:Newscoop,代码行数:31,代码来源:index.php


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