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


PHP Horde::externalUrl方法代码示例

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


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

示例1: token

 /**
  * Renders a token into text matching the requested format.
  *
  * @param array $options  The "options" portion of the token (second
  *                        element).
  *
  * @return string  The text rendered from the token options.
  */
 public function token($options)
 {
     if (!isset($options['attr']['alt'])) {
         $options['attr']['alt'] = $options['src'];
     }
     if (strpos($options['src'], '://') === false) {
         if ($options['src'][0] != '/') {
             if (strpos($options['src'], ':')) {
                 list($page, $options['src']) = explode(':', $options['src'], 2);
             } else {
                 $page = Horde_Util::getFormData('page');
                 if ($page == 'EditPage') {
                     $page = Horde_Util::getFormData('referrer');
                 }
                 if (empty($page)) {
                     $page = 'Wiki/Home';
                 }
             }
             $params = array('page' => $page, 'mime' => '1', 'file' => $options['src']);
             $options['src'] = $GLOBALS['registry']->downloadUrl($options['src'], $params)->setRaw(true);
         }
     } else {
         $options['src'] = new Horde_Url(Horde::externalUrl($options['src']));
         $options['src']->setRaw(true);
     }
     // Send external links through Horde::externalUrl().
     if (isset($options['attr']['link']) && strpos($options['attr']['link'], '://')) {
         $href = htmlspecialchars($options['attr']['link']);
         unset($options['attr']['link']);
         return Horde::link(Horde::externalUrl($href), $href) . $this->_token($options) . '</a>';
     } else {
         return $this->_token($options);
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:42,代码来源:Image2.php

示例2: token

 /**
  * Renders a token into text matching the requested format.
  *
  * @param array $options  The "options" portion of the token (second
  *                        element).
  *
  * @return string  The text rendered from the token options.
  */
 public function token($options)
 {
     $site = $options['site'];
     $page = $options['page'];
     $text = $options['text'];
     if (isset($this->conf['sites'][$site])) {
         $href = $this->conf['sites'][$site];
     } else {
         return $text;
     }
     // old form where page is at end,
     // or new form with %s placeholder for sprintf()?
     if (strpos($href, '%s') === false) {
         // use the old form
         $href = $href . $page;
     } else {
         // use the new form
         $href = sprintf($href, $page);
     }
     // allow for alternative targets
     $target = $this->getConf('target', '');
     if ($target && trim($target) != '') {
         $target = " target=\"{$target}\"";
     }
     return '<a' . $target . ' href="' . Horde::externalUrl($href) . '">' . $text . '</a>';
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:34,代码来源:Interwiki.php

示例3: token

 /**
  * Renders a token into text matching the requested format.
  *
  * @param array $options  The "options" portion of the token (second
  *                        element).
  *
  * @return string  The text rendered from the token options.
  */
 public function token($options)
 {
     // Create local variables from the options array (text, href,
     // type).
     extract($options);
     // Find the rightmost dot and determine the filename
     // extension.
     $pos = strrpos($href, '.');
     $ext = Horde_String::lower(substr($href, $pos + 1));
     $href = htmlspecialchars($href);
     // Allow for alternative targets on non-anchor HREFs.
     if ($href[0] == '#') {
         $target = '';
     } else {
         $target = $this->getConf('target', '');
     }
     $output = Horde::link(Horde::externalUrl($href), $href, 'external', htmlspecialchars($target)) . htmlspecialchars($text) . '</a>';
     // Make numbered references look like footnotes.
     if ($type == 'footnote') {
         $output = '<sup>' . $output . '</sup>';
     }
     return $output;
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:Url.php

示例4: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $prefs, $registry, $session;
     $twitter = $injector->getInstance('Horde_Service_Twitter');
     $token = unserialize($prefs->getValue('twitter'));
     /* Check for an existing token */
     if (!empty($token['key']) && !empty($token['secret'])) {
         $auth_token = new Horde_Oauth_Token($token['key'], $token['secret']);
         $twitter->auth->setToken($auth_token);
     }
     try {
         $profile = Horde_Serialize::unserialize($twitter->account->verifyCredentials(), Horde_Serialize::JSON);
     } catch (Horde_Service_Twitter_Exception $e) {
     }
     $view = new Horde_View(array('templatePath' => HORDE_TEMPLATES . '/prefs'));
     $view->addHelper('Text');
     $view->appname = $registry->get('name');
     /* Could not find a valid auth token, and we are not in the process of
      * getting one */
     if (empty($profile)) {
         try {
             $results = $twitter->auth->getRequestToken();
         } catch (Horde_Service_Twitter_Exception $e) {
             throw new Horde_Exception(sprintf(_("Error connecting to Twitter: %s Details have been logged for the administrator."), $e->getMessage()));
         }
         $session->store($results->secret, false, 'twitter_request_secret');
         $view->link = new Horde_Url(Horde::externalUrl($twitter->auth->getUserAuthorizationUrl($results), false));
     } else {
         $view->haveSession = true;
         $view->profile_image_url = $profile->profile_image_url;
         $view->profile_screenname = $profile->screen_name;
         $view->profile_name = $profile->name;
         $view->profile_location = $profile->location;
     }
     return $view->render('twitter');
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:38,代码来源:Twitter.php

示例5: _title

 /**
  */
 protected function _title()
 {
     return Horde::externalUrl('http://facebook.com', true) . $this->getName() . '</a>';
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:6,代码来源:FbStream.php

示例6: _

              <?php 
        }
        ?>
           </tr>
           <?php 
        $futureDays++;
        ?>
         <?php 
    }
    ?>
      </table>
      <!-- Logo -->
      <?php 
    if ($this->logo) {
        ?>
        <div class="rightAlign"><?php 
        echo _("Weather data provided by") . ' ' . Horde::link(Horde::externalUrl($this->link), $this->title, '', '_blank', '', $this->title) . Horde_Themes_Image::tag($this->logo);
        ?>
</a></div>
      <?php 
    } else {
        ?>
        <div class="rightAlign"><?php 
        echo _("Weather data provided by") . ' ' . Horde::link(Horde::externalUrl($this->link), $this->title, '', '_blank', '', $this->title) . '<em>' . $this->title;
        ?>
</em></a></div>
      <?php 
    }
    ?>
  <?php 
}
开发者ID:raz0rsdge,项目名称:horde,代码行数:31,代码来源:weather_content.html.php

示例7: _renderVarDisplay_address


//.........这里部分代码省略.........
             }
         }
     } elseif (preg_match('/(.*)\\n(.*)\\s*,\\s*(\\w+)\\.?\\s+(\\d+|[a-zA-Z]\\d[a-zA-Z]\\s?\\d[a-zA-Z]\\d)/', $address, $addressParts)) {
         /* American/Canadian address style. */
         /* Mapquest generated map */
         $mapurl = 'http://www.mapquest.com/maps/map.adp?size=big&zoom=7';
         $desc = Horde_Model_Translation::t("MapQuest map");
         $icon = 'map.png';
         $country = null;
         if (!empty($addressParts[4]) && preg_match('|[a-zA-Z]\\d[a-zA-Z]\\s?\\d[a-zA-Z]\\d|', $addressParts[4])) {
             $country = 'CA';
         }
         if (!empty($addressParts[1])) {
             $mapurl .= '&address=' . urlencode($addressParts[1]);
         }
         if (!empty($addressParts[2])) {
             $mapurl .= '&city=' . urlencode($addressParts[2]);
         }
         if (!empty($addressParts[3])) {
             $mapurl .= '&state=' . urlencode($addressParts[3]);
         }
         if (!empty($addressParts[4])) {
             if ($country == 'CA') {
                 $mapurl .= '&country=CA';
             }
             $mapurl .= '&zipcode=' . urlencode($addressParts[4]);
         }
         /* Yahoo! generated map. */
         $mapurl2 = 'http://us.rd.yahoo.com/maps/home/submit_a/*-http://maps.yahoo.com/maps?srchtype=a&getmap=Get+Map&';
         $desc2 = Horde_Model_Translation::t("Yahoo! map");
         $icon2 = 'map.png';
         if (!empty($addressParts[1])) {
             $mapurl2 .= '&addr=' . urlencode($addressParts[1]);
         }
         /* Give precedence to zipcode over city/state */
         if (empty($addressParts[4]) && !empty($addressParts[2]) && !empty($addressParts[3])) {
             $mapurl2 .= '&csz=' . urlencode($addressParts[2] . ' ' . $addressParts[3]);
         }
         if (!empty($addressParts[4])) {
             if (preg_match('|([a-zA-Z]\\d[a-zA-Z])\\s?(\\d[a-zA-Z]\\d)|', $addressParts[4], $pcParts)) {
                 $mapurl2 .= '&country=ca';
                 /* make sure the postal-code has a space */
                 $addressParts[4] = $pcParts[1] . ' ' . $pcParts[2];
             }
             $mapurl2 .= '&csz=' . urlencode($addressParts[4]);
         }
         /* Google generated map. */
         $mapurl3 = 'http://maps.google.com/maps?q=' . urlencode($addressParts[0]) . '&hl=en';
         $desc3 = Horde_Model_Translation::t("Google Maps");
         $icon3 = 'map.png';
     } elseif (preg_match('/(.*?)\\r?\\n([A-Z]{1,3})-(\\d{5})\\s+(.*)/i', $address, $addressParts)) {
         /* European address style. */
         include 'Horde/Nls/Carsigns.php';
         $country = array_search(Horde_String::upper($addressParts[2]), $carsigns);
         /* Map24 generated map. */
         if (in_array($country, array('al', 'ad', 'am', 'az', 'be', 'ba', 'bg', 'de', 'dk', 'ee', 'fo', 'fi', 'fr', 'ge', 'gr', 'gb', 'ie', 'is', 'it', 'hr', 'lv', 'li', 'lt', 'lu', 'mt', 'mk', 'md', 'mc', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'se', 'ch', 'cs', 'sk', 'si', 'es', 'cz', 'tr', 'ua', 'hu', 'by', 'cy', 'at'))) {
             if (in_array($country, array('at', 'be', 'ch', 'de', 'dk', 'es', 'fi', 'fr', 'it', 'nl', 'no', 'se'))) {
                 $mirror = $country;
             } else {
                 $mirror = 'uk';
             }
             $mapurl = 'http://www.' . $mirror . '.map24.com/source/address/v2.0.0/cnt_nav_maplet.php?cid=validateaddr&country=' . $country;
             $desc = Horde_Model_Translation::t("Map24 map");
             $icon = 'map_eu.png';
             if (!empty($addressParts[1])) {
                 $mapurl .= '&street=' . urlencode($addressParts[1]);
             }
             if (!empty($addressParts[3])) {
                 $mapurl .= '&zip=' . urlencode($addressParts[3]);
             }
             if (!empty($addressParts[4])) {
                 $mapurl .= '&city=' . urlencode($addressParts[4]);
             }
         }
         /* Mapquest generated map. */
         $mapurl2 = 'http://www.mapquest.com/maps/map.adp?country=' . Horde_String::upper($country);
         $desc2 = Horde_Model_Translation::t("MapQuest map");
         $icon2 = 'map_eu.png';
         if (!empty($addressParts[1])) {
             $mapurl2 .= '&address=' . urlencode($addressParts[1]);
         }
         if (!empty($addressParts[3])) {
             $mapurl2 .= '&zipcode=' . urlencode($addressParts[3]);
         }
         if (!empty($addressParts[4])) {
             $mapurl2 .= '&city=' . urlencode($addressParts[4]);
         }
     }
     $html = nl2br(htmlspecialchars($var->getValue($vars)));
     if (!empty($mapurl)) {
         $html .= '&nbsp;&nbsp;' . Horde::link(Horde::externalUrl($mapurl), $desc, null, '_blank') . Horde::img($icon, $desc) . '</a>';
     }
     if (!empty($mapurl2)) {
         $html .= '&nbsp;' . Horde::link(Horde::externalUrl($mapurl2), $desc2, null, '_blank') . Horde::img($icon2, $desc2) . '</a>';
     }
     if (!empty($mapurl3)) {
         $html .= '&nbsp;' . Horde::link(Horde::externalUrl($mapurl3), $desc3, null, '_blank') . Horde::img($icon3, $desc3) . '</a>';
     }
     return $html;
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:101,代码来源:Xhtml.php

