IMP_Compose_Link::link PHP Method

    public function link()
    {
        global $registry;
        $args = $this->args;
        $callback = $raw = false;
        switch ($registry->getView()) {
            case Horde_Registry::VIEW_MINIMAL:
            case Horde_Registry::VIEW_SMARTMOBILE:
                $url = new Horde_Core_Smartmobile_Url(Horde::url('smartmobile.php'));
                $url->setAnchor('compose');
                break;
            default:
                $url = IMP_Dynamic_Compose::url();
                $raw = true;
                $callback = array($this, 'composeLinkSimpleCallback');
                break;
        }
        if (isset($args['mailbox'])) {
            $url = IMP_Mailbox::get($args['mailbox'])->url($url, $args['buid']);
            unset($args['buid'], $args['mailbox']);
        } elseif (!$url instanceof Horde_Url) {
            $url = Horde::url($url);
        }
        $url->setRaw($raw)->add($args);
        if ($callback) {
            $url->toStringCallback = $callback;
        }
        return $url;
    }

Usage Example

Esempio n. 1
0
 /**
  * Return a list of compose window links.
  *
  * @param string|array $args  List of arguments to pass to compose page.
  *                            If this is passed in as a string, it will be
  *                            parsed as a
  *                            toaddress?subject=foo&cc=ccaddress
  *                            (mailto-style) string.
  * @param array $extra        List of hashes of extra, non-standard
  *                            arguments to pass to compose page.
  *
  * @return array  The list of Horde_Url objects with links to the message
  *                composition screen.
  */
 public function batchCompose($args = array(), $extra = array())
 {
     $links = array();
     foreach ($args as $i => $arg) {
         $tmp = new IMP_Compose_Link($arg);
         $links[$i] = $tmp->link();
         if (!empty($extra[$i])) {
             $links[$i]->add($extra[$i]);
         }
     }
     return $links;
 }
All Usage Examples Of IMP_Compose_Link::link