示例#1
0
 function addSorted(&$root, $sortMode)
 {
     $this->sortLinks($sortMode);
     $sub = new SB_Tree_Node(array('name' => SB_T($this->tree->sortModeLabel[$sortMode]), 'nid' => $sortMode, 'nid_parent' => $this->switches['root'] ? $this->switches['root'] : ''));
     foreach ($this->root->getLinksSlice(10) as $link) {
         $sub->addLink($link);
     }
     $root->addNode($sub);
 }
示例#2
0
    function designedBy()
    {
        echo SB_T('Skin created by');
        ?>
 <a href="http://www.jasonsawtelle.com/" <?php 
        echo SB_Page::target();
        ?>
>Jason Sawtelle</a><?php 
    }
示例#3
0
    function designedBy()
    {
        echo SB_T("Skin designed by");
        ?>
 <a href='http://www.gunnarwrobel.de/' <?php 
        echo SB_Page::target();
        ?>
>Gunnar Wrobel</a><?php 
    }
示例#4
0
    function designedBy()
    {
        echo SB_T("Skin designed by");
        ?>
 <a href='http://brablc.com/' <?php 
        echo SB_Page::target();
        ?>
>Ondrej Brablc</a><?php 
    }
示例#5
0
    function designedBy()
    {
        echo SB_T("Skin designed by");
        ?>
 <a href='http://www.alexisisaac.net/' <?php 
        echo SB_Page::target();
        ?>
>Alexis Isaac</a><?php 
    }
示例#6
0
    function designedBy()
    {
        echo SB_T('Skin created by');
        ?>
 <a href="http://brablc.com/" <?php 
        echo SB_Page::target();
        ?>
>Ondrej Brablc</a><?php 
    }
示例#7
0
    function designedBy()
    {
        echo SB_T("Skin designed by");
        ?>
 <a href='http://www.mindslip.com/' <?php 
        echo SB_Page::target();
        ?>
>David Szego</a><?php 
    }
示例#8
0
    function designedBy()
    {
        echo SB_T('Skin created by');
        ?>
 <a href="http://igor.kraljic.info" <?php 
        echo SB_Page::target();
        ?>
>Igor</a><?php 
    }
示例#9
0
 function _buildExpirationList()
 {
     $expiration = array('Until I close browser' => 0, '12 hours' => 60 * 60 * 12, '6 days' => 60 * 60 * 24 * 6, '1 month' => 60 * 60 * 24 * 30, 'Maximum session time' => $this->um->getParam('config', 'max_session_time'));
     foreach ($expiration as $label => $value) {
         if ($value > $this->um->getParam('config', 'max_session_time')) {
             break;
         }
         echo '<option value="' . $value . '">' . SB_T($label) . "</option>\n";
     }
 }
示例#10
0
 function writeMenuItem($id, &$itemArray)
 {
     static $expertMode = null;
     if ($expertMode === null) {
         $expertMode = $this->um->getParam('user', 'expert_mode');
     }
     $command = SB_safeVal($itemArray, 'name');
     $link = SB_safeVal($itemArray, 'href');
     $callback = SB_safeVal($itemArray, 'callback');
     $acl = SB_safeVal($itemArray, 'acl');
     $optional = SB_safeVal($itemArray, 'optional', false);
     $more = SB_safeVal($itemArray, 'more', false);
     $class = 'item';
     if (!$command) {
         $class .= ' separator';
     } else {
         if ($optional && !$expertMode) {
             $class .= ' optional';
         }
     }
     $div = "\t" . '<div id="' . $id . '" class="' . $class . '"';
     if ($command) {
         $div .= ' onmouseover="SB_itemOn(this);"' . ' onmouseout="SB_itemOff(this);"';
     }
     if ($command && !$link) {
         $div .= ' x_acl="' . $acl . '"' . ' x_cmd="' . $command . '"';
     }
     echo $div . '>';
     if ($link) {
         static $target;
         if ($target == null) {
             $target = SB_Page::target();
         }
         if (strstr($link, 'http') !== 0) {
             $link = SB_Page::absBaseUrl() . $link;
         }
         echo '<a class="menuLink" href="' . $link . '"' . $target . '>';
     } else {
         echo '<a href="javascript:SB_itemDoAlt(\'' . $id . '\'' . ($callback ? ',\'' . $callback . '\'' : '') . ')">';
     }
     echo SB_T($command);
     if ($command == 'Log Out') {
         echo ' (' . $this->um->username . ')';
     }
     if ($link) {
         echo '</a>';
     }
     echo "</div>\r";
 }