示例8: _buildPost

 /**
  * Build the Horde_View object for a FB Post.
  *
  * @param stdClass $post  The Facebook post object.
  *
  * @return string  The HTML to render the $post.
  */
 protected function _buildPost($post)
 {
     global $prefs;
     $facebook = $this->_getFacebookObject();
     $instance = $this->vars->instance;
     $uid = $facebook->auth->getLoggedInUser();
     $postView = new Horde_View(array('templatePath' => HORDE_TEMPLATES . '/block'));
     $postView->actorImgUrl = $facebook->users->getThumbnail($post->from->id);
     $postView->actorProfileLink = Horde::externalUrl($facebook->users->getProfileLink($post->from->id), true);
     $postView->actorName = $post->from->name;
     $postView->message = empty($post->message) ? '' : $post->message;
     $postView->likes = $post->likes->count;
     $postView->postId = $post->id;
     $postView->privacy = $post->privacy;
     $postView->postInfo = sprintf(_("Posted %s"), Horde_Date_Utils::relativeDateTime($post->created_time, $prefs->getValue('date_format'), $prefs->getValue('twentyFour') ? "%H:%M %P" : "%I %M %P")) . ' ' . sprintf(_("Comments: %d"), $post->comments->count);
     $postView->type = $post->type;
     if (!empty($post->picture)) {
         $postView->attachment = new stdClass();
         $postView->attachment->image = $post->picture;
         if (!empty($post->link)) {
             $postView->attachment->link = Horde::externalUrl($post->link, true);
         }
         if (!empty($post->name)) {
             $postView->attachment->name = $post->name;
         }
         if (!empty($post->caption)) {
             $postView->attachment->caption = $post->caption;
         }
         if (!empty($post->icon)) {
             $postView->icon = $post->icon;
         }
         if (!empty($post->description)) {
             $postView->attachment->description = $post->description;
         }
     }
     if (!empty($post->place)) {
         $postView->place = array('name' => $post->place->name, 'link' => Horde::externalUrl($facebook->getFacebookUrl() . '/' . $post->place->id, true), 'location' => $post->place->location);
     }
     if (!empty($post->with_tags)) {
         $postView->with = array();
         foreach ($post->with_tags->data as $with) {
             $postView->with[] = array('name' => $with->name, 'link' => Horde::externalUrl($facebook->users->getProfileLink($with->id), true));
         }
     }
     // Actions
     $like = '';
     foreach ($post->actions as $availableAction) {
         if ($availableAction->name == 'Like') {
             $like = '<a href="#" onclick="Horde[\'' . $instance . '_facebook\'].addLike(\'' . $post->id . '\');return false;">' . _("Like") . '</a>';
         }
     }
     $likes = '';
     if ($post->likes->count) {
         foreach ($post->likes->data as $likeData) {
             if ($likeData->id == $uid && $post->likes->count > 1) {
                 $likes = sprintf(ngettext("You and %d other person likes this", "You and %d other people like this", $post->likes->count - 1), $post->likes->count - 1);
                 break;
             } elseif ($likeData->id == $uid) {
                 $likes = _("You like this");
                 break;
             }
         }
         if (empty($likes)) {
             $likes = sprintf(ngettext("%d person likes this", "%d persons like this", $post->likes->count), $post->likes->count) . (!empty($like) ? ' ' . $like : '');
         } else {
             $likes = $likes . !empty($like) ? ' ' . $like : '';
         }
     } else {
         $likes = $like;
     }
     $postView->likesInfo = $likes;
     return $postView->render('facebook_story');
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:80,代码来源:FacebookHandler.php

示例9: run

    /**
     * Expects
     *   $registry
     *   $notification
     *   $browser
     *   $story_id
     *   $channel_id
     *
     */
    public function run()
    {
        extract($this->_params, EXTR_REFS);
        global $page_output;
        $page_output->addScriptFile('syntaxhighlighter/scripts/shCore.js', 'horde');
        $page_output->addScriptFile('syntaxhighlighter/scripts/shAutoloader.js', 'horde');
        $path = $GLOBALS['registry']->get('jsuri', 'horde') . '/syntaxhighlighter/scripts/';
        $brushes = <<<EOT
          SyntaxHighlighter.autoloader(
          'applescript            {$path}shBrushAppleScript.js',
          'actionscript3 as3      {$path}shBrushAS3.js',
          'bash shell             {$path}shBrushBash.js',
          'coldfusion cf          {$path}shBrushColdFusion.js',
          'cpp c                  {$path}shBrushCpp.js',
          'c# c-sharp csharp      {$path}shBrushCSharp.js',
          'css                    {$path}shBrushCss.js',
          'delphi pascal          {$path}shBrushDelphi.js',
          'diff patch pas         {$path}shBrushDiff.js',
          'erl erlang             {$path}shBrushErlang.js',
          'groovy                 {$path}shBrushGroovy.js',
          'java                   {$path}shBrushJava.js',
          'jfx javafx             {$path}shBrushJavaFX.js',
          'js jscript javascript  {$path}shBrushJScript.js',
          'perl pl                {$path}shBrushPerl.js',
          'php                    {$path}shBrushPhp.js',
          'text plain             {$path}shBrushPlain.js',
          'py python              {$path}shBrushPython.js',
          'ruby rails ror rb      {$path}shBrushRuby.js',
          'sass scss              {$path}shBrushSass.js',
          'scala                  {$path}shBrushScala.js',
          'sql                    {$path}shBrushSql.js',
          'vb vbnet               {$path}shBrushVb.js',
          'xml xhtml xslt html    {$path}shBrushXml.js'
        );
EOT;
        $page_output->addInlineScript(array($brushes, 'SyntaxHighlighter.defaults[\'toolbar\'] = false', 'SyntaxHighlighter.all()'), true);
        $sh_js_fs = $GLOBALS['registry']->get('jsfs', 'horde') . '/syntaxhighlighter/styles/';
        $sh_js_uri = Horde::url($GLOBALS['registry']->get('jsuri', 'horde'), false, -1) . '/syntaxhighlighter/styles/';
        $page_output->addStylesheet($sh_js_fs . 'shCoreEclipse.css', $sh_js_uri . 'shCoreEclipse.css');
        $page_output->addStylesheet($sh_js_fs . 'shThemeEclipse.css', $sh_js_uri . 'shThemeEclipse.css');
        $driver = $GLOBALS['injector']->getInstance('Jonah_Driver');
        try {
            $story = $driver->getStory($channel_id, $story_id, !$browser->isRobot());
        } catch (Exception $e) {
            $notification->push(sprintf(_("Error fetching story: %s"), $e->getMessage()), 'horde.warning');
            $page_output->header();
            $notification->notify(array('listeners' => 'status'));
            $page_output->footer();
            exit;
        }
        /* Grab tag related content for entire channel */
        $cloud = new Horde_Core_Ui_TagCloud();
        $allTags = $driver->listTagInfo(array(), $channel_id);
        foreach ($allTags as $tag_id => $taginfo) {
            $cloud->addElement($taginfo['tag_name'], Horde::url('stories/results.php')->add(array('tag_id' => $tag_id, 'channel_id' => $channel_id)), $taginfo['total']);
        }
        /* Prepare the story's tags for display */
        // FIXME - need to actually use these.
        $tag_html = array();
        $tag_link = Horde::url('stories/results.php')->add('channel_id', $channel_id);
        foreach ($story['tags'] as $id => $tag) {
            $link = $tag_link->copy()->add('tag_id', $id);
            $tag_html[] = $link->link() . $tag . '</a>';
        }
        /* Filter and prepare story content. */
        if (!empty($story['body_type']) && $story['body_type'] == 'text') {
            $story['body'] = $GLOBALS['injector']->getInstance('Horde_Core_Factory_TextFilter')->filter($story['body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
        }
        // @TODO: Where is this used and what for?
        if (!empty($story['url'])) {
            $story['body'] .= Horde::link(Horde::externalUrl($story['url'])) . htmlspecialchars($story['url']) . '</a></p>';
        }
        if (empty($story['published_date'])) {
            $story['published_date'] = false;
        }
        $view = new Horde_View(array('templatePath' => array(JONAH_TEMPLATES . '/stories', JONAH_TEMPLATES . '/stories/partial', JONAH_TEMPLATES . '/stories/layout')));
        $view->addHelper('Tag');
        $view->addHelper('Text');
        $view->tagcloud = $cloud->buildHTML();
        $view->story = $story;
        /* Insert link for sharing. */
        if ($conf['sharing']['allow']) {
            $url = Horde::url('stories/share.php')->add(array('id' => $story['id'], 'channel_id' => $channel_id));
            $view->sharelink = $url->link() . _("Share this story") . '</a>';
        }
        /* Insert comments. */
        if ($conf['comments']['allow']) {
            if (!$registry->hasMethod('forums/doComments')) {
                $err = 'User comments are enabled but the forums API is not available.';
                Horde::log($err, 'ERR');
            } else {
//.........这里部分代码省略.........
开发者ID:raz0rsdge,项目名称:horde,代码行数:101,代码来源:StoryView.php

示例10: _buildTweet

 /**
  * Helper method to build a view object for a tweet.
  *
  * @param  stdClass $tweet  The tweet object.
  *
  * @return Horde_View  The view object, populated with tweet data.
  */
 protected function _buildTweet($tweet)
 {
     global $injector, $registry;
     $view = new Horde_View(array('templatePath' => HORDE_TEMPLATES . '/block'));
     $view->addHelper('Tag');
     $view->ajax_uri = $registry->getServiceLink('ajax', $registry->getApp());
     $filter = $injector->getInstance('Horde_Core_Factory_TextFilter');
     $instance = $this->vars->i;
     // Links and media
     $map = $previews = array();
     foreach ($tweet->entities->urls as $link) {
         $replace = '<a target="_blank" href="' . $link->url . '" title="' . $link->expanded_url . '">' . htmlspecialchars($link->display_url) . '</a>';
         $map[$link->indices[0]] = array($link->indices[1], $replace);
     }
     if (!empty($tweet->entities->media)) {
         foreach ($tweet->entities->media as $picture) {
             $replace = '<a target="_blank" href="' . $picture->url . '" title="' . $picture->expanded_url . '">' . htmlentities($picture->display_url, ENT_COMPAT, 'UTF-8') . '</a>';
             $map[$picture->indices[0]] = array($picture->indices[1], $replace);
             $previews[] = ' <a href="#" onclick="return Horde[\'twitter' . $instance . '\'].showPreview(\'' . $picture->media_url . ':small\');"><img src="' . Horde_Themes::img('mime/image.png') . '" /></a>';
         }
     }
     if (!empty($tweet->entities->user_mentions)) {
         foreach ($tweet->entities->user_mentions as $user) {
             $replace = ' <a target="_blank" title="' . $user->name . '" href="http://twitter.com/' . $user->screen_name . '">@' . htmlentities($user->screen_name, ENT_COMPAT, 'UTF-8') . '</a>';
             $map[$user->indices[0]] = array($user->indices[1], $replace);
         }
     }
     if (!empty($tweet->entities->hashtags)) {
         foreach ($tweet->entities->hashtags as $hashtag) {
             $replace = ' <a target="_blank" href="http://twitter.com/search?q=#' . urlencode($hashtag->text) . '">#' . htmlentities($hashtag->text, ENT_COMPAT, 'UTF-8') . '</a>';
             $map[$hashtag->indices[0]] = array($hashtag->indices[1], $replace);
         }
     }
     $body = '';
     $pos = 0;
     while ($pos <= Horde_String::length($tweet->text) - 1) {
         if (!empty($map[$pos])) {
             $entity = $map[$pos];
             $body .= $entity[1];
             $pos = $entity[0];
         } else {
             $body .= Horde_String::substr($tweet->text, $pos, 1);
             ++$pos;
         }
     }
     foreach ($previews as $preview) {
         $body .= $preview;
     }
     $view->body = $body;
     /* If this is a retweet, use the original author's profile info */
     if (!empty($tweet->retweeted_status)) {
         $tweetObj = $tweet->retweeted_status;
     } else {
         $tweetObj = $tweet;
     }
     /* These are all referencing the *original* tweet */
     $view->profileLink = Horde::externalUrl('http://twitter.com/' . htmlspecialchars($tweetObj->user->screen_name), true);
     $view->profileImg = $GLOBALS['browser']->usingSSLConnection() ? $tweetObj->user->profile_image_url_https : $tweetObj->user->profile_image_url;
     $view->authorName = '@' . htmlspecialchars($tweetObj->user->screen_name);
     $view->authorFullname = htmlspecialchars($tweetObj->user->name);
     $view->createdAt = $tweetObj->created_at;
     $view->clientText = $filter->filter($tweet->source, 'xss');
     $view->tweet = $tweet;
     $view->instanceid = $instance;
     return $view;
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:73,代码来源:TwitterHandler.php

示例11: _renderVarDisplay_address


//.........这里部分代码省略.........
                 /* Multimap.co.uk generated map */
                 $mapurl = 'http://www.multimap.com/map/browse.cgi?pc=' . urlencode($info['zip']);
                 $desc = Horde_Core_Translation::t("Multimap UK map");
                 $icon = 'map.png';
                 break;
             case 'au':
                 /* Whereis.com.au generated map */
                 $mapurl = 'http://www.whereis.com.au/whereis/mapping/geocodeAddress.do?';
                 $desc = Horde_Core_Translation::t("Whereis Australia map");
                 $icon = 'map.png';
                 /* See if it's the street number & name. */
                 if (isset($info['streetNumber']) && isset($info['streetName'])) {
                     $mapurl .= '&streetNumber=' . urlencode($info['streetNumber']) . '&streetName=' . urlencode($info['streetName']);
                 }
                 /* Look for "Suburb, State". */
                 if (isset($info['city'])) {
                     $mapurl .= '&suburb=' . urlencode($info['city']);
                 }
                 /* Look for "State <4 digit postcode>". */
                 if (isset($info['state'])) {
                     $mapurl .= '&state=' . urlencode($info['state']);
                 }
                 break;
             case 'us':
             case 'ca':
                 /* American/Canadian address style. */
                 /* Mapquest generated map */
                 $mapurl = 'http://www.mapquest.com/maps/map.adp?size=big&zoom=7';
                 $desc = Horde_Core_Translation::t("MapQuest map");
                 $icon = 'map.png';
                 if (!empty($info['street'])) {
                     $mapurl .= '&address=' . urlencode($info['street']);
                 }
                 if (!empty($info['city'])) {
                     $mapurl .= '&city=' . urlencode($info['city']);
                 }
                 if (!empty($info['state'])) {
                     $mapurl .= '&state=' . urlencode($info['state']);
                 }
                 if (!empty($info['zip'])) {
                     if ($info['country'] == 'ca') {
                         $mapurl .= '&country=CA';
                     }
                     $mapurl .= '&zipcode=' . urlencode($info['zip']);
                 }
                 /* Yahoo! generated map. */
                 $mapurl2 = 'http://us.rd.yahoo.com/maps/home/submit_a/*-http://maps.yahoo.com/maps?srchtype=a&getmap=Get+Map&';
                 $desc2 = Horde_Core_Translation::t("Yahoo! map");
                 $icon2 = 'map.png';
                 if (!empty($info['street'])) {
                     $mapurl2 .= '&addr=' . urlencode($info['street']);
                 }
                 /* Give precedence to zipcode over city/state */
                 if (empty($info['zip']) && !empty($info['city']) && !empty($info['state'])) {
                     $mapurl2 .= '&csz=' . urlencode($info['city'] . ' ' . $info['state']);
                 }
                 if (!empty($info['zip'])) {
                     if (preg_match('|([a-zA-Z]\\d[a-zA-Z])\\s?(\\d[a-zA-Z]\\d)|', $info['zip'], $pcParts)) {
                         $mapurl2 .= '&country=ca';
                         /* make sure the postal-code has a space */
                         $info['zip'] = $pcParts[1] . ' ' . $pcParts[2];
                     }
                     $mapurl2 .= '&csz=' . urlencode($info['zip']);
                 }
                 break;
             default:
                 if (!count($info)) {
                     break;
                 }
                 /* European address style. */
                 $google_icon = 'map_eu.png';
                 /* Mapquest generated map. */
                 $mapurl2 = 'http://www.mapquest.com/maps/map.adp?country=' . Horde_String::upper($info['country']);
                 $desc2 = Horde_Core_Translation::t("MapQuest map");
                 $icon2 = 'map_eu.png';
                 if (!empty($info['street'])) {
                     $mapurl2 .= '&address=' . urlencode($info['street']);
                 }
                 if (!empty($info['zip'])) {
                     $mapurl2 .= '&zipcode=' . urlencode($info['zip']);
                 }
                 if (!empty($info['city'])) {
                     $mapurl2 .= '&city=' . urlencode($info['city']);
                 }
                 break;
         }
     }
     $html = $text ? nl2br(htmlspecialchars($address)) : '';
     if (!empty($mapurl)) {
         $html .= '&nbsp;&nbsp;' . Horde::link(Horde::externalUrl($mapurl), $desc, null, '_blank') . Horde::img($icon, $desc) . '</a>';
     }
     if (!empty($mapurl2)) {
         $html .= '&nbsp;' . Horde::link(Horde::externalUrl($mapurl2), $desc2, null, '_blank') . Horde::img($icon2, $desc2) . '</a>';
     }
     /* Google generated map. */
     if ($address) {
         $html .= '&nbsp;' . Horde::link(Horde::externalUrl('http://maps.google.com/maps?q=' . urlencode(preg_replace('/\\r?\\n/', ',', $address)) . '&hl=en'), Horde_Core_Translation::t("Google Maps"), null, '_blank') . Horde::img($google_icon, Horde_Core_Translation::t("Google Maps")) . '</a>';
     }
     return $html;
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:101,代码来源:daterendererchanges.php

示例12: _title

 /**
  */
 protected function _title()
 {
     $title = !empty($this->_params['title']) ? $this->_params['title'] : $this->_params['iframe'];
     $url = new Horde_Url(Horde::externalUrl($this->_params['iframe']));
     return htmlspecialchars($title) . $url->link(array('target' => '_blank')) . Horde_Themes_Image::tag('external.png', array('attr' => array('style' => 'vertical-align:middle;padding-left:.3em'))) . '</a>';
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:8,代码来源:Iframe.php

示例13: sprintf

</em></a></div>
  <div class="hordeSmStreambody">
    <?php 
echo $this->body;
?>
    <div class="hordeSmStreaminfo">
      <?php 
echo sprintf(_("Posted %s via %s"), Horde_Date_Utils::relativeDateTime(strtotime($this->createdAt), $GLOBALS['prefs']->getValue('date_format')), $this->clientText);
?>
    </div>
    <?php 
if (!empty($this->tweet->retweeted_status)) {
    ?>
    <div class="hordeSmStreaminfo">
      <?php 
    echo sprintf(_("Retweeted by %s"), Horde::externalUrl('http://twitter.com/' . $this->escape($this->tweet->user->screen_name), true)) . '@' . $this->escape($this->tweet->user->screen_name);
    ?>
</a>
    </div>
    <?php 
}
?>
    <div class="hordeSmStreaminfo">
      <?php 
echo Horde::selfUrl()->link(array('onclick' => 'Horde[\'twitter' . $this->instanceid . '\'].buildReply(\'' . (string) $this->tweet->id_str . '\', \'' . $this->tweet->user->screen_name . '\', \'' . $this->tweet->user->name . '\'); return false;')) . _("Reply");
?>
</a>
      &nbsp;|&nbsp; <?php 
echo Horde::selfUrl()->link(array('onclick' => 'Horde[\'twitter' . $this->instanceid . '\'].retweet(\'' . (string) $this->tweet->id_str . '\'); return false;')) . _("Retweet");
?>
</a>
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:31,代码来源:twitter_tweet.html.php

示例14: elseif

// Do we have a good auth token? Keep in mind this is example code, and in a true
// callback page we probably wouldn't be doing anything if we already have a token,
// but for testing purposes....
if (!empty($auth_token)) {
    /* Have a token, tell the Twitter client about it */
    $twitter->auth->setToken($auth_token);
    // Do something cool....
    // $twitter->statuses->update('Testing Horde/Twitter integration');
} elseif (!empty($_SESSION['twitter_request_secret'])) {
    /* No existing auth token, maybe we are in the process of getting it? */
    $a_token = $twitter->auth->getAccessToken(new Horde_Controller_Request_Http(), $_SESSION['twitter_request_secret']);
    // Clear the request secret from the session now that we're done with it,
    // again, using _SESSION for simplicity for this example
    $_SESSION['twitter_request_secret'] = '';
    if ($a_token === false || empty($a_token)) {
        // We had a request secret, but something went wrong. maybe navigated
        // back here between requests?
        echo 'error';
        die;
    } else {
        // We have a good token, save it to DB etc....
        var_dump($a_token);
        die;
    }
}
// No auth token, not in the process of getting one...ask user to verify
$results = $twitter->auth->getRequestToken();
$_SESSION['twitter_request_secret'] = $results->secret;
// Redirect to auth url
Horde::externalUrl($twitter->auth->getUserAuthorizationUrl($results), false)->redirect();
开发者ID:jubinpatel,项目名称:horde,代码行数:30,代码来源:twitter_browser.php

示例15: header

<?php

/**
 * Records clicks and clean the URL with Horde::externalUrl().
 *
 * Copyright 2005-2016 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file LICENSE for license information (BSD). If you
 * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
 *
 * @author Ben Chavet <ben@horde.org>
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('trean');
$bookmark_id = Horde_Util::getFormData('b');
if (!$bookmark_id) {
    exit;
}
try {
    $bookmark = $trean_gateway->getBookmark($bookmark_id);
    ++$bookmark->clicks;
    $bookmark->save();
    header('Location: ' . Horde::externalUrl($bookmark->url));
} catch (Exception $e) {
}
开发者ID:horde,项目名称:horde,代码行数:25,代码来源:redirect.php


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