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


PHP Pluf_HTTP_URL_urlForView函数代码示例

本文整理汇总了PHP中Pluf_HTTP_URL_urlForView函数的典型用法代码示例。如果您正苦于以下问题:PHP Pluf_HTTP_URL_urlForView函数的具体用法?PHP Pluf_HTTP_URL_urlForView怎么用?PHP Pluf_HTTP_URL_urlForView使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: save

 /**
  * Save the model in the database.
  *
  * @param bool Commit in the database or not. If not, the object
  *             is returned but not saved in the database.
  * @return string Url to redirect to the form.
  */
 function save($commit = true)
 {
     if (!$this->isValid()) {
         throw new Exception(__('Cannot save an invalid form.'));
     }
     return Pluf_HTTP_URL_urlForView('IDF_Views::registerConfirmation', array($this->cleaned_data['key']));
 }
开发者ID:burbuja,项目名称:indefero,代码行数:14,代码来源:RegisterInputKey.php

示例2: save

 /**
  * Save the model in the database.
  *
  * @param bool Commit in the database or not. If not, the object
  *             is returned but not saved in the database.
  * @return Object Model with data set from the form.
  */
 function save($commit = true)
 {
     if (!$this->isValid()) {
         throw new Exception(__('Cannot save the model from an invalid form.'));
     }
     return Pluf::f('url_base') . Pluf_HTTP_URL_urlForView('IDF_Views_User::changeEmailDo', array($this->cleaned_data['key']));
 }
开发者ID:burbuja,项目名称:indefero,代码行数:14,代码来源:UserChangeEmail.php

示例3: initFields

 public function initFields($extra = array())
 {
     $this->conf = $extra['conf'];
     if ($extra['remote_svn']) {
         $this->fields['svn_username'] = new Pluf_Form_Field_Varchar(array('required' => false, 'label' => __('Repository username'), 'initial' => $this->conf->getVal('svn_username', ''), 'widget_attrs' => array('size' => '15')));
         $this->fields['svn_password'] = new Pluf_Form_Field_Varchar(array('required' => false, 'label' => __('Repository password'), 'initial' => $this->conf->getVal('svn_password', ''), 'widget' => 'Pluf_Form_Widget_PasswordInput'));
     }
     Pluf::loadFunction('Pluf_HTTP_URL_urlForView');
     $url = Pluf_HTTP_URL_urlForView('idf_faq') . '#webhooks';
     $this->fields['webhook_url'] = new Pluf_Form_Field_Url(array('required' => false, 'label' => __('Webhook URL'), 'initial' => $this->conf->getVal('webhook_url', ''), 'help_text' => sprintf(__('Learn more about the <a href="%s">post-commit web hooks</a>.'), $url), 'widget_attrs' => array('size' => 35)));
 }
开发者ID:burbuja,项目名称:indefero,代码行数:11,代码来源:SourceConf.php

示例4: feedFragment

 public function feedFragment($request)
 {
     $review = $this->get_patch()->get_review();
     $url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view', array($request->project->shortname, $review->id));
     $title = sprintf(__('%s: Updated review %d - %s'), Pluf_esc($request->project->name), $review->id, Pluf_esc($review->summary));
     $url .= '#ic' . $this->id;
     $date = Pluf_Date::gmDateToGmString($this->creation_dtime);
     $context = new Pluf_Template_Context_Request($request, array('url' => $url, 'author' => $this->get_submitter(), 'title' => $title, 'c' => $this, 'review' => $review, 'date' => $date));
     $tmpl = new Pluf_Template('idf/review/feedfragment.xml');
     return $tmpl->render($context);
 }
开发者ID:Br3nda,项目名称:indefero,代码行数:11,代码来源:Comment.php

示例5: callbackWikiPage

 function callbackWikiPage($m)
 {
     $sql = new Pluf_SQL('project=%s AND title=%s', array($this->project->id, $m[2]));
     $pages = Pluf::factory('IDF_WikiPage')->getList(array('filter' => $sql->gen()));
     if ($pages->count() != 1 and $this->request->rights['hasWikiAccess'] and !$this->request->user->isAnonymous()) {
         return '<img style="vertical-align: text-bottom;" alt=" " src="' . Pluf::f('url_media') . '/idf/img/add.png" /><a href="' . Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::create', array($this->project->shortname), array('name' => $m[2])) . '" title="' . __('Create this documentation page') . '">' . $m[1] . '</a>';
     }
     if (!$this->request->rights['hasWikiAccess'] or $pages->count() == 0) {
         return $m[1];
     }
     return '<a href="' . Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view', array($this->project->shortname, $pages[0]->title)) . '" title="' . Pluf_esc($pages[0]->summary) . '">' . $m[1] . '</a>';
 }
开发者ID:burbuja,项目名称:indefero,代码行数:12,代码来源:Markdown.php