示例#11
0
 function drawNodeOpen(&$node)
 {
     $filler = str_repeat("\t", $node->level);
     $added = $node->added ? strtotime($node->added) : mktime();
     $feedname = $node->name;
     // If we have subfolders
     if ($node->nodeCount()) {
         echo $filler . '<DT><H3 ADD_DATE="' . $added . '">' . $node->name . "</H3>\r";
         if ($node->comment) {
             echo $filler . '<DD>' . $node->comment . "\r";
         }
         echo $filler . "<DL><p>\r";
         $filler = str_repeat("\t", $node->level + 1);
         $feedname = '@' . SB_T('Content');
     }
     // Do we have some content
     if ($node->linkCount()) {
         $url = SB_Page::absBaseUrl() . 'index.php?w=rss&sd=0&root=' . $node->id;
         if ($this->switches['hits']) {
             $url .= '&hits=1';
         }
         echo $filler . '<DT><A HREF="' . SB_Page::absBaseUrl() . 'index.php"' . ' ADD_DATE="' . $added . '"' . ' FEEDURL="' . $url . '">' . $feedname . "</A>\r";
     }
 }
示例#12
0
    function _buildFeedBuildList($params)
    {
        ?>
        <div class="label"><?php 
        echo SB_T($params['title']);
        ?>
</div>
        <div class="data">
            <select name="<?php 
        echo SB_T($params['name']);
        ?>
">
    <?php 
        foreach ($params['values'] as $name => $label) {
            switch ($name) {
                case 'b_msie':
                    $name = 'netscape';
                    break;
                case 'b_opera':
                    $name = 'opera';
                    break;
                case 'b_mozilla':
                    $name = 'netscape';
                    break;
                case 'separator':
                    $name = 'auto';
                    break;
            }
            echo '<option value="' . $name . '"' . ($label[1] ? ' selected' : '') . '>' . SB_T($label[0]) . "</option>\n";
        }
        ?>
            </select>
        </div>
    <?php 
    }
示例#13
0
    </head>

    <body class="siteBar siteBarBaseFont siteBarPageBackground">
      <div class="title cmnTitleColorInverse">
      <xsl:value-of select="xbel/title" />
      </div>
      <xsl:for-each select="xbel/*">
        <xsl:choose>
          <xsl:when test="local-name(.)='folder'">
            <xsl:call-template name="displayFolder" />
          </xsl:when>
        </xsl:choose>
      </xsl:for-each>
      <div class="footer cmnTitleColorInverse">
      <xsl:text><?php 
echo SB_T('Bookmarks from SiteBar installation at');
?>
 </xsl:text>
      <xsl:element name="a">
        <xsl:attribute name="class">
          <xsl:value-of select="'url'" />
        </xsl:attribute>
        <xsl:attribute name="href">
          <xsl:value-of select="'<?php 
echo $baseurl . 'index.php';
?>
'" />
        </xsl:attribute>
        <xsl:text><?php 
