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


PHP Horde_Url::unique方法代码示例

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


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

示例1:

<?php

/**
 * Copyright 1999-2014 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('ansel');
$blocks = $injector->getInstance('Horde_Core_Factory_BlockCollection')->create(array('ansel'), 'myansel_layout');
$layout = $blocks->getLayoutManager();
// Handle requested actions.
$layout->handle(Horde_Util::getFormData('action'), (int) Horde_Util::getFormData('row'), (int) Horde_Util::getFormData('col'));
if ($layout->updated()) {
    $prefs->setValue('myansel_layout', $layout->serialize());
    if (Horde_Util::getFormData('url')) {
        $url = new Horde_Url(Horde_Util::getFormData('url'));
        $url->unique()->redirect();
    }
}
$page_output->header(array('title' => _("My Photos :: Add Content")));
$notification->notify(array('listeners' => 'status'));
require $registry->get('templates', 'horde') . '/portal/edit.inc';
$page_output->footer();
开发者ID:jubinpatel,项目名称:horde,代码行数:25,代码来源:browse_edit.php

示例2: handle

 /**
  * Process a modification to the current layout.
  *
  * @param string $action  TODO
  * @param integer $row    TODO
  * @param integer $col    TODO
  * @param string $url     TODO
  *
  * @throws Horde_Exception
  */
 public function handle($action, $row, $col, $url = null)
 {
     switch ($action) {
         case 'moveUp':
         case 'moveDown':
         case 'moveLeft':
         case 'moveRight':
         case 'expandUp':
         case 'expandDown':
         case 'expandLeft':
         case 'expandRight':
         case 'shrinkLeft':
         case 'shrinkRight':
         case 'shrinkUp':
         case 'shrinkDown':
         case 'removeBlock':
             try {
                 call_user_func(array($this, $action), $row, $col);
                 $this->_updated = true;
             } catch (Horde_Exception $e) {
                 $GLOBALS['notification']->push($e);
             }
             break;
             // Save the changes made to a block.
         // Save the changes made to a block.
         case 'save':
             // Save the changes made to a block and continue editing.
         // Save the changes made to a block and continue editing.
         case 'save-resume':
             // Get requested block type.
             list($newapp, $newtype) = explode(':', Horde_Util::getFormData('app'));
             // Is this a new block?
             $new = false;
             if ($this->isEmpty($row, $col) || !$this->rowExists($row) || !$this->colExists($col)) {
                 // Check permissions.
                 $max_blocks = $GLOBALS['injector']->getInstance('Horde_Core_Perms')->hasAppPermission('max_blocks');
                 if ($max_blocks !== true && $max_blocks <= count($this)) {
                     Horde::permissionDeniedError('horde', 'max_blocks', sprintf(Horde_Core_Translation::ngettext("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", $max_blocks), $max_blocks));
                     break;
                 }
                 $new = true;
                 // Make sure there is somewhere to put it.
                 $this->addBlock($row, $col);
             }
             // Or an existing one?
             $exists = false;
             $changed = false;
             if (!$new) {
                 // Get target block info.
                 $info = $this->getBlockInfo($row, $col);
                 $exists = $this->isBlock($row, $col);
                 // Has a different block been selected?
                 if ($exists && ($info['app'] != $newapp || $info['block'] != $newtype)) {
                     $changed = true;
                 }
             }
             if ($new || $changed) {
                 // Change app or type.
                 $info = array('app' => $newapp, 'block' => $newtype);
                 $params = $this->_collection->getParams($newapp, $newtype);
                 foreach ($params as $newparam) {
                     $info['params'][$newparam] = $this->_collection->getDefaultValue($newapp, $newtype, $newparam);
                 }
                 $this->setBlockInfo($row, $col, $info);
             } elseif ($exists) {
                 // Change values.
                 $this->setBlockInfo($row, $col, array('params' => Horde_Util::getFormData('params', array())));
             }
             $this->_updated = true;
             if ($action == 'save') {
                 break;
             }
             // Make a block the current block for editing.
         // Make a block the current block for editing.
         case 'edit':
             $this->_currentBlock = array($row, $col);
             $url = null;
             break;
     }
     if (!empty($url)) {
         $url = new Horde_Url($url);
         $url->unique()->redirect();
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:94,代码来源:Manager.php


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