示例6: __construct

 /**
  * The $request object is used to know what the post login
  * redirect url should be.
  *
  * If the action url of the login page is not set, it will try to
  * get the url from the login view from the 'login_view'
  * configuration key.
  *
  * @param Pluf_HTTP_Request The request object of the current page.
  * @param string The full url of the login page (null)
  */
 function __construct($request, $loginurl = null)
 {
     if ($loginurl !== null) {
         $murl = new Pluf_HTTP_URL();
         $url = $murl->generate($loginurl, array('_redirect_after' => $request->uri), false);
         $encoded = $murl->generate($loginurl, array('_redirect_after' => $request->uri));
     } else {
         Pluf::loadFunction('Pluf_HTTP_URL_urlForView');
         $url = Pluf_HTTP_URL_urlForView(Pluf::f('login_view', 'login_view'), array(), array('_redirect_after' => $request->uri), false);
         $encoded = Pluf_HTTP_URL_urlForView(Pluf::f('login_view', 'login_view'), array(), array('_redirect_after' => $request->uri));
     }
     $content = sprintf(__('<a href="%s">Please, click here to be redirected</a>.'), $encoded);
     parent::__construct($content);
     $this->headers['Location'] = $url;
     $this->status_code = 302;
 }
开发者ID:burbuja,项目名称:pluf,代码行数:27,代码来源:RedirectToLogin.php

示例7: changelogRev

 /**
  * Display SVN changelog from specific revision
  *
  */
 public function changelogRev($request, $match)
 {
     $prj = $request->project;
     if ($request->conf->getVal('scm', 'git') != 'svn') {
         // Redirect to tree base if not svn
         $scmRoot = $prj->getScmRoot();
     } else {
         // Get revision value if svn
         if (!isset($request->REQUEST['rev']) or trim($request->REQUEST['rev']) == '') {
             $scmRoot = $prj->getScmRoot();
         } else {
             $scmRoot = $request->REQUEST['rev'];
         }
     }
     $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::changeLog', array($prj->shortname, $scmRoot));
     return new Pluf_HTTP_Response_Redirect($url);
 }
开发者ID:burbuja,项目名称:indefero,代码行数:21,代码来源:Svn.php

示例8: revisionValid

 /**
  * Validates the revision given in the URL path and acts accordingly
  *
  * @param $request
  * @return true | Pluf_HTTP_Response_Redirect
  * @throws Exception
  */
 public static function revisionValid($request)
 {
     list($url_info, $url_matches) = $request->view;
     list(, $project, $commit) = $url_matches;
     $scm = IDF_Scm::get($request->project);
     $res = $scm->validateRevision($commit);
     switch ($res) {
         case IDF_Scm::REVISION_VALID:
             return true;
         case IDF_Scm::REVISION_INVALID:
             $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::invalidRevision', array($request->project->shortname, $commit));
             return new Pluf_HTTP_Response_Redirect($url);
         case IDF_Scm::REVISION_AMBIGUOUS:
             $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::disambiguateRevision', array($request->project->shortname, $commit, $url_info['model'] . '::' . $url_info['method']));
             return new Pluf_HTTP_Response_Redirect($url);
         default:
             throw new Exception('unknown validation result: ' . $res);
     }
 }
开发者ID:burbuja,项目名称:indefero,代码行数:26,代码来源:Precondition.php

示例9: start

 /**
  * We need the user object and the request.
  *
  * If the user object is null (for example a non associated
  * commit), we can use the $text value for an alternative display.
  *
  * @param Pluf_User
  * @param Pluf_HTTP_Request
  * @param string Alternate text ('')
  */
 function start($user, $request, $text = '', $echo = true)
 {
     if ($user == null) {
         $out = strlen($text) ? strip_tags($text) : __('Anonymous');
     } else {
         if (!$user->isAnonymous() and $user->id == $request->user->id) {
             $utext = __('Me');
             $url = Pluf_HTTP_URL_urlForView('idf_dashboard');
         } else {
             $utext = Pluf_esc($user);
             $url = Pluf_HTTP_URL_urlForView('IDF_Views_User::view', array($user->login));
         }
         $out = sprintf('<a href="%s" class="username">%s</a>', $url, $utext);
     }
     if ($echo) {
         echo $out;
     } else {
         return $out;
     }
 }
开发者ID:burbuja,项目名称:indefero,代码行数:30,代码来源:ShowUser.php

示例10: start

 function start($view, $params = array(), $get_params = array())
 {
     echo Pluf_HTTP_URL_urlForView($view, $params, $get_params);
 }
开发者ID:burbuja,项目名称:pluf,代码行数:4,代码来源:Url.php

示例11: download

 public function download($request, $match)
 {
     $commit = trim($match[2]);
     $scm = IDF_Scm::get($request->project);
     if (!$scm->isValidRevision($commit)) {
         // Redirect to the first branch
         $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase', array($request->project->shortname, $scm->getMainBranch()));
         return new Pluf_HTTP_Response_Redirect($url);
     }
     $base = $request->project->shortname . '-' . $commit;
     $cmd = $scm->getArchiveCommand($commit, $base . '/');
     $rep = new Pluf_HTTP_Response_CommandPassThru($cmd, 'application/x-zip');
     $rep->headers['Content-Transfer-Encoding'] = 'binary';
     $rep->headers['Content-Disposition'] = 'attachment; filename="' . $base . '.zip"';
     return $rep;
 }