echo $baseurl;
?>
示例#14
0
    function writeForm()
    {
        $customButton = false;
        if ($this->useToolTips) {
            ?>
<div id='toolTip'></div>
<?php 
        }
        ?>
<form method="POST" enctype="multipart/form-data" action="<?php 
        echo FORM_ACTION_EXECUTOR;
        ?>
">
    <input type="hidden" name="command" value="<?php 
        echo $this->command;
        ?>
">
    <input type="hidden" name="button" value="">
    <input type="hidden" name="referer" value="<?php 
        echo $this->getReferer();
        ?>
">
<?php 
        foreach ($this->persistentParams as $param) {
            $value = SB_safeVal($_REQUEST, $param);
            if ($value) {
                ?>
        <input type="hidden" name="<?php 
                echo $param;
                ?>
" value="<?php 
                echo $value;
                ?>
">
<?php 
            }
        }
        $enabled = false;
        // Add missing propeties
        $hasOptional = $this->enrichFields() && !$this->um->getParam('user', 'expert_mode');
        $this->writeFields($optional = false, $customButton, $enabled);
        if ($hasOptional) {
            ?>
<div id="showMore" onclick='SB_toggleMore(true);'><?php 
            echo SB_T('Show Advanced Controls');
            ?>
</div>
<div id="showLess" onclick='SB_toggleMore(false);'><?php 
            echo SB_T('Hide Advanced Controls');
            ?>
</div>
<div id="optionalFields">
<?php 
        }
        $this->writeFields($optional = true, $customButton, $enabled);
        if ($hasOptional) {
            ?>
</div>
<?php 
        }
        if (!$customButton) {
            ?>
    <div class="buttons">
        <input class="button" type="submit" name="do" value="<?php 
            echo SB_T('Submit');
            ?>
">
<?php 
            if ($enabled) {
                ?>
        <input class="button" type="reset" value="<?php 
                echo SB_T('Reset');
                ?>
">
<?php 
            }
            ?>
    </div>
<?php 
        }
        ?>
</form>
<?php 
    }
示例#15
0
    static function head($title, $bodyClass = null, $inscript = null, $onLoad = null, $meta = null)
    {
        // Media="All" is used to hide the styles from Netscape 4.x
        header('Content-Type: ' . CONTENT_TYPE);
        ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/REC-html401/loose.dtd">

<html>
<head>
    <title>:: <?php 
        echo SB_Page::title();
        ?>
 :: <?php 
        echo SB_T($title);
        ?>
</title>
    <meta http-equiv="Content-Type" content="<?php 
        echo CONTENT_TYPE;
        ?>
">
    <meta name="keywords" content="bookmark manager, online bookmark manager, online bookmarks, favorites manager, online favorites, bookmark organizer, firefox bookmark manager, bookmark server">
    <meta name="description" content="Open Source Freeware Bookmark Server for Personal and Team Use.">
<?php 
        echo $meta;
        ?>
    <link rel="shortcut Icon" href="<?php 
        echo SB_Skin::webPath();
        ?>
/root_transparent.png">
    <link rel="author" href="http://brablc.com/">
    <link rel="bookmark" href="http://sitebar.org/" title="online bookmark manager">
    <link rel="help" href="http://sitebar.org/userguide.php">
<?php 
        /*      // This can only be enabled when caching is implemented FF fetches the links when page is visitied.
        
                $sortModes = array
                (
                    'added'   => 'Recently Added',
                    'changed' => 'Recently Modified',
                    'visited' => 'Recently Visited',
                    'hits'    => 'Most Popular',
                    'waiting' => 'Waiting for Visit',
                );
        
                foreach( $sortModes as $mode => $sortLabel)
                {
        ?>
            <link rel="alternate" type="application/rss+xml"
                  title="SiteBar Bookmarks [<?php echo $sortLabel?>]"
                  href="<?php echo SB_Page::absBaseUrl()?>index.php?w=rss&amp;sort=<?php echo $mode?>&amp;max=20">
        <?php
                }
        */
        SB_Page::headerContent($inscript);
        ?>
</head>
<body class="siteBar siteBarBaseFont siteBarPageBackground <?php 
        echo $bodyClass;
        ?>
" <?php 
        echo $onLoad ? ' onLoad="' . $onLoad . '"' : '';
        ?>
 onmouseup="SB_cancelDragging();">
<?php 
    }
示例#16
0
 function drawNodeClose(&$node)
 {
     echo "</div>\r";
     echo "</div>\r";
     if ($node->isRoot) {
         if ($node->myTree == SB_TREE_OWN && !$this->um->isAnonymous() && !$this->um->getParam('user', 'has_link')) {
             // Hide for other roots
             $this->um->setParam('user', 'has_link', 1);
             // Make copy
             $nodeCopy = $node;
             $this->tree->loadNodes($nodeCopy, true);
             //
             if ($nodeCopy->childrenCount() == 0) {
                 echo "<div class='tutorial'>\r";
                 echo SB_P('sitebar::tutorial', array(SB_T('Add Bookmark'))) . "\r";
                 echo "</div>\r";
             } else {
                 $this->um->saveUserParams();
             }
         }
         echo "</div>\r";
     } else {
         array_pop($this->treearr);
     }
 }
