/**
  * _buildPageLink - private
  *
  * @param  PHPWikiPage $wikiPage
  * @param  string   $title
  * @return string   $href
  */
 function _buildPageLink(&$wikiPage, $title = null)
 {
     $href = '';
     // Check permission
     if ($wikiPage->isAutorized(user_getid())) {
         $pagename = $wikiPage->getPagename();
         // Build page link
         if (empty($title)) {
             $title = $pagename;
         }
         $title = $this->purifier->purify($title, CODENDI_PURIFIER_CONVERT_HTML);
         $link = PHPWIKI_PLUGIN_BASE_URL . '/index.php?group_id=' . $this->gid . '&pagename=' . urlencode($pagename);
         // Display title as emphasis if corresponding page does't exist.
         if ($wikiPage->isEmpty()) {
             $title = '<em>' . $title . '</em>';
             $link .= '&action=edit';
         }
         // Build Lock image if a permission is set on the corresponding page
         if ($wikiPage->permissionExist()) {
             $permLink = $this->wikiLink . '&view=pagePerms&id=' . $wikiPage->getId();
             $title = $title . '<img src="' . util_get_image_theme("ic/lock.png") . '" border="0" alt="Lock" />';
         }
         $href = '<a href="' . $link . '">' . $title . '</a>';
     }
     return $href;
 }