本文整理汇总了PHP中Application::formPosted方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::formPosted方法的具体用法?PHP Application::formPosted怎么用?PHP Application::formPosted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::formPosted方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: performHandlerTasks
public function performHandlerTasks()
{
if (($author_id = Application::param('author_id')) && ($entry_id = Application::param('entry_id'))) {
$entry = new Entry();
$entry->clauseSafe('author_id', $author_id);
$entry->clauseSafe('entry_id', $entry_id);
$this->entry_to_manage_for = $entry;
} else {
$this->redirectOnAccessDenied();
}
if (!LogbookAccess::currentUserCanManageAccess($this->entryToManageFor())) {
$this->redirectOnAccessDenied();
}
if ($group_id = Application::param('group_id')) {
$this->group_to_manage_for = new Group();
$this->group_to_manage_for->clauseSafe('group_id', $group_id);
}
if (Application::formPosted()) {
if (Application::param('choose_group')) {
$this->chooseGroup();
}
if (Application::param('manage_access')) {
$this->manageAccess();
}
}
}
示例2: performHandlerTasks
public function performHandlerTasks()
{
if(Application::formPosted())
{
if(Application::param('add_blog_comment'))
$this->save();
}
}
示例3: performHandlerTasks
public function performHandlerTasks()
{
if(Application::formPosted())
{
if(Application::param('edit_about_me'))
$this->editAboutMe();
}
}
示例4: performHandlerTasks
public function performHandlerTasks()
{
if(!LogbookAccess::currentUserCanEdit($this->entryToEdit()))
$this->redirectOnAccessDenied();
if(Application::formPosted())
{
if(Application::param('edit_blog_entry'))
$this->doEdit();
else if(Application::param('delete_blog_entry'))
$this->deleteBlogEntry();
}
}
示例5: performHandlerTasks
public function performHandlerTasks()
{
if(Application::formPosted())
{
if(!Application::param('cancel_edit'))
{
$this->savePart();
}
else if(Application::param('cancel_edit'))
{
Application::setUrlParam('module_id',Application::param('module_id'));
Application::redirect('ModuleDetail');
}
}
}
示例6: performHandlerTasks
public function performHandlerTasks()
{
if (Application::formPosted()) {
$form = Form::load('seeingsystem.views.Login');
if ($form->validate()) {
try {
PilotApplication::login(Application::param('user_email'), Application::param('user_password'));
} catch (UserNotFoundException $exc) {
$this->login_error = 'No user with that email is registered';
} catch (InvalidPasswordException $exc) {
$this->login_error = 'The password was incorrect';
}
}
} else {
if (Application::param('logout')) {
PIlotApplication::logout();
}
}
}
示例7: display
public function display($vars)
{
$disp = new Display();
if (!$vars || is_array($vars) && !count($vars)) {
$vars = array('dumb', 'dumber');
}
$disp->setFilter($vars, '$$');
if (Application::formPosted()) {
$params = Application::post();
} else {
$params = '';
}
$disp->setValue('form_name', $this->name);
$disp->setValue('form_action', Display::current()->hrefString($this->handler));
foreach ($this->inputs as $inp) {
if (!$this->clear) {
$name = $inp->name();
if ($inp->valueOverride()) {
$value = $inp->value();
} else {
if ($params) {
$value = Form::getValueFromArray($name, $params);
} else {
$value = $inp->value();
}
}
} else {
$value = '';
}
if ($inp->allowsOptions()) {
if ($value === '' && !$this->clear) {
$value = $inp->selected;
}
$inp->setSelected($value);
$options = $inp->generateInputObjects();
$disp->setValue($inp->name() . '_options', $options);
} else {
if ($inp->getClass() == 'FileInput' || $inp->getClass() == 'ImageInput') {
$disp->setValue($inp->name() . '_existing_file', $inp->value());
} else {
if ($inp->getClass() == 'DateInput') {
if ($params && $value !== '') {
$day = ArrayUtility::getArrayValue($value, 'day');
$month = ArrayUtility::getArrayValue($value, 'month');
$year = ArrayUtility::getArrayValue($value, 'year');
} else {
if ($value !== '') {
//$inp->setValue($value);
$day = $inp->day();
$month = $inp->month();
$year = $inp->year();
} else {
if (!$this->clear) {
$day = $inp->day();
$month = $inp->month();
$year = $inp->year();
} else {
$year = '';
$month = '';
$day = '';
}
}
}
$disp->setValue($inp->name() . '_year_value', $year);
$disp->setValue($inp->name() . '_month_value', $month);
$disp->setValue($inp->name() . '_day_value', $day);
} else {
if ($value === '' && !is_numeric($value) && !$this->clear || $inp instanceof HiddenInput && !$this->clear) {
$value = $inp->value();
}
$disp->setValue($inp->name() . '_value', $value);
}
}
}
}
$new_path = '';
if (is_array($vars) && count($vars)) {
$path = Application::CACHE . Form::cachePath($this->initPath()) . '.t';
$new_path = Application::CACHE . 'dead-' . time() . '-' . Form::cachePath($this->initPath()) . '.t';
$data = file_get_contents($path);
foreach ($vars as $name => $value) {
$data = str_replace('$$' . strtoupper(str_replace('-', '_', $name)) . '$$', $value, $data);
}
$data = preg_replace('/\\$\\$[A-Z_]*\\$\\$/', '', $data);
@unlink($new_path);
file_put_contents($new_path, $data);
chmod($new_path, 0664);
$path = $new_path;
} else {
$path = Application::CACHE . Form::cachePath($this->initPath()) . '.t';
}
foreach ($this->widgets() as $widg) {
$widg->registerJavascript($disp);
}
$disp->displayPage($path);
if ($new_path) {
unlink($new_path);
}
}
示例8: buttonClicked
function buttonClicked($name)
{
$ret = FALSE;
if (Application::formPosted()) {
if (isset($_POST[$name]) || isset($_POST[$name . '_x']) || isset($_POST[$name . '_y'])) {
$ret = TRUE;
}
}
return $ret;
}
示例9: performHandlerTasks
public function performHandlerTasks()
{
if (Application::formPosted()) {
$this->mapView();
}
}