示例#17
0
 function privateMessage($params)
 {
     $gid = isset($params['gid']) && $params['gid'] ? $params['gid'] : null;
     $isModerator = $gid && $this->isModerator($gid);
     $isAdmin = $this->isAdmin();
     $role = ($isModerator || $isAdmin) && isset($params['from_role']) ? $params['from_role'] : 'user';
     $db =& SB_Database::staticInstance();
     $insert = array('uid' => $this->uid, 'gid' => $gid, 'sent' => array('now' => null), 'role' => $role, 'format' => $isAdmin && $params['format'] ? $params['format'] : 'plain', 'to_label' => $params['to_label'], 'subject' => $params['subject'], 'message' => $params['message']);
     $db->insert('sitebar_message', $insert);
     $mid = $db->getLastId();
     if ($isAdmin && $params['expires']) {
         $insert['expires'] = $params['expires'];
     }
     $counter = 0;
     $safe_mode = in_array(strtolower(ini_get('safe_mode')), array("1", "on", "yes", "true"));
     if (!$safe_mode) {
         // We need more time if our database is slow
         set_time_limit(intval(count($params['to_list']) / 20) + 10);
     }
     $insert = array('mid' => $mid);
     // Insert recipients
     foreach ($params['to_list'] as $uid => $user) {
         if ($uid == SB_ANONYM) {
             continue;
         }
         $userparams = $user['params'];
         $this->explodeParams($userparams, 'tmp');
         if (($isModerator || $isAdmin) && isset($params['respect']) && !$this->getParam('tmp', 'allow_info_mails')) {
             continue;
         }
         SB_SetLanguage($this->getParam('tmp', 'lang'));
         $counter++;
         $insert['uid'] = $uid;
         $db->insert('sitebar_message_folder', $insert);
         if ($params['pm_notification'] && $user['verified'] && $this->getParam('config', 'use_mail_features') && $this->getParam('tmp', 'pm_notification')) {
             $subject = SB_T('SiteBar: Private Message Notification');
             $msg = SB_P('command::pm_notification', array($params['subject'], SB_Page::absBaseUrl()));
             $this->sendMail(array('email' => $user['email']), $subject, $msg);
         }
     }
     SB_SetLanguage($this->getParam('user', 'lang'));
     $insert['folder'] = 'outbox';
     // Insert senders
     if (($isModerator || $isAdmin) && $role != 'user') {
         $gid = $role == 'admins' ? SB_ADMIN_GROUP : $gid;
         foreach ($this->getMembers($gid) as $uid => $user) {
             $userparams = $user['params'];
             $this->explodeParams($userparams, 'tmp');
             SB_SetLanguage($this->getParam('tmp', 'lang'));
             $counter++;
             $insert['uid'] = $uid;
             $db->insert('sitebar_message_folder', $insert);
         }
     } else {
         $insert['uid'] = $this->uid;
         $db->insert('sitebar_message_folder', $insert);
     }
     SB_SetLanguage($this->getParam('user', 'lang'));
 }
示例#18
0
 /**
  * Write errors as UL
  */
 function writeErrors($fulldetails = true)
 {
     if (SB_ErrorHandler::hasHandledErrors()) {
         $fulldetails = true;
     }
     foreach (SB_ErrorHandler::getErrors() as $err) {
         $el = "";
         switch ($err[0]) {
             case E_ERROR:
                 $el = SB_T('Error');
                 break;
             case E_WARNING:
                 $el = SB_T('Warning');
                 break;
             default:
                 $el = SB_T('Unknown');
         }
         echo "<p>";
         if ($fulldetails) {
             echo $el . ": ";
         }
         echo $err[1];
     }
 }
