本文整理汇总了PHP中action类的典型用法代码示例。如果您正苦于以下问题:PHP action类的具体用法?PHP action怎么用?PHP action使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了action类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doAction
function doAction()
{
$action = getaction();
//если есть экшин- выполняем
if (file_exists(__corePath . "actions/{$action}.php")) {
include __corePath . "actions/{$action}.php";
$action = new action($this->db);
$action->execute();
}
}
示例2: post
/**
* inserts a new idea in the database
*
* @param string $title title of the idea
* @param string $message message of the idea
* @param string $anonymization tells if idea is to be anonymized
* @param integer $category id of the category for the idea
* @param string $login login of the poster
* @param integer $valid says if the idea needs to be moderated (default 0 = needs moderation)
* @return array
*/
function post($title, $message, $anonymization, $category, $login, $valid = 0)
{
$action = new action();
$action->result = False;
$check_1 = isset($title) && !empty($title);
$check_2 = isset($message) && !empty($message);
$check_3 = !isset($anonymization) || $anonymization == "on";
$check_4 = isset($category) && is_numeric($category) && $category > 0;
// V�rification des arguments
if ($check_1) {
$title_prec = $title;
} else {
$action->add_warning(_('Titre incorrect'));
}
if ($check_2) {
$text_prec = $message;
} else {
$action->add_warning(_('Message incorrect'));
}
if ($check_3) {
if (isset($anonymization)) {
$anon_prec = "on";
}
} else {
$action->add_warning(_('Incorrect anonymization value'));
}
if ($check_4) {
$cate_prec = $category;
} else {
$action->add_warning(_('Catégorie incorrecte'));
}
if ($check_1 && $check_2 && $check_3 && $check_4) {
$title_prec_sec = mysql_real_escape_string($title_prec);
$text_prec_sec = mysql_real_escape_string($text_prec);
$cate_prec_sec = mysql_real_escape_string($cate_prec);
$rand_prop = mt_rand(0, 65535);
$hash_prop = sha1($login . $rand_prop);
if ($anon_prec == "on") {
$name_print = "";
} else {
$name_print = mysql_real_escape_string(construct_name_from_session());
}
if (@mysql_query("INSERT INTO `thread` (`thread_id`,`rand_prop`,`hash_prop`,`title`,`text`,`date`,`category`,`is_valid`,`possibly_name`) VALUES (NULL, '{$rand_prop}', '{$hash_prop}','{$title_prec_sec}','{$text_prec_sec}',CURRENT_TIMESTAMP,'{$cate_prec_sec}',{$valid},'{$name_print}')")) {
$action->add_success(_('Ta proposition a bien été ajoutée et est en attente de modération'));
$action->result = True;
} else {
$action->add_warning(_('Ta proposition n\'a pas pu être ajoutée suite à une erreur de transfert.'));
}
}
return $action;
}
示例3: define
exit;
}
define('HIDE_TOOL_TITLE', 1);
$guest_allowed = true;
require_once 'include/baseTheme.php';
require_once 'include/CAS/CAS.php';
require_once 'modules/auth/auth.inc.php';
require_once 'include/lib/textLib.inc.php';
require_once 'include/phpass/PasswordHash.php';
// unset system that records visitor only once by course for statistics
require_once 'include/action.php';
if (isset($dbname)) {
$action = new action();
$action->record('MODULE_ID_UNITS', 'exit');
}
unset($dbname);
// if we try to login... then authenticate user.
$warning = '';
if (isset($_SESSION['shib_uname'])) {
// authenticate via shibboleth
shib_cas_login('shibboleth');
} elseif (isset($_SESSION['cas_uname']) && !isset($_GET['logout'])) {
// authenticate via cas
shib_cas_login('cas');
} elseif (isset($_GET['provider'])) {
//hybridauth authentication (Facebook, Twitter, Google, Yahoo, Live, LinkedIn)
hybridauth_login();
示例4: action
* ========================================================================
*/
$require_current_course = TRUE;
$require_login = TRUE;
$require_help = TRUE;
$helpTopic = 'bbb';
require_once '../../include/baseTheme.php';
require_once 'include/sendMail.inc.php';
// For creating bbb urls & params
require_once 'bbb-api.php';
require_once 'functions.php';
require_once 'include/lib/modalboxhelper.class.php';
ModalBoxHelper::loadModalBox();
/* * ** The following is added for statistics purposes ** */
require_once 'include/action.php';
$action = new action();
$action->record(MODULE_ID_BBB);
/* * *********************************** */
$toolName = $langBBB;
// guest user not allowed
if (check_guest()) {
$tool_content .= "<div class='alert alert-danger'>{$langNoGuest}</div>";
draw($tool_content, 2);
}
load_js('tools.js');
load_js('tagsinput');
load_js('bootstrap-datetimepicker');
load_js('validation.js');
$head_content .= "\r\n<script type='text/javascript'>\r\n\$(function() {\r\n\$('#start_session').datetimepicker({\r\n format: 'dd-mm-yyyy hh:ii', pickerPosition: 'bottom-left', \r\n language: '" . $language . "',\r\n autoclose: true\r\n });\r\n});\r\n</script>";
load_js('select2');
$head_content .= "<script type='text/javascript'>\r\n \$(document).ready(function () {\r\n \$('#select-groups').select2(); \r\n \$('#selectAll').click(function(e) {\r\n e.preventDefault();\r\n var stringVal = [];\r\n \$('#select-groups').find('option').each(function(){\r\n stringVal.push(\$(this).val());\r\n });\r\n \$('#select-groups').val(stringVal).trigger('change');\r\n });\r\n \$('#removeAll').click(function(e) {\r\n e.preventDefault();\r\n var stringVal = [];\r\n \$('#select-groups').val(stringVal).trigger('change');\r\n }); \r\n });\r\n\r\n </script>\r\n";
示例5: get_footer
function get_footer()
{
?>
<!-- jQuery & Required Scripts -->
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<?php
if (!IS_SINGLE && PAGINATION_ON_OFF !== "off") {
?>
<!-- Post Pagination -->
<script>
var infinite = true;
var next_page = 2;
var loading = false;
var no_more_posts = false;
$(function() {
function load_next_page() {
$.ajax({
url: "index.php?page=" + next_page,
beforeSend: function () {
$('body').append('<article class="loading-frame"><div class="row"><div class="one-quarter meta"></div><div class="three-quarters"><img src="./templates/<?php
echo ACTIVE_TEMPLATE;
?>
/loading.gif" alt="Loading"></div></div></article>');
$("body").animate({ scrollTop: $("body").scrollTop() + 250 }, 1000);
},
success: function (res) {
next_page++;
var result = $.parseHTML(res);
var articles = $(result).filter(function() {
return $(this).is('article');
});
if (articles.length < 2) { //There's always one default article, so we should check if < 2
$('.loading-frame').html('You\'ve reached the end of this list.');
no_more_posts = true;
} else {
$('.loading-frame').remove();
$('body').append(articles);
}
loading = false;
},
error: function() {
$('.loading-frame').html('An error occurred while loading posts.');
//keep loading equal to false to avoid multiple loads. An error will require a manual refresh
}
});
}
$(window).scroll(function() {
var when_to_load = $(window).scrollTop() * 0.32;
if (infinite && (loading != true && !no_more_posts) && $(window).scrollTop() + when_to_load > ($(document).height()- $(window).height() ) ) {
// Sometimes the scroll function may be called several times until the loading is set to true.
// So we need to set it as soon as possible
loading = true;
setTimeout(load_next_page,500);
}
});
});
</script>
<?php
}
?>
<!-- Dropplets Tools -->
<?php
include './dropplets/tools.php';
?>
<!-- User Footer Injection -->
<?php
echo FOOTER_INJECT;
?>
<!-- Plugin Footer Injection -->
<?php
action::run('dp_footer');
}
示例6: form_action
function form_action($name = '')
{
$this->validator =& new validator();
parent::action($name);
}
示例7: action
<?php
include "../config/config.php";
include "../common/mysql.class.php";
include "action.php";
$db = new action($mydbhost, $mydbuser, $mydbpw, $mydbname, ALL_PS, $mydbcharset);
session_start();
$uid = $_SESSION['admin_uid'];
$shell = $_SESSION['admin_shell'];
$db->getUserShellCheck($uid, $shell);
$db->getUserOntime();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin Panel</title>
<link href="css/manager.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="title">System Information</div>
<div align="center" class="main_body">
<div class="sysinfo">
<p>SERVER NAME:<?php
echo $_SERVER['SERVER_NAME'];
?>
</p>
<ul>
<li>HTTP HOST:<?php
echo $_SERVER['HTTP_HOST'];
?>
示例8: die
<?php
if (!defined('KIRBY')) {
die('Direct access is not allowed');
}
if ($panel->action != 'edit-file') {
return;
}
$action = action::editFile();
$file = data::fileByFilename();
$form = new fileform($settings, $file);
if (!$file) {
go(showurl('files'));
}
?>
<div class="overlay edit-file">
<form method="post">
<?php
growl($action);
?>
<fieldset>
<h3><?php
echo l::get('files.edit.title');
?>
</h3>
<div class="field">
<label><?php
示例9: die
<?php
if (!defined('KIRBY')) {
die('Direct access is not allowed');
}
snippet('header');
if (!$page->isHomePage() && !$page->isErrorPage()) {
$action = action::updateURL();
?>
<div class="options form">
<form action="<?php
echo thisURL();
?>
" method="post">
<fieldset>
<div class="field url">
<label><?php
echo l::get('options.url');
?>
</label>
<span class="url input"><em><?php
echo dirname(ourl($page->url()));
?>
/</em><strong><input type="url" name="uid" value="<?php
echo $page->uid();
?>
" /></strong></span>
</div>
</fieldset>
示例10: action
*/
$require_current_course = TRUE;
$require_help = TRUE;
$helpTopic = 'Agenda';
$guest_allowed = true;
require_once '../../include/baseTheme.php';
require_once 'include/action.php';
require_once 'include/log.php';
require_once 'include/lib/modalboxhelper.class.php';
require_once 'include/lib/multimediahelper.class.php';
require_once 'modules/search/agendaindexer.class.php';
require_once 'modules/agenda/course_calendar.inc.php';
ModalBoxHelper::loadModalBox();
$action = new action();
$action->record(MODULE_ID_AGENDA);
// define different views of agenda
define('EVENT_LIST_VIEW', 1);
define('EVENT_CALENDAR_VIEW', 0);
$dateNow = date("j-n-Y / H:i", time());
$toolName = $langAgenda;
if (isset($_GET['v'])) {
$v = intval($_GET['v']); // get agenda view
if ($v == 1) {
$view = EVENT_LIST_VIEW; // list view
} else {
$view = EVENT_CALENDAR_VIEW; // calendar view
示例11: display
function display($searchResult)
{
if ($searchResult) {
echo "<div id='result' class='search'>";
echo "<b>Suchergebnis - </b>";
echo " <i class='normal'>" . count($searchResult) . " Treffer</i>";
echo form::link("delete", "x", "index.php?action=hidesearch", "close-search");
action::listit("search", $searchResult);
foreach ($searchResult as $entry) {
$nameArray = thesaurus::get_descriptor($entry[ID]);
export::descriptor($nameArray[ID], session::get("search"), "SHOW");
echo "<hr>";
}
// set parent
if (session::get(show) != 0) {
$parent = session::get(show);
} else {
$parent = system::getval("val_orderdefault");
}
// sugest new entry if orderdefault is set or OB is displayed
if ($parent) {
form::insert_entry(array('parent' => $parent, 'action' => 'add', ""), array(), session::get(search));
} else {
echo "<p>Kein Oberbegriff für neuen Begriff gesetzt.</p>";
}
echo "</div>";
} else {
echo "<div id='result' class='search'>";
echo "<span class='red'>Kein Eintrag gefunden</span>";
echo form::link("delete", "x", "index.php?action=hidesearch", "close-search");
// set parent
if (session::get(show) != 0) {
$parent = session::get(show);
} else {
$parent = system::getval("val_orderdefault");
}
// sugest new entry if orderdefault is set or OB is displayed
if ($parent) {
form::insert_entry(array('parent' => $parent, 'action' => 'add', ""), array(), session::get(search));
} else {
echo "<p>Kein Oberbegriff für neuen Begriff gesetzt.</p>";
}
echo "</div>";
}
}
示例12: form_action
function form_action()
{
$this->validator =& new validator();
parent::action();
}
示例13: __construct
public function __construct()
{
parent::__construct();
ignore_user_abort(true);
set_time_limit(0);
require APP_PATH . 'model/functions.php';
}
示例14: perform
function perform(&$request, &$response)
{
parent :: perform($request, $response);
$full_page_cache_manager = new full_page_cache_manager();
$partial_page_cache_manager = new partial_page_cache_manager();
$image_cache_manager = new image_cache_manager();
$full_page_cache_size = $this->_format_size($full_page_cache_manager->get_cache_size());
$this->view->set('full_page_cache_size', $full_page_cache_size);
$partial_page_cache_size = $this->_format_size($partial_page_cache_manager->get_cache_size());
$this->view->set('partial_page_cache_size', $partial_page_cache_size);
$image_cache_size = $this->_format_size($image_cache_manager->get_cache_size());
$this->view->set('image_cache_size', $image_cache_size);
$template_cache_size = $this->_format_size($this->_get_template_cache_size());
$this->view->set('template_cache_size', $template_cache_size);
$general_cache_size = $this->_format_size($this->_get_general_cache_size());
$this->view->set('general_cache_size', $general_cache_size);
$ini_cache_size = $this->_format_size($this->_get_ini_cache_size());
$this->view->set('ini_cache_size', $ini_cache_size);
}
示例15: __construct
public function __construct()
{
parent::__construct();
$this->init();
$this->view_header();
$this->view_footer();
}