开发者ID:Br3nda,项目名称:indefero,代码行数:16,代码来源:Source.php

示例12: feedFragment

 public function feedFragment($request)
 {
     $url = Pluf::f('url_base') . Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view', array($request->project->shortname, $this->id));
     $title = sprintf(__('%s: Issue %d created - %s'), $request->project->name, $this->id, $this->summary);
     $cts = $this->get_comments_list(array('order' => 'id ASC', 'nb' => 1));
     $date = Pluf_Date::gmDateToGmString($this->creation_dtime);
     $context = new Pluf_Template_Context_Request($request, array('url' => $url, 'author' => $this->get_submitter(), 'title' => $title, 'c' => $cts[0], 'issue' => $this, 'date' => $date));
     $tmpl = new Pluf_Template('idf/issues/feedfragment.xml');
     return $tmpl->render($context);
 }
开发者ID:Br3nda,项目名称:indefero,代码行数:10,代码来源:Issue.php

示例13: star

 public function star($request, $match)
 {
     $prj = $request->project;
     $issue = Pluf_Shortcuts_GetObjectOr404('IDF_Issue', $match[2]);
     $prj->inOr404($issue);
     if ($request->method == 'POST') {
         $starred = Pluf_Model_InArray($request->user, $issue->get_interested_list());
         if ($starred) {
             $issue->delAssoc($request->user);
             $request->user->setMessage(__('The issue has been removed from your watch list.'));
         } else {
             $issue->setAssoc($request->user);
             $request->user->setMessage(__('The issue has been added to your watch list.'));
         }
     }
     $url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view', array($prj->shortname, $issue->id));
     return new Pluf_HTTP_Response_Redirect($url);
 }
开发者ID:Br3nda,项目名称:indefero,代码行数:18,代码来源:Issue.php

示例14: deleteObject

 /**
  * Delete an object (Part of the CRUD series).
  *
  * The minimal extra parameter is the model class name. The list
  * of extra parameters is:
  *
  * 'model' - Class name string, required.
  *
  * 'post_delete_redirect' - View to redirect after saving, required.
  *
  * 'id' - Index in the match to fin the id of the object to delete (1)
  * 
  * 'login_required' - Do we require login (false)
  *
  * 'template' - Template to use ('"model class"_confirm_delete.html')
  *
  * 'post_delete_redirect_keys' - Which keys of the model to pass to
  *                             the view (array())
  *
  * 'extra_context' - Array of key/values to be added to the
  *                   context (array())
  * 
  * @param Pluf_HTTP_Request Request object
  * @param array Match
  * @param array Extra parameters
  * @return Pluf_HTTP_Response Response object (can be a redirect)
  */
 public function deleteObject($request, $match, $p)
 {
     if (isset($p['login_required']) && true == $p['login_required']) {
         if ($request->user->isAnonymous()) {
             return new Pluf_HTTP_Response_RedirectToLogin($request);
         }
     }
     if (!isset($p['model'])) {
         throw new Exception('The model class was not provided in the parameters.');
     }
     // Set the default
     $id = isset($p['id']) ? $match[$p['id']] : $match[1];
     $model = $p['model'];
     $context = isset($p['extra_context']) ? $p['extra_context'] : array();
     $template = isset($p['template']) ? $p['template'] : strtolower($model) . '_confirm_delete.html';
     $post_delete_keys = isset($p['post_delete_redirect_keys']) ? $p['post_delete_redirect_keys'] : array();
     $object = Pluf_Shortcuts_GetObjectOr404($model, $id);
     if ($request->method == 'POST') {
         $object->delete();
         if (isset($p['post_delete_redirect'])) {
             $url = Pluf_HTTP_URL_urlForView($p['post_delete_redirect'], $post_delete_keys);
         } else {
             throw new Exception('No URL to redirect to from generic delete view.');
         }
         if (!$request->user->isAnonymous()) {
             $request->user->setMessage(sprintf(__('The %s was deleted successfully.'), $object->_a['verbose']));
         }
         return new Pluf_HTTP_Response_Redirect($url);
     }
     return Pluf_Shortcuts_RenderToResponse($template, array_merge($context, array('object' => $object)), $request);
 }
开发者ID:burbuja,项目名称:pluf,代码行数:58,代码来源:Views.php

示例15: userCreate

 public function userCreate($request, $match)
 {
     $params = array('request' => $request);
     if ($request->method == 'POST') {
         $form = new IDF_Form_Admin_UserCreate($request->POST, $params);
         if ($form->isValid()) {
             $cuser = $form->save();
             $request->user->setMessage(sprintf(__('The user %s has been created.'), (string) $cuser));
             $url = Pluf_HTTP_URL_urlForView('IDF_Views_Admin::users');
             return new Pluf_HTTP_Response_Redirect($url);
         }
     } else {
         $form = new IDF_Form_Admin_UserCreate(null, $params);
     }
     $title = __('Add User');
     return Pluf_Shortcuts_RenderToResponse('idf/gadmin/users/create.html', array('page_title' => $title, 'form' => $form), $request);
 }
开发者ID:Br3nda,项目名称:indefero,代码行数:17,代码来源:Admin.php


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