示例#19
0
function SearchEngine()
{
    $um = SB_UserManager::staticInstance();
    $name = $um->getParamB64('config', 'feed_root_name');
    if (!strlen($name)) {
        $name = 'SiteBar';
    }
    ?>
# SiteBar plug-in

<search
   name="<?php 
    echo $name;
    ?>
"
   description="<?php 
    echo SB_T('Search in SiteBar Bookmarks');
    ?>
"
   method="GET"
   action="<?php 
    echo SB_Page::absBaseUrl();
    ?>
search.php"
   searchForm="<?php 
    echo SB_Page::absBaseUrl();
    ?>
index.php"
>

<input name="q" user>
<input name="sourceid" value="sitebar-search">

</search>
<?php 
    exit;
}
示例#20
0
  <xsl:call-template name="displayDate">
    <xsl:with-param name="label" select="' tested'" />
    <xsl:with-param name="value" select="./@tested" />
  </xsl:call-template>
<?php 
if (!$um->isAnonymous()) {
    ?>
  [<xsl:element name="a">
    <xsl:attribute name="href">
      <xsl:value-of select="concat('<?php 
    echo $baseurl;
    ?>
command.php?command=Properties&amp;lid_acl=',substring(@id,2))" />
    </xsl:attribute>
    <xsl:value-of select="'<?php 
    echo SB_T('Properties');
    ?>
'" />
  </xsl:element>]
<?php 
}
?>
    </div>
  </div>
</xsl:template>

<xsl:template name="displayDate">
  <xsl:param name="label" />
  <xsl:param name="value" />
  <xsl:if test="string-length($value) != 0 and substring-before($value,'T') != '1999-11-30'">
    <xsl:value-of select="concat($label,' ')" />
 function buildSendMessagetoModerators()
 {
     $fields = array();
     $group = $this->um->getGroup(SB_reqVal('command_gid', true));
     $this->_buildMessengerCommon($fields, SB_T('Moderators of %s Group', $group['name']));
     return $fields;
 }
