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


PHP Application::param方法代码示例

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


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

示例1: addBlogCommentForm

        protected function addBlogCommentForm()
        {
	    $form = Form::load('logbook.views.AddBlogComment');
            $form->setInputValue('author_id',Application::param('author_id'));
            $form->setInputValue('entry_id',Application::param('entry_id'));
            return $form;
        }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:7,代码来源:add_blog_comment.class.php

示例2: setAuthorId

 public function setAuthorId($id = '')
 {
     if (!$id) {
         $id = Application::param('author_id');
     }
     $this->author_id = $id;
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:7,代码来源:logbook.class.php

示例3: generateRss

 private function generateRss()
 {
     $author = new Author();
     $author->clause('author_id', Application::param('author_id'));
     $posts = $author->also('Entry');
     $posts->order('entry_timestamp');
     $posts->descending();
     $posts->limit(10);
     $blog_entries = $posts->fetch();
     echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
     echo '<rss version="2.0">' . "\n";
     echo '    <channel>' . "\n";
     echo '        <title>' . $this->title() . '</title>' . "\n";
     echo '        <description>' . $this->description() . '</description>' . "\n";
     echo '        <link>' . $this->url() . '</link>' . "\n";
     foreach ($blog_entries as $entry) {
         echo '        <item>' . "\n";
         echo '            <title>' . $entry->get('entry_title') . '</title>' . "\n";
         echo '            <description>' . $entry->get('entry_body') . '</description>' . "\n";
         echo "            <link>'.{$this->url}().'/index.php?h=ViewBlogEntry</link>\n";
         echo '            <guid isPermalink="true">' . $this->url() . '/index.php?h=ViewBlogEntry&author_id=' . $entry->get('author_id') . '&entry_id=' . $entry->get('entry_id') . '</guid>' . "\n";
         echo '            <pubDate>' . $entry->entryDate() . '</pubDate>' . "\n";
         echo '        </item>' . "\n";
     }
     echo '    </channel>' . "\n";
     echo '</rss>' . "\n";
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:27,代码来源:blog_rss_feed.class.php

示例4: performHandlerTasks

 public function performHandlerTasks()
 {
     if(Application::formPosted())
     {
         if(Application::param('edit_about_me'))
             $this->editAboutMe();
     }
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:8,代码来源:edit_blog_author_details.class.php

示例5: mapView

 private function mapView()
 {
     $form = Form::load('sys.views.rsml_test.RsmlMapForm');
     if ($form->validate()) {
         $view = new RsmlView(Application::param('path'));
         $this->map = $view->documentObject();
     }
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:8,代码来源:rsml_map.class.php

示例6: performHandlerTasks

 public function performHandlerTasks()
 {
     $comment = new Comment();
     $comment->clauseSafe('author_id', Logbook::current()->authorId());
     $comment->clauseSafe('entry_id', Application::param('entry_id'));
     $comment->clauseSafe('comment_id', Application::param('comment_id'));
     $comment->delete();
     Application::setParam('author_id', Logbook::current()->authorId());
     $this->redirectOnSave();
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:10,代码来源:delete_blog_comment.class.php

示例7: validate

 public static function validate()
 {
     $data = file_get_contents(Application::host() . 'ext/hn_captcha/hn_captcha.x1.example.php?hncaptcha=' . Application::param('hncaptcha') . '&public_key=' . Application::param('public_key') . '&private_key=' . Application::param('private_key'));
     if (strpos($data, 'Congratulation') !== FALSE) {
         $ret = true;
     } else {
         FormErrors::add('captcha', 'Invalid captcha entry, please try again');
         $ret = false;
     }
     return $ret;
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:11,代码来源:captcha.class.php

示例8: validate

 function validate($value)
 {
     $ret = true;
     if ($value && !Application::param('user_id')) {
         $user = new User();
         $user->clause('user_email', $value);
         if ($user->id()) {
             $ret = false;
             $this->setErrorMessage('A user with that email already exists');
         }
     }
     return $ret;
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:13,代码来源:user_email_validation.class.php

示例9: save

    public function save()
    {
        $form = Form::load('logbook.views.AddBlogEntry');

        if($form->validate())
        {
            $auth = new Author();
            $auth->clause('user_id',Application::current()->user()->id());

            if($auth->id())
            {
                $item = new Entry();
                $item->parse();
                $item->set('author_id',$auth->id());

                if(!Application::param('entry_date'))
                    $item->set('entry_date',date('Y-m-d H:i:s'));

                $item->synch();
                Entry::setTagsAndSave($item,Application::param('entry_tags'));
                $group = new Group();
                $group->noForeign();
                $author_id = $item->get('author_id');
                $entry_id = $item->get('entry_id');
                
                if($groups = $group->fetch())
                {
                    foreach($groups as $group)
                    {
                        if(file_exists(Application::MANAGED_CODE.'lbk_default_access_'.$group->get('access_id')))
                        {
                            $data = file_get_contents(Application::MANAGED_CODE.'lbk_default_access_'.$group->get('access_id'));
                            $perms = unserialize($data);
                            ManageGroupAccess::setPermissionsOnEntryForGroup($author_id,$entry_id,$group->id(),$perms);
                        }
                    }
                }

                Application::setUrlParam('author_id',Application::param('author_id'));
                Application::setUrlParam('entry_id',Application::param('entry_id'));
                LogbookAccess::publishLookupTables();
                $this->redirectOnSave();
            }
            
            else
                die('You are not an author!');
        }
    }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:48,代码来源:add_blog_entry.class.php

示例10: blogEntry

        public static function blogEntry($author_id = '',$entry_id = '')
	{
	    $entry = new Entry();
        $min_access = Application::user()->minAccessLevel();
        $access = $entry->also('Access');
        $access->clause('access_level',$min_access,Clause::GTE);
	    
	    if(Application::user()->id())
	    {
	        $lbk_user = $entry->also('LogbookUser');
                $lbk_user->clauseSafe('user_id',Application::user()->id());
	    }

	    if($author_id)
	        $entry->clauseSafe('author_id',Logbook::current()->authorId());

	        $entry->maybe('BlogTag');
            
            if(!$entry_id)
                $entry_id = Application::param('entry_id');

            if($entry_id&&$author_id)
	        $entry->clauseSafe('entry_id',$entry_id);

            $entry->order('entry_date');
            
            /*$entry->order('author_id');
            $entry->order('entry_id');*/
            $entry->maybe('Comment');
            $entry->descending();
            
            try
            {
	        $page = $entry->page(1,1);
	        $ret = current($page->objects());
	        Logbook::current()->setAuthorId($ret->get('author_id'));
            }
            
            catch(Exception $exc)
            {
                $ret = new Entry();
            }
	    
	    return $ret;
        }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:45,代码来源:view_blog_entry.class.php

示例11: 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();
         }
     }
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:19,代码来源:home.class.php

示例12: display

        public function display()
        {
            $disp = Display::current();
			$disp->setValue('tree_menu', $disp->treeMenu());

            $disp->addView('page_content', 'frost.views.cms.part.text.TextAdd');
            $form = Form::load('frost.views.cms.part.text.TextAdd');
            $form->setInputValue('module_id', Application::param('module_id'));
            $form->setInputValue('media_type', Application::param('media_type'));
            $form->setInputValue('label', 'Plain text item');
            $form->setInputValue('weight', '1000');

            $disp->setValue('module_id', Application::param('module_id'));
            $disp->setValue('login_error', $this->login_error);

            $disp->setValue('current_handler', Application::current()->handler()->getClass());
            $disp->addForm($form);
            $disp->displaySiteTemplate();
        }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:19,代码来源:text_add.class.php

示例13: parseForm

 public function parseForm()
 {
     $reserved = array('form_name', 'return_url', 'mail_to', 'Submit');
     $form_name = Application::param('form_name');
     $mail_to = Application::param('mail_to');
     $return_url = Application::param('return_url');
     $submission_no_query = SimpleQuery::create('SELECT COUNT(DISTINCT submission_no) AS count FROM ant_antenna_data WHERE form_name=\'' . $form_name . '\'');
     $submission_no_results = $submission_no_query->next();
     $submission_no = $submission_no_results['count'];
     $form_data = array();
     foreach (Application::post() as $key => $value) {
         if (!in_array($key, $reserved)) {
             $data = new AntennaData();
             $data->construct('', $form_name, $submission_no, $key, $value, '0');
             $data->saveLater();
             $form_data[$key] = $value;
         }
     }
     $data->purge();
     $this->emailSubmission($form_name, $mail_to, $form_data, $submission_no[count]);
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:21,代码来源:antenna.class.php

示例14: manageAccess

 public function manageAccess()
 {
     $form = Form::load('logbook.views.ManageGroupAccess');
     if ($form->validate()) {
         $group_access_options = Application::param('group_access_options');
         $set_as_default = Application::param('set_as_default');
         $author_id = $this->entry_to_manage_for->get('author_id');
         $entry_id = $this->entry_to_manage_for->get('entry_id');
         if (is_object($this->group_to_manage_for)) {
             $group_id = $this->group_to_manage_for->id();
             ManageGroupAccess::setPermissionsOnEntryForGroup($author_id, $entry_id, $group_id, $group_access_options);
             if (Application::param('set_as_default')) {
                 $group = $this->group_to_manage_for->restrict();
                 $group->noForeign();
                 reset($group_access_options);
                 $data = serialize($group_access_options);
                 file_put_contents(Application::MANAGED_CODE . 'lbk_default_access_' . $group->get('access_id'), $data);
             }
         }
     }
     LogbookAccess::publishLookupTables();
     $this->redirectOnSave();
 }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:23,代码来源:manage_group_access.class.php

示例15: blogEntries

	protected function blogEntries()
	{
            $entry = new Entry();
            $entry->clause('author_id',Application::param('author_id'));
	    $entry->order($this->order_by);
	    
	    if($this->descending)
	        $entry->descending();

	    $entry->maybe('Comment');

            try
            {
                $ret = $entry->page($this->page_num,$this->num_per_page);
            }
            
            catch(Exception $e)
            {
                $ret = false;
            }

	    return $ret;
	}
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:23,代码来源:blog.class.php


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