示例#22
0
 function getTitle()
 {
     $sortLabel = '';
     if ($this->tree->sortMode) {
         $sortLabel = ' - ' . SB_T($this->tree->sortModeLabel[$this->tree->sortMode]);
     }
     return vsprintf($this->settingsValue('feed_folder_title'), array($this->getShortTitle(), $sortLabel));
 }
 function buildProperties()
 {
     $fields = array();
     $link = null;
     if ($this->command != 'Add Bookmark') {
         $link = $this->tree->getLink(SB_reqValInt('lid_acl'));
         if (!$link) {
             return null;
         }
     } else {
         $link = new SB_Tree_Link(array());
     }
     $fields['-hidden1-'] = array('name' => 'lid_acl', 'value' => $link->id);
     $fields['URL'] = array('name' => 'url');
     if ($this->command != 'Delete Bookmark') {
         /* Show the 'Retrieve Info' button only in case it has not been yet
          * performed
          */
         $fields['Get Bookmark Information'] = array('type' => 'addbutton');
         $fields['-hidden4-'] = array('name' => 'origin', 'value' => $this->command);
     }
     $fields['Bookmark Name'] = array('name' => 'name', 'maxlength' => 255);
     $size = strlen($link->comment);
     $MAXSIZETOEDIT = 4096;
     if ($size <= $MAXSIZETOEDIT) {
         $fields['Description'] = array('name' => 'comment', 'type' => 'textarea');
     } else {
         $fields['-raw1-'] = SB_T("Description too long for inplace editing, please use export feature!");
     }
     if ($this->um->getParam('user', 'use_favicons')) {
         $fields['Favicon'] = array('name' => 'favicon', 'maxsize' => 32000);
         $fields['-raw2-'] = '';
     }
     if (strlen(SB_reqVal('url'))) {
         $link->url = SB_reqVal('url');
     }
     if ($this->getInfo && strlen(SB_reqVal('url'))) {
         $link->name = SB_reqVal('name');
         $link->comment = SB_reqVal('comment');
         $link->favicon = SB_reqVal('favicon');
         /* Try to get the title and favicon */
         require_once './inc/pageparser.inc.php';
         $page = new SB_PageParser($link->url);
         if ($page->getInformation(array('CHARSET', 'TITLE', 'FAVURL', 'DESC', 'KEYWORDS'))) {
             $cp = 'iso-8859-1';
             if ($page->errorCode['CHARSET'] < PP_ERR) {
                 $cp = $page->info['CHARSET'];
             }
             require_once './inc/converter.inc.php';
             $c = new SB_Converter($this->um->getParam('config', 'use_conv_engine'), $cp);
             if (!$link->name && isset($page->info['TITLE'])) {
                 $link->name = $c->utf8RawUrlDecode($page->info['TITLE']);
             }
             if (!$link->comment && isset($page->info['DESC'])) {
                 $link->comment = $c->utf8RawUrlDecode($page->info['DESC']);
             }
             if ($this->um->getParam('user', 'use_favicons')) {
                 if (!$link->favicon && isset($page->info['FAVURL'])) {
                     $link->favicon = $page->info['FAVURL'];
                     /* Show the retrieved favicon. */
                     if ($this->command == 'Add Bookmark') {
                         /* Show the retrieved favicon. */
                         $wrong = SB_Skin::imgsrc('link_wrong_favicon');
                         $fields['-raw2-'] = "<div><img class='favicon' alt='' src='" . $link->favicon . "' onerror='this.src=\"{$wrong}\"'></div>";
                     } else {
                         $fields['-raw2-'] = $this->_buildFavicon(SB_reqValInt('lid_acl'), $link->favicon);
                     }
                 }
             }
         }
     }
     $fields['URL']['value'] = $link->url;
     $fields['Bookmark Name']['value'] = $link->name;
     $fields['Description']['value'] = $link->comment;
     if ($this->um->getParam('user', 'use_favicons')) {
         if ($this->command != 'Add Bookmark') {
             $favicon = $link->favicon;
             if (substr($link->favicon, 0, 7) == 'binary:') {
                 require_once './inc/faviconcache.inc.php';
                 $fc =& SB_FaviconCache::staticInstance();
                 $favicon = 'data:image/x-icon;base64,' . base64_encode($fc->faviconGet($link->favicon, null));
             }
             if ($link->favicon) {
                 $fields['-raw2-'] = $this->_buildFavicon($link->id, $link->favicon);
             }
         }
         $fields['Favicon']['value'] = $link->favicon;
     }
     $size = strlen($link->comment);
     $MAXSIZETOEDIT = 4096;
     if ($size <= $MAXSIZETOEDIT) {
         $fields['Description'] = array('name' => 'comment', 'type' => 'textarea', 'value' => $link->comment);
     } else {
         $fields['-raw1-'] = SB_T("Description too long for inplace editing, please use export feature!");
     }
     $fields['Feed Bookmark'] = array('name' => 'is_feed', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_is_feed'));
     if ($link->is_feed) {
         $fields['Feed Bookmark']['checked'] = null;
     }
     if ($this->command == 'Add Bookmark' || $this->tree->inMyTree($link->id_parent)) {
         $fields['Private'] = array('name' => 'private', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_private'));
         if ($link->private) {
             $fields['Private']['checked'] = null;
         }
     }
     if ($link->is_dead) {
         $fields['Dead Bookmark'] = array('name' => 'is_dead_check', 'type' => 'checkbox', 'checked' => null, 'title' => SB_P('command::tooltip_is_dead_check'));
         $fields['-hidden2-'] = array('name' => 'is_dead', 'type' => 'hidden', 'value' => 1);
     }
     if ($this->um->getParam('config', 'use_outbound_connection')) {
         $fields['Exclude From Validation'] = array('name' => 'novalidate', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_novalidate'));
         if (!$link->validate) {
             $fields['Exclude From Validation']['checked'] = null;
         }
     }
     $fields['Target'] = array('name' => 'link_target', 'value' => $link->target);
     if ($this->command != 'Delete Bookmark') {
         if ($this->um->getParam('config', 'comment_impex') && strlen($link->comment) > 0 || strlen($link->comment) >= $MAXSIZETOEDIT) {
             $fields['Export Description'] = array('name' => 'command', 'type' => 'addbutton');
         }
         if ($this->um->getParam('config', 'comment_impex')) {
             $fields['Import Description'] = array('name' => 'command', 'type' => 'addbutton');
         }
     }
     if ($this->command == 'Properties') {
         $fields['Delete Bookmark'] = array('type' => 'addbutton');
     }
     return $fields;
 }
示例#24
0
    function drawFoot()
    {
        $baseurl = SB_Page::absBaseUrl();
        ?>
    </form>
    <div class="footer cmnTitleColorInverse">
    <?php 
        echo SB_T("Messages from SiteBar installation at");
        ?>
    <a class="url" href="<?php 
        echo $baseurl;
        ?>
"><?php 
        echo $baseurl;
        ?>
</a>
    </div>
</body>
</html>
<?php 
    }
示例#25
0
 *  This program is distributed in the hope that it will be useful,           *
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
 *  GNU Affero General Public License for more details.                       *
 *                                                                            *
 *  You should have received a copy of the GNU Affero General Public License  *
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.     *
 ******************************************************************************/
require_once './inc/tree.inc.php';
require_once './inc/usermanager.inc.php';
$tree = SB_Tree::staticInstance();
$link = $tree->getLink($_GET['id']);
// We allow redirect only as long as the original link exists
if ($link) {
    $node = $tree->getNode($link->id_parent);
    $acl =& $node->getACL();
    $url = isset($_GET['url']) ? $_GET['url'] : '';
    // But if it has been changed, we only let authorized users to see the new value
    if ($acl && $acl['allow_select']) {
        $url = $link->getUrl();
    }
    if (strlen($url)) {
        $url = str_replace('%SEARCH%', SB_safeVal($_COOKIE, 'SB3SEARCH'), $url);
        $tree->countVisit($link);
        header('Location: ' . $url);
        exit;
    }
}
header('Content-type: text/plain; charset=utf-8');
print SB_T('Access denied!');
示例#26
0
 function buildPaste()
 {
     $fields = array();
     $sourceId = SB_reqVal('sid', true);
     $sourceIsNode = SB_reqVal('stype', true);
     $sourceObj = null;
     $targetID = SB_reqValInt('nid_acl', true);
     $targetNode = $this->tree->getNode($targetID);
     $sourceNodeId = $sourceId;
     if ($sourceIsNode) {
         $sourceObj = $this->tree->getNode($sourceId);
         if (!$this->um->isAuthorized('Copy', false, null, $sourceId)) {
             $this->um->accessDenied();
             return;
         }
         $parents = $this->tree->getParentNodes($targetID);
         if (in_array($sourceId, $parents)) {
             $this->warn('Cannot move folder to its subfolder!');
             return;
         }
     } else {
         $sourceObj = $this->tree->getLink($sourceId);
         $sourceNodeId = $sourceObj->id_parent;
         if (!$this->um->isAuthorized('Copy Bookmark', false, null, null, $sourceId)) {
             $this->um->accessDenied();
             return;
         }
         if ($sourceObj->id_parent == $targetNode->id) {
             $this->warn('Link already is in the target folder!');
             return;
         }
     }
     $canMove = $this->um->canMove($sourceNodeId, $targetNode->id, $sourceIsNode);
     if ($this->um->getParam('user', 'paste_mode') != 'ask') {
         $this->skipBuild = true;
         $this->reload = !$this->um->getParam('user', 'extern_commander');
         $this->close = $this->um->getParam('user', 'auto_close');
         $move = $canMove && $this->um->getParam('user', 'paste_mode') == 'move';
         $this->executePaste($targetNode->id, $sourceId, $sourceIsNode, $move);
         return;
     }
     $fields[$sourceIsNode ? SB_T('Source Folder Name') : SB_T('Copy Bookmark')] = array('name' => 'sidname', 'value' => $sourceObj->name, 'disabled' => null);
     $fields['Target Folder Name'] = array('name' => 'tidname', 'value' => $targetNode->name, 'disabled' => null);
     if ($sourceIsNode) {
         $fields['Content Only'] = array('name' => 'content', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_paste_content'));
     }
     $fields['Mode'] = array('type' => 'callback', 'function' => '_buildPasteMode', 'params' => array('canMove' => $canMove));
     $fields['-hidden1-'] = array('name' => 'nid_acl', 'value' => $targetNode->id);
     $fields['-hidden2-'] = array('name' => 'sid', 'value' => $sourceId);
     $fields['-hidden3-'] = array('name' => 'stype', 'value' => $sourceIsNode);
     return $fields;
 }
示例#27
0
 function getShortTitle()
 {
     return SB_T('SiteBar Search Results');
 }