diff options
Diffstat (limited to 'data/templates')
51 files changed, 3290 insertions, 0 deletions
diff --git a/data/templates/minimal/about.tpl.php b/data/templates/minimal/about.tpl.php new file mode 100644 index 0000000..40d269b --- /dev/null +++ b/data/templates/minimal/about.tpl.php @@ -0,0 +1,31 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<div class="container-full"> + <div class="row"> + + <ul> + <li><a target="_blank" href="http://sourceforge.net/projects/semanticscuttle/">Semantic Scuttle</a> <?php echo T_('is licensed under the ');?> <a target="_blank"href="http://www.gnu.org/copyleft/gpl.html"><acronym title="GNU\'s Not Unix">GNU</acronym> General Public License</a> (<?php echo T_('you can freely host it on your own web server'); ?>) + <?php echo sprintf(T_(' and supports most of the <a target="_blank" href="http://www.delicious.com/help/api">del.icio.us <abbr title="Application Programming Interface">API</abbr></a>. '), $GLOBALS['sitename']); ?></li> + <li><a target="_blank" href="https://github.com/jonrandoem/sscuttlizr/">Sscuttlizr</a> <?php echo T_('is licensed under the ');?> <a target="_blank" href="https://github.com/jonrandoem/sscuttlizr/blob/master/LICENSE">MIT License</a> + + + <?php if(!is_null($currentUser) && $currentUser->isAdmin()): ?> + <li>SemanticScuttle v0.98.5</li> + <?php endif ?> + </ul> + + <h3><?php echo T_('Tips'); ?></h3> + <ul> + <li><?php echo T_('Add search plugin into your browser:'); ?> <a href="#" onclick="window.external.AddSearchProvider('<?php echo ROOT?>api/opensearch.php');">opensearch</a></li> + <li><?php echo T_('The secret tag "system:unfiled" allows you to find bookmarks without tags.'); ?></li> + <li><?php echo T_('The secret tag "system:imported" allows you to find imported bookmarks.'); ?></li> + </ul> + + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/admin.tpl.php b/data/templates/minimal/admin.tpl.php new file mode 100644 index 0000000..02502c0 --- /dev/null +++ b/data/templates/minimal/admin.tpl.php @@ -0,0 +1,44 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> +<div class="container-full"> + <div class="row"> + <div class="col-8 col-xs-12 col-sm-8 col-lg-8"> + <?php + echo '<h3>'.T_('Users management').'</h3>'; + + echo '<ol id="bookmarks">'; + + foreach($users as $user) { + echo '<li class="xfolkentry">'."\n"; + + echo '<div class="link">'; + echo '<a href="'.createURL('profile', $user->getUsername()).'">'.$user->getUsername().'</a>'; + echo ' - <span title="'. T_('Public/Shared/Private') .'">'. $user->getNbBookmarks('public') .' / '. $user->getNbBookmarks('shared') .' / '. $user->getNbBookmarks('private') .' '. T_('bookmark(s)') .'</span>'; + echo '</div>'; + + if($user->getUsername() != $currentUser->getUsername()) { + echo '<div class="meta">'; + echo '<a href="'.createURL('admin','delete/'.$user->getUsername()).'" onclick="return confirm(\''.T_('Are you sure?').'\');">'.T_('Delete').'</a>'; + echo '</div>'; + } + + echo '</li>'."\n"; + } + echo '</ol>'; + ?> + <h3><?php echo T_('Other actions')?></h3> + <p> + <a href="<?php echo createURL('admin','checkUrl/') ?>"> <?php echo T_('Check all URLs (May take some time)') ?></a> + </p> + </div> + <div class="col-4 col-xs-12 col-sm-4 col-lg-4"> + <?php + $this->includeTemplate('sidebar.tpl'); + ?> + </div> + </div> +</div> +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/bookmarkcommondescriptionedit.tpl.php b/data/templates/minimal/bookmarkcommondescriptionedit.tpl.php new file mode 100644 index 0000000..b1114d7 --- /dev/null +++ b/data/templates/minimal/bookmarkcommondescriptionedit.tpl.php @@ -0,0 +1,64 @@ +<?php + +$this->includeTemplate($GLOBALS['top_include']); + +list ($url, $hash) = explode('/', $_SERVER['PATH_INFO']); + + +?> +<script type="text/javascript"> +window.onload = function() { + document.getElementById("title").focus(); +} +</script> + +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <form action="<?php echo $formaction; ?>" method="post"> + <table title="<?php echo T_('Collaborative description: these fields can be viewed and modified by every users') ?>"> + <tr> + <th align="left"><?php echo T_('Title'); ?></th> + <td><input class="form-control" type="text" id="title" name="title" size="75" maxlength="255" value="<?php echo $description['cdTitle']; ?>" onkeypress="this.style.backgroundImage = 'none';" /></td> + <td></td> + </tr> + <tr> + <th align="left"><?php echo T_('Description'); ?></th> + <td><textarea class="form-control" name="description" cols="75" rows="10"><?php echo $description['cdDescription']; ?></textarea></td> + </tr> + <tr> + <td></td> + <td> + <?php + if(strlen($description['cdDatetime'])>0) { + echo T_('Last modification:').' '.$description['cdDatetime'].', '; + $lastUser = $userservice->getUser($description['uId']); + echo '<a href="'.createURL('profile', $lastUser['username']).'">' + . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>'; + } + ?> + </td> + <td></td> + </tr> + <tr> + <td></td> + <td> + <input class="btn btn-default" type="submit" name="confirm" value="<?php echo T_('Update'); ?>" /> + <input class="btn btn-default" type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" /> + </td> + <td></td> + </tr> + </table> + + <?php if (isset($referrer)): ?> + <div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> + <?php endif; ?> + <div><input type="hidden" name="hash" value="<?php echo $hash; ?>" /></div> + </form> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/bookmarklet.inc.php b/data/templates/minimal/bookmarklet.inc.php new file mode 100644 index 0000000..c93f581 --- /dev/null +++ b/data/templates/minimal/bookmarklet.inc.php @@ -0,0 +1,117 @@ +<h3><?php echo T_('Bookmarklet'); ?></h3> +<p id="bookmarklet"></p> +<script type="text/javascript"> +//<![CDATA[ +var browser = navigator.appName; +jQuery(function($) { +if (browser == "Opera") { + $('#bookmarklet').append( + <?php echo json_encode( + sprintf( + T_("Click one of the following bookmarklets to add a button you can click whenever you want to add the page you are on to %s") . ':', + $GLOBALS['sitename'] + ) + ); ?> + ); +} else { + $('#bookmarklet').append( + <?php echo json_encode( + sprintf( + T_("Drag one of the following bookmarklets to your browser's bookmarks and click it whenever you want to add the page you are on to %s") . ':', + $GLOBALS['sitename'] + ) + ); + ?> + ); +} +}); +//]]> +</script> +<script type="text/javascript"> +//<![CDATA[ +var selection = ''; +if (window.getSelection) { + selection = 'window.getSelection()'; +} else if (document.getSelection) { + selection = 'document.getSelection()'; +} else if (document.selection) { + selection = 'document.selection.createRange().text'; +} +if (browser == "Opera") { + $('#bookmarklet').append( + '<ul>' + + '<li>' + + '<a class="bookmarklet" href="' + + '<?php +$popupLink = 'javascript:' + . "location.href='" + . addProtocolToUrl(createURL('bookmarks', $GLOBALS['user'])) + . '?action=add' + . "&address='+encodeURIComponent(document.location.href)+'" + . "&title='+encodeURIComponent(document.title)+'" + . "&description='+encodeURIComponent(SELECTION)" + . ";"; +$link = 'opera:/button/' + //Opera command + . 'Go to page' + //command parameter 1 + . ',"' . rawurlencode($popupLink) . '"' + //command parameter 2 + . ',' + //button title + . ',"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . '"' + //button icon name + . ',"Scuttle"'; +echo jsEscTitle(htmlspecialchars($link)); +?>'.replace('SELECTION', selection) + + '"><?php echo jsEscTitle(sprintf(T_('Post to %s'), $GLOBALS['sitename'])); ?></a>' + + '</li>' + + '<li>' + + '<a class="bookmarklet" href="' + + '<?php +$popupLink = 'javascript:' + . 'open(' + . "'" . addProtocolToUrl(createURL('bookmarks', $GLOBALS['user'])) + . '?action=add' + . '&popup=1' + . "&address='+encodeURIComponent(document.location.href)+'" + . "&title='+encodeURIComponent(document.title)+'" + . "&description='+encodeURIComponent(SELECTION)" + . "," + . "'" . htmlspecialchars(jsEscTitle($GLOBALS['sitename'])) . "'," + . "'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465" + . ",left='+(screen.width-790)/2+',top='+(screen.height-425)/2" + . ");void 0"; +$link = 'opera:/button/' + . 'Go to page' + . ',"' . rawurlencode($popupLink) . '"' + . ',' + . ',"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . ' (Pop-up)"' + . ',"Scuttle"'; +echo jsEscTitle(htmlspecialchars($link)); +?>'.replace('SELECTION', selection) + + '"><?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?></a>' + + '</li>' + + '</ul>' + ); +} else { + $('#bookmarklet').append( + '<ul>' + + '<li><a class="bookmarklet" href="javascript:x=document;a=encodeURIComponent(x.location.href);t=encodeURIComponent(x.title);d=encodeURIComponent('+selection+');location.href=\'<?php echo addProtocolToUrl(createURL('bookmarks', $GLOBALS['user'])); ?>?action=add&address=\'+a+\'&title=\'+t+\'&description=\'+d;void 0;"><?php echo jsEscTitle(sprintf(T_('Post to %s'), $GLOBALS['sitename'])); ?><\/a><\/li>' + + '<li>' + + '<a class="bookmarklet" href="' + + 'javascript:x=document;' + + 'a=encodeURIComponent(x.location.href);' + + 't=encodeURIComponent(x.title);' + + 'd=encodeURIComponent('+selection+');' + + 'open(' + + '\'<?php echo addProtocolToUrl(createURL('bookmarks', $GLOBALS['user'])); ?>?action=add&popup=1&address=\'+a+\'&title=\'+t+\'&description=\'+d,\'<?php echo htmlspecialchars(jsEscTitleDouble($GLOBALS['sitename'])); ?>\',\'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465,left=\'+(screen.width-790)/2+\',top=\'+(screen.height-425)/2' + + ');void 0;">' + + '<?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?>' + + '</a>' + + '</li>' + + '</ul>' + ); +} +//]]> +</script> diff --git a/data/templates/minimal/bookmarks-thumbnail.inc.tpl.php b/data/templates/minimal/bookmarks-thumbnail.inc.tpl.php new file mode 100644 index 0000000..3b66eb9 --- /dev/null +++ b/data/templates/minimal/bookmarks-thumbnail.inc.tpl.php @@ -0,0 +1,19 @@ +<?php +/** + * Bookmark thumbnail image + * Shows the website thumbnail for the bookmark. + * + * Expects a $row variable with bookmark data. + */ +if (!isset($GLOBALS['enableWebsiteThumbnails'])) return; +if (!$GLOBALS['enableWebsiteThumbnails']) { + return; +} + +$thumbnailHash = md5( + $address . $GLOBALS['thumbnailsUserId'] . $GLOBALS['thumbnailsKey'] +); +//echo '<a href="'. $address .'"'. $rel .' ><img class="thumbnail" src="http://www.artviper.net/screenshots/screener.php?url='.$address.'&w=120&sdx=1280&userID='.$GLOBALS['thumbnailsUserId'].'&hash='.$thumbnailHash.'" />'; +echo '<img class="thumbnail" onclick="window.location.href=\''.htmlspecialchars($address).'\'" src="http://www.artviper.net/screenshots/screener.php?url='.htmlspecialchars($address).'&w=120&sdx=1280&userID='.$GLOBALS['thumbnailsUserId'].'&hash='.$thumbnailHash.'" />'; + +?> diff --git a/data/templates/minimal/bookmarks-vote-horizontal.inc.tpl.php b/data/templates/minimal/bookmarks-vote-horizontal.inc.tpl.php new file mode 100644 index 0000000..665894d --- /dev/null +++ b/data/templates/minimal/bookmarks-vote-horizontal.inc.tpl.php @@ -0,0 +1,50 @@ +<?php +/** + * Bookmark voting badge. + * Shows the number of votes and buttons to vote for or + * against a bookmark. + * Expects a $row variable with bookmark data + */ +if (!$GLOBALS['enableVoting'] || $GLOBALS['votingMode'] != 2) { + return; +} +if (!isset($row['hasVoted'])) { + $classes = 'vote-horiz vote-horiz-inactive'; +} else if (isset($row['vote'])) { + $classes = 'vote-horiz ' + . ($row['vote'] == 1 + ? 'vote-horiz-for' + : 'vote-horiz-against' + ); +} else { + $classes = 'vote-horiz'; +} +echo '<div class="' . $classes . '" id="bmv-' . $row['bId'] . '">'; +echo sprintf( + T_('Voting <span class="voting">%d</span>'), $row['bVoting'] +) . ' '; + +if (isset($row['hasVoted'])) { + if ($row['vote'] != 1) { + echo '<a class="btn btn-sm btn-default vote-for" rel="nofollow" href="' + . createVoteURL(true, $row['bId']) . '"' + . ' onclick="javascript:vote(' . $row['bId'] . ',1); return false;"' + . '><i class="fa fa-thumbs-o-up"></i> ' . T_('Vote for') . '</a> '; + } else { + echo '<span class="vote-for-inactive"><i class="fa fa-thumbs-up"></i> ' + . T_('Vote for') . '</span> '; + } + + + if ($row['vote'] != -1) { + echo '<a class="btn btn-sm btn-default vote-against" rel="nofollow" href="' + . createVoteURL(false, $row['bId']) . '"' + . ' onclick="vote(' . $row['bId'] . ',-1); return false;"' + . '><i class="fa fa-thumbs-o-down"></i> ' . T_('Vote against') . '</a>'; + } else { + echo '<span class="vote-against-inactive"><i class="fa fa-thumbs-down"></i> ' + . T_('Vote against') . '</span>'; + } +} +echo '</div>'; +?>
\ No newline at end of file diff --git a/data/templates/minimal/bookmarks-vote.inc.tpl.php b/data/templates/minimal/bookmarks-vote.inc.tpl.php new file mode 100644 index 0000000..a553569 --- /dev/null +++ b/data/templates/minimal/bookmarks-vote.inc.tpl.php @@ -0,0 +1,44 @@ +<?php +/** + * Bookmark voting badge. + * Shows the number of votes and buttons to vote for or + * against a bookmark. + * Expects a $row variable with bookmark data + */ +if (!$GLOBALS['enableVoting'] || $GLOBALS['votingMode'] != 1) { + return; +} +if (isset($row['hasVoted']) && !$row['hasVoted']) { + $classes = 'vote-badge vote-badge-inactive'; +} else if (isset($row['vote'])) { + $classes = 'vote-badge ' + . ($row['vote'] == 1 + ? 'vote-badge-for' + : 'vote-badge-against' + ); +} else { + $classes = 'vote-badge'; +} +echo '<span class="' . $classes . '" id="bmv-' . $row['bId'] . '">'; + +if (isset($row['hasVoted']) && $row['vote'] != 1) { + echo '<a class="btn btn-sm btn-default vote-for" rel="nofollow" href="' + . createVoteURL(true, $row['bId']) . '"' + . ' onclick="javascript:vote(' . $row['bId'] . ',1); return false;"' + . '>+</a>'; +} else { + echo '<span class="vote-for vote-for-inactive">+</span>'; +} + +echo '<span class="voting">' . $row['bVoting'] . '</span>'; + +if (isset($row['hasVoted']) && $row['vote'] != -1) { + echo '<a class="btn btn-sm btn-default vote-against" rel="nofollow" href="' + . createVoteURL(false, $row['bId']) . '"' + . ' onclick="vote(' . $row['bId'] . ',-1); return false;"' + . '>-</a>'; +} else { + echo '<span class="vote-against vote-against-inactive">-</span>'; +} +echo '</span>'; +?>
\ No newline at end of file diff --git a/data/templates/minimal/bookmarks.tpl.php b/data/templates/minimal/bookmarks.tpl.php new file mode 100644 index 0000000..1510d44 --- /dev/null +++ b/data/templates/minimal/bookmarks.tpl.php @@ -0,0 +1,533 @@ +<?php +/** + * Show a list of bookmarks. + * + * SemanticScuttle - your social bookmark manager. + * + * PHP version 5. + * + * @category Bookmarking + * @package SemanticScuttle + * @subcategory Templates + * @author Benjamin Huynh-Kim-Bang <mensonge@users.sourceforge.net> + * @author Christian Weiske <cweiske@cweiske.de> + * @author Eric Dane <ericdane@users.sourceforge.net> + * @license GPL http://www.gnu.org/licenses/gpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ + +/* Service creation: only useful services are created */ +$bookmarkservice = SemanticScuttle_Service_Factory::get('Bookmark'); +$tagservice = SemanticScuttle_Service_Factory::get('Tag'); +$cdservice = SemanticScuttle_Service_Factory::get('CommonDescription'); + + +$pageName = isset($pageName) ? $pageName : ''; +$user = isset($user) ? $user : ''; +$currenttag = isset($currenttag) ? $currenttag : ''; + + +$this->includeTemplate($GLOBALS['top_include']); +?> + +<?php if($pageName == PAGE_INDEX && $GLOBALS['welcomeMessage']):?> +<div class="alert alert-info alert-dismissable"> + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">*</button> + <p id="welcome"><?php echo $GLOBALS['welcomeMessage'];?></p> +</div> +<?php endif?> + + +<?php if($GLOBALS['enableAdminColors']!=false && isset($userid) && $userservice->isAdmin($userid) && $pageName != PAGE_WATCHLIST) : ?> +<div style="width:70%;text-align:center;"> + <img src="<?php echo $theme->resource('images/logo_24.gif'); ?>" width="12px"/> + <?php echo T_('Bookmarks on this page are managed by an admin user.'); ?> + <img src="<?php echo $theme->resource('images/logo_24.gif'); ?>" width="12px"/> +</div> +<?php endif?> + + +<?php +// common tag description +if(($currenttag!= '' && $GLOBALS['enableCommonTagDescription']) +|| (isset($hash) && $GLOBALS['enableCommonBookmarkDescription'])):?> + + +<p class="commondescription"><?php +$cDescription = ''; +if($currenttag!= '' && $cdservice->getLastTagDescription($currenttag)) { + $cDescription = $cdservice->getLastTagDescription($currenttag); + echo nl2br(filter($cDescription['cdDescription'])); +} elseif(isset($hash) && $cdservice->getLastBookmarkDescription($hash)) { + $cDescription = $cdservice->getLastBookmarkDescription($hash); + echo nl2br(filter($cDescription['cdTitle'])). "<br/>"; + echo nl2br(filter($cDescription['cdDescription'])). "<br/>"; +} + +//common tag description edit +if ($userservice->isLoggedOn()) { + if ($currenttag != '' + && ($GLOBALS['enableCommonTagDescriptionEditedByAll'] + || $currentUser->isAdmin() + ) + ) { + echo ' <a href="'. createURL('tagcommondescriptionedit', $currenttag).'" title="'.T_('Edit the common description of this tag').'">'; + echo !is_array($cDescription) || strlen($cDescription['cdDescription'])==0?T_('Edit the common description of this tag'):''; + echo ' <img src="' . $theme->resource('images/b_edit.png') . '" /></a>'; + } else if (isset($hash)) { + echo ' (<a href="'.createURL('bookmarkcommondescriptionedit', $hash).'" title="'.T_('Edit the common description of this bookmark').'">'; + echo T_('Edit the common description of this bookmark').'</a>)'; + } +} +?></p> +<?php endif ?> + + +<?php +/* personal tag description */ +if($currenttag!= '' && $user!='') { + $userObject = $userservice->getUserByUsername($user); + if($tagservice->getDescription($currenttag, $userObject['uId'])) { ?> + +<p class="commondescription"><?php +$pDescription = $tagservice->getDescription($currenttag, $userObject['uId']); +echo nl2br(filter($pDescription['tDescription'])); + +//personal tag description edit +if($userservice->isLoggedOn()) { + if($currenttag!= '') { + echo ' <a href="'. createURL('tagedit', $currenttag).'" title="'.T_('Edit your personal description of this tag').'" >'; + echo strlen($pDescription['tDescription'])==0?T_('Edit your personal description of this tag'):''; + echo ' <img src="' . $theme->resource('images/b_edit.png') . '" /></a>'; + } +} +?></p> + +<?php + } +} +?> + +<?php if (isset($bookmarks) && count($bookmarks) > 0) { ?> +<script type="text/javascript"> +window.onload = playerLoad; +<?php if ( isset($GLOBALS['enableQrCodes']) && $GLOBALS['enableQrCodes'] == true ) { ?> +jQuery(document).ready(function () { + jQuery('.qr-code-load').click(function() { + var bk = jQuery(this).parent().parent(); + if ( bk.find('.qr-code .qrcodeCanvas').length > 0 ) { + bk.find('.qr-code').find('.qrcodeCanvas').remove(); + } else { + bk.find('.qr-code').html('<div class="qrcodeCanvas"></div>'); + var o = { + text: bk.find('.link a').attr('href'), + width: 128, + height: 128 + }; + if ( ! jQuery('html.canvas').length ) { + o.render = "table"; + } + bk.find('.qr-code .qrcodeCanvas').qrcode(o); + bk.find('.qr-code').show(); + } + return false; + }); +}); +<?php } ?> +<?php if ( isset($GLOBALS['wallabagUrl']) && $GLOBALS['wallabagUrl'] != '' ) { ?> +jQuery(document).ready(function () { + jQuery('.wallabag-share').click(function() { + var bk = jQuery(this).parent().parent(); + var url = bk.find('.link a').attr('href'); + url = '<?php echo $GLOBALS['wallabagUrl']; ?>/index.php?action=add&plainurl=' + encodeURIComponent(url) + '&autoclose=true'; + window.open(url, 'wallabag', 'toolbar=no,width=800,height=600'); + return false; + }); +}); +<?php } ?> +<?php if ( isset($GLOBALS['yourlsUrl']) && $GLOBALS['yourlsUrl'] != '' && isset($GLOBALS['yourlsApiKey']) && preg_match('#^[a-z0-9]{10}$#', $GLOBALS['yourlsApiKey']) ) { ?> +jQuery(document).ready(function () { + jQuery('.yourls-share').click(function() { + var bk = jQuery(this).parent().parent(); + var url = bk.find('.link a').attr('href'); + var title = bk.find('.link a').html(); + url = '<?php echo $GLOBALS['yourlsUrl']; ?>?signature=<?php echo $GLOBALS['yourlsApiKey']; ?>&action=shorturl&format=simple&url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&autoclose=true'; + window.open(url, 'yourls', 'toolbar=no,width=800,height=600'); + return false; + }); +}); +<?php } ?> +</script> +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> +<p id="sort"><?php echo $total.' '.T_("bookmark(s)"); ?> - <?php echo T_("Sort by:"); ?> + <?php +$titleArrow = ''; +$dateArrow = ''; +$votingArrow = ''; +$dateSort = 'date_desc'; +$titleSort = 'title_asc'; +$votingSort = 'voting_desc'; + +switch(getSortOrder()) { +case 'date_asc': + $dateArrow = ' <i class="fa fa-caret-up"></i>'; + $dateSort = 'date_desc'; + break; + +case 'title_asc': + $titleArrow = ' <i class="fa fa-caret-up"></i>'; + $titleSort = 'title_desc'; + break; + +case 'title_desc': + $titleArrow = ' <i class="fa fa-caret-downp"></i>'; + $titleSort = 'title_asc'; + break; + +case 'voting_asc': + $votingArrow = ' <i class="fa fa-caret-up"></i>'; + $votingSort = 'voting_desc'; + break; + +case 'voting_desc': + $votingArrow = ' <i class="fa fa-caret-down"></i>'; + $votingSort = 'voting_asc'; + break; + +case 'date_desc': +default: + $dateArrow = ' <i class="fa fa-caret-down"></i>'; + $dateSort = 'date_asc'; + break; +} +?> + <a href="?sort=<?php echo $dateSort ?>"><?php echo T_("Date").$dateArrow; ?></a> + <span>/</span> + <a href="?sort=<?php echo $titleSort ?>"><?php echo T_("Title").$titleArrow; ?></a> + <span>/</span> +<?php if ($GLOBALS['enableVoting']) { ?> + <a href="?sort=<?php echo $votingSort ?>"><?php echo T_("Voting").$votingArrow; ?></a> + <span>/</span> +<?php } ?> + +<?php +if ($currenttag!= '') { + if ($user!= '') { + echo ' - '; + echo '<a href="'. createURL('tags', $currenttag) .'">'; + echo T_('Bookmarks from other users for this tag').'</a>'; + //echo T_(' for these tags'); + } else if ($userservice->isLoggedOn()){ + echo ' - '; + echo '<a href="'. createURL('bookmarks', $currentUser->getUsername().'/'.$currenttag) .'">'; + echo T_('Only your bookmarks for this tag').'</a>'; + //echo T_(' for these tags'); + } +} +?></p> + </div> + </div> +</div> + +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> +<?php + // PAGINATION + + // Ordering + $sortOrder = ''; + if (GET_SORT != '') { + $sortOrder = 'sort=' . getSortOrder(); + } + + $sortAmp = (($sortOrder) ? '&'. $sortOrder : ''); + $sortQue = (($sortOrder) ? '?'. $sortOrder : ''); + + // Previous + $perpage = getPerPageCount($currentUser); + if (!$page || $page < 2) { + $page = 1; + $start = 0; + $bfirst = '<span class="disable"><i class="fa fa-angle-double-left"></i> '. T_('First') .'</span>'; + $bprev = '<span class="disable"><i class="fa fa-angle-left"></i> '. T_('Previous') .'</span>'; + } else { + $prev = $page - 1; + $prev = 'page='. $prev; + $start = ($page - 1) * $perpage; + $bfirst= '<a href="'. sprintf($nav_url, $user, $currenttag, '') . $sortQue .'"><i class="fa fa-angle-double-left"></i> '. T_('First') .'</a>'; + $bprev = '<a href="'. sprintf($nav_url, $user, $currenttag, '?') . $prev . $sortAmp .'"><i class="fa fa-angle-left"></i> '. T_('Previous') .'</a>'; + } + + // Next + $next = $page + 1; + $totalpages = ceil($total / $perpage); + if (count($bookmarks) < $perpage || $perpage * $page == $total) { + $bnext = '<span class="disable">'. T_('Next') .' <i class="fa fa-angle-right"></i></span>'; + $blast = '<span class="disable">'. T_('Last') .' <i class="fa fa-angle-double-right"></i></span>' . "\n"; + } else { + $bnext = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $next . $sortAmp .'">'. T_('Next') .' <i class="fa fa-angle-right"></i></a>'; + $blast = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $totalpages . $sortAmp .'">'. T_('Last') .' <i class="fa fa-angle-double-right"></i></a>' . "\n"; + } + + // RSS + $brss = ''; + $size = count($rsschannels); + for ($i = 0; $i < $size; $i++) { + $brss = '<a style="background:#FFFFFF"' + . ' href="'. htmlspecialchars($rsschannels[$i][1]) . '"' + . ' title="' . htmlspecialchars($rsschannels[$i][0]) . '">' + . '<img src="' . $theme->resource('images/rss.gif') . '"' + . ' width="16" height="16"' + . ' alt="' . htmlspecialchars($rsschannels[$i][0]) .'"/>' + . '</a>'; + } + + $pagesBanner = '<p class="paging">'. $bfirst . $bprev . $bnext . $blast . sprintf(T_('Page %d of %d'), $page, $totalpages) ." ". $brss ." </p>\n"; + + if (getPerPageCount($currentUser) > 10) { + echo $pagesBanner; // display a page banner if too many bookmarks to manage + } + + +?> + </div> + </div> +</div> + + +<div class="container-full"> + <div class="row"> + <div class="col-8 col-xs-12 col-sm-8 col-lg-8"> +<ol<?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?> id="bookmarks"> +<?php + $addresses = array(); + foreach ($bookmarks as $key => &$row) { + $addresses[$row['bId']] = $row['bAddress']; + } + $otherCounts = $bookmarkservice->countOthers($addresses); + if ($userservice->isLoggedOn()) { + $existence = $bookmarkservice->bookmarksExist( + $addresses, $currentUser->getId() + ); + } + + if ($userservice->isLoggedOn()) { + $watchedNames = $userservice->getWatchNames( + $currentUser->getId(), true + ); + } else { + $watchedNames = null; + } + + foreach ($bookmarks as $key => &$row) { + switch ($row['bStatus']) { + case 0: + $access = ''; + break; + case 1: + $access = ' shared'; + break; + case 2: + $access = ' private'; + break; + } + + $cats = ''; + $tagsForCopy = ''; + $tags = $row['tags']; + foreach ($tags as $tkey => &$tag) { + $tagcaturl = sprintf( + $cat_url, + filter($row['username'], 'url'), + filter($tag, 'url') + ); + $cats .= sprintf( + '<a class="btn btn-sm btn-default" href="%s" rel="tag"><i class="fa fa-tag"></i>%s</a>, ', + $tagcaturl, filter($tag) + ); + $tagsForCopy .= $tag . ','; + } + $cats = substr($cats, 0, -2); + if ($cats != '') { + $cats = T_('Tags:') . ' ' . $cats; + } + + // Edit and delete links + $edit = ''; + if ($bookmarkservice->editAllowed($row)) { + $edit = ' - <a class="btn btn-sm btn-default" href="' . createURL('edit', $row['bId']) . '"><i class="fa fa-edit"></i> ' + . T_('Edit') + . '</a>' + . ' <a class="btn btn-sm btn-default" href="#" onclick="deleteBookmark(this, '. $row['bId'] .'); return false;"><i class="fa fa-trash-o"></i> ' + . T_('Delete') + .'</a>'; + } + + // Last update + $update = ' <small title="'. T_('Last update') .'">('. date($GLOBALS['shortdate'], strtotime($row['bModified'])). ') </small>'; + + // User attribution + $copy = ' ' . T_('by') . ' '; + if ($userservice->isLoggedOn() + && $currentUser->getUsername() == $row['username'] + ) { + $copy .= T_('you'); + } else { + $copy .= '<a href="' . createURL('bookmarks', $row['username']) . '">' + . SemanticScuttle_Model_UserArray::getName($row) + . '</a>'; + } + + // others + if (!isset($hash)) { + $others = $otherCounts[$row['bAddress']]; + $ostart = '<a href="' . createURL('history', $row['bHash']) . '">'; + $oend = '</a>'; + switch ($others) { + case 0: + break; + case 1: + $copy .= sprintf(T_(' and %s1 other%s'), $ostart, $oend); + break; + default: + $copy .= sprintf(T_(' and %2$s%1$s others%3$s'), $others, $ostart, $oend); + } + } + + // Copy link + if ($userservice->isLoggedOn() + && ($currentUser->getId() != $row['uId']) + && !$existence[$row['bAddress']] + ) { + $copy .= ' - <a href="' + . createURL( + 'bookmarks', + $currentUser->getUsername() + . '?action=add&copyOf=' . $row['bId']) + . '" title="'.T_('Copy this bookmark to YOUR bookmarks.').'">' + . T_('Copy') + . '</a>'; + } + + // Nofollow option + $rel = ''; + if ($GLOBALS['nofollow']) { + $rel = ' rel="nofollow"'; + } + + $address = $row['bAddress']; + $oaddress = $address; + // Redirection option + if ($GLOBALS['useredir']) { + $address = $GLOBALS['url_redir'] . $address; + } + + // Admin specific design + if ($userservice->isAdmin($row['username']) + && $GLOBALS['enableAdminColors'] + ) { + $adminBgClass = ' class="adminBackground"'; + $adminStar = ' <img' + . ' src="' . $theme->resource('images/logo_24.gif') . '"' + . ' width="12px"' + . ' title="' . T_('This bookmark is certified by an admin user.') . '"' + . '/>'; + } else { + $adminBgClass = ''; + $adminStar = ''; + } + + // Private Note (just visible by the owner and his/her contacts) + if ($watchedNames !== null + && ($currentUser->getId() == $row['uId'] + || in_array($row['username'], $watchedNames) + ) + ) { + $privateNoteField = $row['bPrivateNote']; + } else { + $privateNoteField = ''; + } + + if ($GLOBALS['enableVoting'] && $GLOBALS['hideBelowVoting'] !== null + && $row['bVoting'] < $GLOBALS['hideBelowVoting'] + ) { + $access .= ' below-threshold'; + } + + // Output + echo ' <li class="xfolkentry'. $access .'">'."\n"; + include 'bookmarks-thumbnail.inc.tpl.php'; + include 'bookmarks-vote.inc.tpl.php'; + + echo ' <div' . $adminBgClass . '>' . "\n"; + + echo ' <div class="link">' + . '<a href="'. htmlspecialchars($address) .'"'. $rel .' class="taggedlink">' + . filter($row['bTitle']) + . '</a>' . $adminStar . "</div>\n"; + if ($row['bDescription'] == '') { + $bkDescription = $GLOBALS['blankDescription']; + } else { + // Improve description display (anchors, links, ...) + $bkDescription = preg_replace('|\[\/.*?\]|', '', filter($row['bDescription'])); // remove final anchor + $bkDescription = preg_replace('|\[(.*?)\]|', ' <span class="anchorBookmark">$1</span> » ', $bkDescription); // highlight starting anchor + $bkDescription = preg_replace('@((http|https|ftp)://.*?)( |\r|$)@', '<a href="$1" rel="nofollow">$1</a>$3', $bkDescription); // make url clickable + + } + echo ' <div class="description">'. nl2br($bkDescription) ."</div>\n"; + echo ' <div class="address">' . htmlspecialchars(shortenString($oaddress)) . "</div>\n"; + + echo ' <div class="meta">' + . $cats . "\n" + . $copy . "\n" + . $edit . "\n" + . $update . "\n"; + if ( isset($GLOBALS['enableQrCodes']) && $GLOBALS['enableQrCodes'] == true ) { + echo '<a href="#" class="qr-code-load btn btn-sm btn-default"><i class="fa fa-qrcode"></i> QR Code</a> ' . "\n"; + } + if ( isset($GLOBALS['pocheUrl']) && $GLOBALS['pocheUrl'] != '' ) { + echo '<a href="#" class="poche-share btn btn-sm btn-default"><img src="' . $theme->resource('images/poche.png') . '" /> Poche</a> ' . "\n"; + } + if ( isset($GLOBALS['yourlsUrl']) && $GLOBALS['yourlsUrl'] != '' && isset($GLOBALS['yourlsApiKey']) && preg_match('#^[a-z0-9]{10}$#', $GLOBALS['yourlsApiKey']) ) { + echo '<a href="#" class="yourls-share btn btn-sm btn-default"><img src="' . $theme->resource('images/yourls.png') . '" /> Yourls</a> ' . "\n"; + } + echo " </div>\n"; + echo $privateNoteField != '' + ? ' <div class="privateNote" title="'. T_('Private Note on this bookmark') .'">'.$privateNoteField."</div>\n" + : ''; + echo ' '; + include 'bookmarks-vote-horizontal.inc.tpl.php'; + //echo " </div>\n"; + echo '<div class="qr-code"></div>'; + echo " </li>\n"; + } + ?> + +</ol> + + </div> + + <div class="col-4 col-xs-12 col-sm-4 col-lg-4"> + <?php + $this->includeTemplate('sidebar.tpl'); + ?> + </div> + </div> +</div> + + <?php + if(getPerPageCount($currentUser)>7) { + echo '<p class="backToTop"><a href="#header" title="'.T_('Come back to the top of this page.').'">'.T_('Top of the page').'</a></p>'; + } + echo $pagesBanner; // display previous and next links pages + RSS link + + +} else { + echo '<p class="error">'.T_('No bookmarks available').'</p>'; +} + +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/bottom.inc.php b/data/templates/minimal/bottom.inc.php new file mode 100644 index 0000000..4e5b226 --- /dev/null +++ b/data/templates/minimal/bottom.inc.php @@ -0,0 +1,50 @@ +<div id="bottom"> +<?php echo $GLOBALS['footerMessage'].' ';?> +<?php +echo '<a href="'.createURL('about').'">'.T_('About').'</a>'; +echo ' - '; +echo T_("Propulsed by "); +echo " <a href=\"https://sourceforge.net/projects/semanticscuttle/\">SemanticScuttle</a>"; + +if($GLOBALS['enableWebsiteThumbnails']) { + // Licence to the thumbnails provider (OBLIGATORY IF YOU USE ARTVIPER SERVICE) + echo ' (Thumbnails by <a href="http://www.artviper.net">webdesign</a>)'; +} +?> + +</div> + +</div> + +<?php +if(isset($GLOBALS['enableJappix']) && $GLOBALS['enableJappix'] == true) { + include(dirname(__FILE__) . '/jappix.php'); +} ?> + + +<?php if(isset($GLOBALS['googleAnalyticsCode']) && $GLOBALS['googleAnalyticsCode'] != ''):?> + +<script type="text/javascript"> +var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); +document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); +</script> +<script type="text/javascript"> +try { +var pageTracker = _gat._getTracker("<?php echo $GLOBALS['googleAnalyticsCode']?>"); +pageTracker._trackPageview(); +} catch(err) {}</script> + +<?php endif;?> + + +<?php if(isset($GLOBALS['piwikAnalyticsSiteId']) && $GLOBALS['piwikAnalyticsSiteId']!= '' && isset($GLOBALS['piwikAnalyticsUrl']) && $GLOBALS['piwikAnalyticsUrl']!= ''):?> +<?php include(dirname(__FILE__) . '/piwik.php'); ?> +<?php endif;?> + +</body> +</html> +<!-- + / __|___ __ _ _| |_| |_| (_)____ _ + \__ (_-</ _| || | _| _| | |_ / '_| + |___/__/\__|\_,_|\__|\__|_|_/__|_| +--> diff --git a/data/templates/minimal/dynamictags.inc.php b/data/templates/minimal/dynamictags.inc.php new file mode 100644 index 0000000..c2ab6d4 --- /dev/null +++ b/data/templates/minimal/dynamictags.inc.php @@ -0,0 +1,148 @@ +<?php +/*************************************************************************** + Copyright (C) 2005 - 2006 Scuttle project + http://sourceforge.net/projects/scuttle/ + http://scuttle.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ***************************************************************************/ + +/* Service creation: only useful services are created */ +$b2tservice = SemanticScuttle_Service_Factory :: get('Bookmark2Tag'); + +$logged_on_userid = $userservice->getCurrentUserId(); + +//tags from current user +$userPopularTags = $b2tservice->getPopularTags($logged_on_userid, 25, $logged_on_userid); +$userPopularTagsCloud = $b2tservice->tagCloud($userPopularTags, 5, 90, 175); +$userPopularTagsCount = count($userPopularTags); + +//tags from all users +$allPopularTags = $b2tservice->getPopularTags(null, 5, $logged_on_userid); +$allPopularTagsCloud = $b2tservice->tagCloud($allPopularTags, 5, 90, 175); +$allPopularTagsCount = count($allPopularTags); + + +// function printing the cloud +function writeTagsProposition($tagsCloud, $title) +{ + static $id = 0; + ++$id; + + echo <<<JS + $('.edit-tagclouds') + .append( +'<div class="collapsible" id="edit-tagcloud-$id">' ++ ' <h3>$title</h3>' ++ ' <p class="popularTags tags"></p>' ++ '</div>'); +JS; + + $taglist = ''; + foreach (array_keys($tagsCloud) as $key) { + $row = $tagsCloud[$key]; + $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); + $taglist .= '<span' + . ' title="'. $row['bCount'] . ' ' . $entries . '"' + . ' style="font-size:' . $row['size'] . '"' + . ' onclick="addTag(this)">' + . filter($row['tag']) + . '</span> '; + } + echo '$(\'#edit-tagcloud-' . $id . ' p\').append(' + . json_encode($taglist) + . ");\n"; +} + + +if ($allPopularTagsCount > 0 || $userPopularTagsCount > 0 ) { ?> +<script type="text/javascript"> +//<![CDATA[ +Array.prototype.contains = function (ele) { + for (var i = 0; i < this.length; i++) { + if (this[i] == ele) { + return true; + } + } + return false; +}; + +Array.prototype.remove = function (ele) { + var arr = new Array(); + var count = 0; + for (var i = 0; i < this.length; i++) { + if (this[i] != ele) { + arr[count] = this[i]; + count++; + } + } + return arr; +}; + +function addonload(addition) { + //var existing = window.onload; + window.onload = function () { + //existing(); + addition(); + } +} + +jQuery(function($) { +<?php +if ($userPopularTagsCount > 0) { + writeTagsProposition($userPopularTagsCloud, T_('Popular Tags')); +} +if ($allPopularTagsCount > 0) { + writeTagsProposition($allPopularTagsCloud, T_('Popular Tags From All Users')); +} +?> + var taglist = $('#tags'); + var tags = taglist.val().split(', '); + + var populartags = $('.edit-tagclouds span'); + + for (var i = 0; i < populartags.length; i++) { + if (tags.contains(populartags[i].innerHTML)) { + populartags[i].className = 'selected'; + } + } +}); + +function addTag(ele) { + var thisTag = ele.innerHTML; + var taglist = document.getElementById('tags'); + var tags = taglist.value.split(', '); + + // If tag is already listed, remove it + if (tags.contains(thisTag)) { + tags = tags.remove(thisTag); + ele.className = 'unselected'; + + // Otherwise add it + } else { + tags.splice(0, 0, thisTag); + ele.className = 'selected'; + } + + taglist.value = tags.join(', '); + + document.getElementById('tags').focus(); +} +//]]> +</script> +<div class="edit-tagclouds"></div> +<?php +} +?> diff --git a/data/templates/minimal/editbookmark.tpl.php b/data/templates/minimal/editbookmark.tpl.php new file mode 100644 index 0000000..dfb97e1 --- /dev/null +++ b/data/templates/minimal/editbookmark.tpl.php @@ -0,0 +1,226 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); + +$accessPublic = ''; +$accessShared = ''; +$accessPrivate = ''; +switch ($row['bStatus']) { + case 0 : + $accessPublic = ' selected="selected"'; + break; + case 1 : + $accessShared = ' selected="selected"'; + break; + case 2 : + $accessPrivate = ' selected="selected"'; + break; +} + +function jsEscTitle($title) +{ + return addcslashes($title, "'"); +} +function jsEscTitleDouble($title) +{ + return addcslashes(addcslashes($title, "'"), "'\\"); +} +function fixOperaButtonName($name) { + //yes, opera has problems with double quotes in button names + return str_replace('"', "''", $name); +} + +if (is_array($row['tags'])) { + $row['tags'] = implode(', ', $row['tags']); +} + +$ajaxUrl = ROOT . 'ajax/' + . ( + ($GLOBALS['adminsAreAdvisedTagsFromOtherAdmins'] && $currentUser->isAdmin()) + ? 'getadmintags' + : 'getcontacttags' + ) . '.php'; +?> + +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <form action="<?php echo $formaction; ?>" method="post"> + + <div class="form-group"> + <?php echo T_('Address'); ?> + <input class="form-control" type="text" id="address" name="address" size="75" maxlength="65535" value="<?php echo filter($row['bAddress'], 'xml'); ?>" onblur="useAddress(this)" /> + <i class="fa fa-chevron-up"></i> <?php echo T_('Required'); ?> + </div> + <hr> + <div class="form-group"> + <?php echo T_('Title'); ?> + <input class="form-control" type="text" id="titleField" name="title" size="75" maxlength="255" value="<?php echo filter($row['bTitle'], 'xml'); ?>" onkeypress="this.style.backgroundImage = 'none';" /> + <i class="fa fa-chevron-up"></i> <?php echo T_('Required'); ?> + </div> + <hr> + <div class="form-group"> + + <?php echo T_('Description'); ?> + <a onclick="var nz = document.getElementById('privateNoteZone'); nz.style.display='';this.style.display='none';"><?php echo T_("Add Note"); ?></a> + + <textarea class="form-control" name="description" id="description" rows="5" cols="63" ><?php echo filter($row['bDescription'], 'xml'); ?></textarea> + <i class="fa fa-chevron-up"></i> <?php echo T_('You can use anchors to delimite attributes. for example: [publisher]blah[/publisher] '); ?> + <?php if(count($GLOBALS['descriptionAnchors'])>0): ?> + <br /><br /> + <?php echo T_('Suggested anchors: '); ?> + <?php foreach($GLOBALS['descriptionAnchors'] as $anchorName => $anchorValue): ?> + <?php if(is_numeric($anchorName)) { + $anchorName = $anchorValue; + $anchorValue = '['.$anchorValue.']'.'[/'.$anchorValue.']'; + } ?> + <span class="anchor" title="<?php echo $anchorValue ?>" onclick="addAnchor('<?php echo $anchorValue ?>', 'description')"><?php echo $anchorName ?></span> + <?php endforeach; ?> + <?php endif; ?> + + </div> + <hr> + <div class="form-group" id="privateNoteZone" <?php if(strlen($row['bPrivateNote'])==0):?>style="display:none"<?php endif; ?>> + <?php echo T_('Private Note'); ?> + <textarea class="form-control" name="privateNote" id="privateNote" rows="1" cols="63" ><?php echo filter($row['bPrivateNote'], 'xml'); ?></textarea> + <i class="fa fa-chevron-up"></i> <?php echo T_('Just visible by you and your contacts.'); ?> + <hr> + </div> + + <div class="form-group"> + <?php echo T_('Tags'); ?> + <input class="form-control" type="text" id="tags" name="tags" size="75" value="<?php echo filter($row['tags'], 'xml'); ?>"/> + <i class="fa fa-chevron-up"></i> <?php echo T_('Comma-separated'); ?><br> + <small><?php echo htmlspecialchars(T_('Note: use ">" to include one tag in another. e.g.: europe>france>paris'))?></small><br> + <small><?php echo T_('Note: use "=" to make synonym two tags. e.g.: france=frenchcountry')?></small> + </div> + <hr> + <div class="form-group"> + <?php echo T_('Privacy'); ?> + + <select class="form-control" name="status"> + <option value="0"<?php echo $accessPublic ?>><?php echo T_('Public'); ?></option> + <option value="1"<?php echo $accessShared ?>><?php echo T_('Shared with Watch List'); ?></option> + <option value="2"<?php echo $accessPrivate ?>><?php echo T_('Private'); ?></option> + </select> + + + </div> + <hr> + <div class="form-group"> + <input class="btn btn-default" type="submit" name="submitted" value="<?php echo $btnsubmit; ?>" /> + <input class="btn btn-default" type="button" name="cancel" value="<?php echo T_('Cancel') ?>" onclick="<?php echo $popup?'window.close();':'javascript: history.go(-1)'; ?>" /> + <?php + if (isset($showdelete) && $showdelete) { + ?> + <input class="btn btn-default" type="submit" name="delete" value="<?php echo T_('Delete Bookmark'); ?>" /> + <?php + } + if (isset($showdelete) && $showdelete) { + echo ' (<a href="'.createURL('bookmarkcommondescriptionedit', $row['bHash']).'">'; + echo T_('edit common description').'</a>)'; + } + + if ($popup) { + ?> + <input type="hidden" name="popup" value="1" /> + <?php + } elseif (isset($referrer)) { + ?> + <input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /> + <?php + } + ?> + </div> + </form> + </div> + </div> +</div> + +<link href="<?php echo ROOT ?>js/jquery-ui-1.8.11/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css"/> + +<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.core.js"></script> +<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.widget.js"></script> +<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.position.js"></script> +<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.autocomplete.js"></script> +<script type="text/javascript"> +//<![CDATA[ +jQuery(document).ready(function() { + function split(val) + { + return val.split(/[,=><]\s*/); + } + + function extractLast(term) + { + return split(term).pop(); + } + //var availableTags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]; + + jQuery("input#tags").autocomplete({ + autoFocus: true, + minLength: 1, + + source: function(request, response) { + // delegate back to autocomplete, but extract the last term + var term = extractLast(request.term); + if (term.length < this.options.minLength) { + return; + } + response( + /* + $.ui.autocomplete.filter( + availableTags, extractLast(request.term) + ) + */ + $.getJSON( + "<?php echo $ajaxUrl; ?>", + { beginsWith: term }, + response + ) + ); + }, + + focus: function() { + // prevent value inserted on focus + return false; + }, + select: function(event, ui) { + var terms = split(this.value); + // remove the current input + terms.pop(); + // add the selected item + terms.push(ui.item.value); + // add placeholder to get the comma-and-space at the end + terms.push(""); + this.value = terms.join(", "); + return false; + } + }); +}); +//]]> +</script> + + +<div class="container-full"> + <div class="row"> +<?php +// Dynamic tag selection +$this->includeTemplate('dynamictags.inc'); + +// Bookmarklets and import links +if (empty($_REQUEST['popup']) && (!isset($showdelete) || !$showdelete)) { + +$this->includeTemplate('bookmarklet.inc.php'); +?> +<h3><?php echo T_('Import'); ?></h3> +<ul> + <li><a href="<?php echo createURL('importNetscape'); ?>"><?php echo T_('Import bookmarks from bookmark file'); ?></a> (<?php echo T_('Internet Explorer, Mozilla Firefox and Netscape'); ?>)</li> + <li><a href="<?php echo createURL('import'); ?>"><?php echo T_('Import bookmarks from del.icio.us'); ?></a></li> +</ul> + + </div> +</div> +<?php +} +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/editprofile-sslclientcerts.tpl.php b/data/templates/minimal/editprofile-sslclientcerts.tpl.php new file mode 100644 index 0000000..900c193 --- /dev/null +++ b/data/templates/minimal/editprofile-sslclientcerts.tpl.php @@ -0,0 +1,60 @@ +<?php +/** + * User's own profile page: SSL client certificate settings + * + * @param array $sslClientCerts Array of SSL client certificate objects + * @param string $formaction URL where to send the forms to + * @param SemanticScuttle_Model_User_SslClientCert + * $currentCert Current SSL client certificate (may be null) + */ +?> +<h3><?php echo T_('SSL client certificates'); ?></h3> +<?php if (count($sslClientCerts)) { ?> +<table> + <thead> + <tr> + <th>Options</th> + <th><?php echo T_('Serial'); ?></th> + <th><?php echo T_('Name'); ?></th> + <th><?php echo T_('Email'); ?></th> + <th><?php echo T_('Issuer'); ?></th> + </tr> + </thead> + <tbody> + <?php foreach($sslClientCerts as $cert) { ?> + <tr <?php if ($cert->isCurrent()) { echo 'class="ssl-current"'; } ?>> + <td> + <form method="post" action="<?php echo $formaction; ?>"> + <input type="hidden" name="certId" value="<?php echo $cert->id; ?>"/> + <button type="submit" name="action" value="deleteClientCert"> + <?php echo T_('delete'); ?> + </button> + </form> + </td> + <td><?php echo htmlspecialchars($cert->sslSerial); ?></td> + <td><?php echo htmlspecialchars($cert->sslName); ?></td> + <td><?php echo htmlspecialchars($cert->sslEmail); ?></td> + <td><?php echo htmlspecialchars($cert->sslClientIssuerDn); ?></td> + </tr> + <?php } ?> + </tbody> +</table> +<?php } else { ?> + <p><?php echo T_('No certificates registered'); ?></p> +<?php } ?> + +<?php if ($currentCert) { ?> + <?php if ($currentCert->isRegistered($sslClientCerts)) { ?> + <p><?php echo T_('Your current certificate is already registered with your account.'); ?></p> + <?php } else { ?> + <p> + <form method="post" action="<?php echo $formaction; ?>"> + <button type="submit" name="action" value="registerCurrentCert"> + <?php echo T_('Register current certificate to automatically login.'); ?> + </button> + </form> + </p> + <?php } ?> +<?php } else { ?> + <p><?php echo T_('Your browser does not provide a certificate.'); ?></p> +<?php } ?> diff --git a/data/templates/minimal/editprofile.tpl.php b/data/templates/minimal/editprofile.tpl.php new file mode 100644 index 0000000..df1b48c --- /dev/null +++ b/data/templates/minimal/editprofile.tpl.php @@ -0,0 +1,74 @@ + <?php + $this->includeTemplate($GLOBALS['top_include']); + ?> + + <div class="container-full"> + <div class="row"> + <div class="col-12 col-sm-12 col-xs-12 col-lg-12"> + <form action="<?php echo $formaction; ?>" method="post"> + <input type="hidden" name="token" value="<?php echo $token; ?>"/> + + <h3><?php echo T_('Account Details'); ?></h3> + + <div class="form-group"> + <?php echo T_('Username'); ?> + <?php echo $user; ?> + </div> + <div class="form-group"> + <label for="pPass"><?php echo T_('New Password'); ?></label> + <input class="form-control" type="password" name="pPass" id="pPass" size="20" /> + </div> + <div class="form-group"> + <label for="pPassConf"><?php echo T_('Confirm Password'); ?></label> + <input class="form-control" type="password" name="pPassConf" id="pPassConf" size="20" /> + </div> + <div class="form-group"> + <label for="pMail"><?php echo T_('E-mail'); ?></label> + <input class="form-control" type="text" name="pMail" id="pMail" size="75" value="<?php echo filter($objectUser->getEmail(), 'xml'); ?>" /> + <i class="fa fa-chevron-up"></i> <?php echo T_('Required'); ?> + </div> + <div class="form-group"> + <label for="pEnablePrivateKey"><?php echo T_('Enable') . ' ' . T_('Private RSS Feed'); ?></label> + <input class="form-control" type="checkbox" id="pEnablePrivateKey" name="pEnablePrivateKey" value="true" <?php echo $privateKeyIsEnabled;?> /> + </div> + <a onclick="getNewPrivateKey(this); return false;"><button class="btn btn-default" type="submit" name="submittedPK" value="1"><?php echo T_('Generate New Key'); ?></button></a> + <input class="form-control" type="text" id="pPrivateKey" name="pPrivateKey" size="40" value="<?php echo $privateKey;?>" readonly="readonly" /> + + <h3><?php echo T_('Personal Details'); ?></h3> + + <div class="form-group"> + <label for="pName"><?php echo T_('Name'); ?></label> + <input class="form-control" type="text" name="pName" id="pName" size="75" value="<?php echo filter($objectUser->getName(), 'xml'); ?>" /> + </div> + <div class="form-group"> + <label for="pPage"><?php echo T_('Homepage'); ?></label> + <input class="form-control" type="text" name="pPage" id="pPage" size="75" value="<?php echo filter($objectUser->getHomepage()); ?>" /> + </div> + <div class="form-group"> + <label for="pDesc"><?php echo T_('Description'); ?></label> + <textarea class="form-control" name="pDesc" id="pDesc" cols="75" rows="10"><?php echo $objectUser->getContent(); ?></textarea> + </div> + <input class="btn btn-default" type="submit" name="submitted" value="<?php echo T_('Save Changes'); ?>" /> + + <?php include 'editprofile-sslclientcerts.tpl.php'; ?> + <h3><?php echo T_('Actions'); ?></h3> + <table class="profile"> + <div class="form-group"> + <?php echo T_('Export bookmarks'); ?> + + <a href="../api/export_html.php"><?php echo T_('HTML file (for browsers)')?></a> / + <a href="../api/posts_all.php"><?php echo T_('XML file (like del.icio.us)')?></a> / + <a href="../api/export_csv.php"><?php echo T_('CSV file (for spreadsheet tools)')?></a> + + </div> + <div class="form-group"> </div> + <div class="form-group"> </div> + </table> + + </form> + </div> + </div> + </div> + <?php + $this->includeTemplate($GLOBALS['bottom_include']); + ?> diff --git a/data/templates/minimal/error.404.tpl.php b/data/templates/minimal/error.404.tpl.php new file mode 100644 index 0000000..fe9401d --- /dev/null +++ b/data/templates/minimal/error.404.tpl.php @@ -0,0 +1,9 @@ +<?php +header('HTTP/1.x 404 Not Found'); +$this->includeTemplate($GLOBALS['top_include']); +if (!$error) { + echo '<h1>'. T_('Not Found') .'</h1>'; + echo '<p>'. T_('The requested URL was not found on this server') .'</p>'; +} +$this->includeTemplate($GLOBALS['bottom_include']); +?>
\ No newline at end of file diff --git a/data/templates/minimal/error.500.tpl.php b/data/templates/minimal/error.500.tpl.php new file mode 100644 index 0000000..1d7f7ae --- /dev/null +++ b/data/templates/minimal/error.500.tpl.php @@ -0,0 +1,9 @@ +<?php +header('HTTP/1.x 500 Server error'); +$this->includeTemplate($GLOBALS['top_include']); +if (!$error) { + echo '<h1>'. T_('General server error') .'</h1>'; + echo '<p>'. T_('The requested URL could not be processed') .'</p>'; +} +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/importDelicious.tpl.php b/data/templates/minimal/importDelicious.tpl.php new file mode 100644 index 0000000..0f53cde --- /dev/null +++ b/data/templates/minimal/importDelicious.tpl.php @@ -0,0 +1,42 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<form id="import" enctype="multipart/form-data" action="<?php echo $formaction; ?>" method="post"> +<table> +<tr valign="top"> + <th align="left"><?php echo T_('File'); ?></th> + <td> + <input type="hidden" name="MAX_FILE_SIZE" value="1024000" /> + <input type="file" name="userfile" size="50" /> + </td> +</tr> +<tr valign="top"> + <th align="left"><?php echo T_('Privacy'); ?></th> + <td> + <select name="status"> + <option value="0"><?php echo T_('Public'); ?></option> + <option value="1"><?php echo T_('Shared with Watchlist'); ?></option> + <option value="2"><?php echo T_('Private'); ?></option> + </select> + </td> +</tr> +<tr> + <td /> + <td><input type="submit" value="<?php echo T_('Import'); ?>" /></td> +</tr> +</table> +</form> + +<h3><?php echo T_('Instructions'); ?></h3> +<ol> + <li><?php echo T_('Log in to the <a href="https://api.del.icio.us/v1/posts/all">export page at del.icio.us</a>'); ?>.</li> + <li><?php echo T_('Save the resulting <abbr title="Extensible Markup Language">XML</abbr> file to your computer'); ?>.</li> + <li><?php echo T_('Click <kbd>Browse...</kbd> to find this file on your computer. The maximum size the file can be is 1MB'); ?>.</li> + <li><?php echo T_('Select the default privacy setting for your imported bookmarks'); ?>.</li> + <li><?php echo T_('Click <kbd>Import</kbd> to start importing the bookmarks; it may take a minute'); ?>.</li> +</ol> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?>
\ No newline at end of file diff --git a/data/templates/minimal/importNetscape.tpl.php b/data/templates/minimal/importNetscape.tpl.php new file mode 100644 index 0000000..627a5af --- /dev/null +++ b/data/templates/minimal/importNetscape.tpl.php @@ -0,0 +1,50 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<div id="bookmarks"> + <form id="import" enctype="multipart/form-data" action="<?php echo $formaction; ?>" method="post"> + <table> + <tr valign="top"> + <th align="left"><?php echo T_('File'); ?></th> + <td> + <input type="hidden" name="MAX_FILE_SIZE" value="1024000" /> + <input type="file" name="userfile" size="50" /> + </td> + </tr> + <tr valign="top"> + <th align="left"><?php echo T_('Privacy'); ?></th> + <td> + <select name="status"> + <option value="0"><?php echo T_('Public'); ?></option> + <option value="1"><?php echo T_('Shared with Watchlist'); ?></option> + <option value="2"><?php echo T_('Private'); ?></option> + </select> + </td> + </tr> + <tr> + <td /> + <td><input type="submit" value="<?php echo T_('Import'); ?>" /></td> + </tr> + </table> + </form> + + <h3><?php echo T_('Instructions'); ?></h3> + <ol> + <li> + <p><?php echo T_('Export your bookmarks from your browser to a file'); ?>:</p> + <ul> + <li><?php echo T_('Internet Explorer: <kbd>File > Import and Export... > Export Favorites'); ?></kbd></li> + <li><?php echo T_('Mozilla Firefox: <kbd>Bookmarks > Manage Bookmarks... > File > Export...'); ?></kbd></li> + <li><?php echo T_('Netscape: <kbd>Bookmarks > Manage Bookmarks... > Tools > Export...'); ?></kbd></li> + </ul> + </li> + <li><?php echo T_('Click <kbd>Browse...</kbd> to find the saved bookmark file on your computer. The maximum size the file can be is 1MB'); ?>.</li> + <li><?php echo T_('Select the default privacy setting for your imported bookmarks'); ?>.</li> + <li><?php echo T_('Click <kbd>Import</kbd> to start importing the bookmarks; it may take a minute'); ?>.</li> + </ol> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?>
\ No newline at end of file diff --git a/data/templates/minimal/importStructure.tpl.php b/data/templates/minimal/importStructure.tpl.php new file mode 100644 index 0000000..9c54612 --- /dev/null +++ b/data/templates/minimal/importStructure.tpl.php @@ -0,0 +1,42 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<div id="bookmarks"> +<form id="import" enctype="multipart/form-data" + action="<?php echo $formaction; ?>" method="post"> +<table> + <tr valign="top"> + <th align="left"><?php echo T_('File'); ?></th> + <td><input type="hidden" name="MAX_FILE_SIZE" value="1024000" /> <input + type="file" name="userfile" size="50" /></td> + </tr> + <tr> + <td /> + <td><input type="submit" value="<?php echo T_('Import'); ?>" /></td> + </tr> +</table> +</form> + +<h3><?php echo T_('Instructions'); ?></h3> +<ol> + <li> + <p><?php echo T_('Create your structure into a simple text file and following this model:');?></p> + <ul> + <li>firstTagOfLevel1</li> + <li> firstTagOfLevel2 <i>(the line starts with two spaces)</i></li> + <li> secondTagOfLevel2</li> + <li> thirdTagOfLevel2</li> + <li>secondTagOfLevel1</li> + <li> fourthTagOfLevel2 <i>(included into secondTagOfLevel1)</i></li> + </ul> + </li> + <li> + <p><?php echo T_('Then import the file. The tags and their relations will be added to your profile.'); ?></p> + </li> +</ol> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?>
\ No newline at end of file diff --git a/data/templates/minimal/jappix.php b/data/templates/minimal/jappix.php new file mode 100644 index 0000000..b8f4bad --- /dev/null +++ b/data/templates/minimal/jappix.php @@ -0,0 +1,82 @@ +<?php +$show = false; + +if ( $currentUser->isAdmin() && isset($GLOBALS['jappixEnableForAdmin']) && $GLOBALS['jappixEnableForAdmin'] == true ) { + $show = true; +} else { + if ( $userservice->isLoggedOn() && isset($GLOBALS['jappixEnableForLogged']) && $GLOBALS['jappixEnableForLogged'] == true ) { + $show = true; + } +} + + + +if ( $show == true ) { + ?> + <script type="text/javascript"> + + jQuery.ajaxSetup({cache: true}); + <?php + $url = ""; + if ( isset($GLOBALS['jappixUrl']) && $GLOBALS['jappixUrl'] != "" ) { + $url .= $GLOBALS['jappixUrl']; + } else { + $url .= "https://static.jappix.com"; + } + $url .= '/php/get.php?l='; + $langs = array('ar', 'bg', 'cs', 'de', 'en', 'eo', 'es', 'et', 'fa', 'fr', 'he', 'hu', 'id', 'it', 'ja', 'la', 'lb', + 'mn', 'nl', 'oc', 'pl', 'pt-br', 'pt', 'ru', 'sk', 'sv', 'tr', 'uk', 'zh-cn', 'zh-tw'); + if ( isset($GLOBALS['jappixLang']) && in_array($GLOBALS['jappixLang'], $langs) ) { + $url .= $GLOBALS['jappixLang']; + } else { + $url .= 'en'; + } + $url .= '&t=js&g=mini.xml'; + + $autoconnect = ( isset($GLOBALS['jappixAutoConnect']) && $GLOBALS['jappixAutoConnect'] == true ) ? 'true' : 'false'; + + $domain = ( isset($GLOBALS['jappixDomain']) && $GLOBALS['jappixDomain'] != "" ) ? $GLOBALS['jappixDomain'] : 'anonymous.jappix.com'; + + $paramStr = $autoconnect . ', true, "' . $domain . '"'; + if ( isset($GLOBALS['jappixAuth']) && $GLOBALS['jappixAuth'] == true && isset($GLOBALS['jappixUser']) && isset($GLOBALS['jappixPassword']) ) { + $paramStr .= ', "' . $GLOBALS['jappixUser'] . '", "' . $GLOBALS['jappixPassword'] . '"'; + } + + $animate = ( isset($GLOBALS['jappixAnimate']) && $GLOBALS['jappixAnimate'] == true ) ? 'MINI_ANIMATE = true;' : 'MINI_ANIMATE = false;'; + + $resource = ( isset($GLOBALS['jappixResource']) && $GLOBALS['jappixResource'] != "" ) ? 'MINI_RESOURCE = "' . $GLOBALS['jappixResource'] . '";' : 'SemanticScuttle'; + + $nick = ( isset($GLOBALS['jappixNickName']) && $GLOBALS['jappixNickName'] != '' ) ? 'MINI_RANDNICK = true; MINI_NICKNAME = "' . $GLOBALS['jappixNickName'] . '";' : 'MINI_RANDNICK = true;'; + + $error = ( isset($GLOBALS['jappixErrorLink']) && $GLOBALS['jappixErrorLink'] != '' ) ? 'MINI_ERROR_LINK = "' . $GLOBALS['jappixErrorLink'] . '";' : 'MINI_ERROR_LINK = https://mini.jappix.com/issues;'; + + $disableMobile = ( isset($GLOBALS['jappixDisableMobile']) && $GLOBALS['jappixDisableMobile'] == true ) ? 'MINI_DISABLE_MOBILE = true;' : 'MINI_DISABLE_MOBILE = false;'; + + $groupChats = ''; + if ( isset($GLOBALS['jappixGroupChats']) && is_array($GLOBALS['jappixGroupChats']) ) { + $groupChats .= 'MINI_GROUPCHATS = ["' . implode('", "', $GLOBALS['jappixGroupChats']) . '"];'; + } + + $title = ( isset($GLOBALS['jappixTitle']) && $GLOBALS['jappixTitle'] != "" ) ? 'MINI_TITLE = "' . $GLOBALS['jappixTitle'] . '";' : 'Chat'; + + ?> + jQuery.getScript("<?php echo $url; ?>", function() { + <?php echo $groupChats; ?> + <?php echo $animate; ?> + <?php echo $nick ?> + <?php echo $resource ?> + <?php echo $error ?> + <?php echo $title ?> + <?php echo $disableMobile ?> + launchMini(<?php echo $paramStr; ?>); + jQuery('#jappix_mini a.jm_pane').css('height', '25px'); + jQuery('#jappix_mini a.jm_chat-tab, #jappix_mini a.jm_chat-tab.jm_clicked').css('height', '25px'); + jQuery('#jappix_mini div.jm_actions').css('height', '25px'); + jQuery('#jappix_mini div.jm_status_picker a, #jappix_mini div.jm_chan_suggest a').css('height', '20px'); + jQuery('#jappix_mini div.jm_status_picker, #jappix_mini div.jm_chan_suggest').css('top', '24px'); + }); + + </script> + <?php +} +?>
\ No newline at end of file diff --git a/data/templates/minimal/login.tpl.php b/data/templates/minimal/login.tpl.php new file mode 100644 index 0000000..23c4a5b --- /dev/null +++ b/data/templates/minimal/login.tpl.php @@ -0,0 +1,42 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<script type="text/javascript"> +window.onload = function() { + document.getElementById("username").focus(); +} +</script> +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <?php + if (!$userservice->isSessionStable()) { + echo '<p class="error">'.T_('Please activate cookies').'</p>'; + } + ?> + + <form action="<?php echo $formaction; ?>" method="post" role="form"> + <div><input type="hidden" name="query" value="<?php echo $querystring; ?>" /></div> + <div class="form-group"> + <label for="username"><?php echo T_('Username'); ?></label> + <input class="form-control" type="text" id="username" name="username" size="20" /> + </div> + <div class="form-group"> + <label for="password"><?php echo T_('Password'); ?></label></th> + <input class="form-control" type="password" id="password" name="password" size="20" /> + </div> + <div class="form-group"> + <label for="keeppass"><?php echo T_("Don't ask for my password for 2 weeks"); ?>.</label> + <input class="form-control" type="checkbox" name="keeppass" id="keeppass" value="yes" /> + </div> + <input class="btn btn-default" type="submit" name="submitted" value="<?php echo T_('Log In'); ?>" /> + <p>» <a href="<?php echo ROOT ?>password.php"><?php echo T_('Forgotten your password?') ?></a></p> + </form> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?>
\ No newline at end of file diff --git a/data/templates/minimal/password.tpl.php b/data/templates/minimal/password.tpl.php new file mode 100644 index 0000000..4fe0eab --- /dev/null +++ b/data/templates/minimal/password.tpl.php @@ -0,0 +1,26 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <p><?php echo sprintf(T_('If you have forgotten your password, %s can generate a new one. Enter the username and e-mail address of your account into the form below and we will e-mail your new password to you.'), $GLOBALS['sitename']); ?></p> + <form action="<?php echo $formaction; ?>" method="post"> + <div class="form-group"> + <label for="username"><?php echo T_('Username'); ?></label> + <input class="form-control" type="text" id="username" name="username" size="20" class="required" /> + </div> + <div class="form-group"> + <label for="email"><?php echo T_('E-mail'); ?></label> + <input class="form-control" type="text" id="email" name="email" size="40" class="required" /> + </div> + <input class="btn btn-default" type="submit" name="submitted" value="<?php echo T_('Generate Password'); ?>" /> + </form> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?>
\ No newline at end of file diff --git a/data/templates/minimal/piwik.php b/data/templates/minimal/piwik.php new file mode 100644 index 0000000..d29a7d4 --- /dev/null +++ b/data/templates/minimal/piwik.php @@ -0,0 +1,25 @@ +<!-- Piwik --> +<script type="text/javascript"> + var _paq = _paq || []; + _paq.push(["trackPageView"]); + _paq.push(["enableLinkTracking"]); + (function() { + var u=(("https:" == document.location.protocol) ? "https" : "http") + "://<?php echo $GLOBALS['piwikAnalyticsUrl']; ?>/"; + _paq.push(["setTrackerUrl", u+"piwik.php"]); + _paq.push(["setSiteId", "<?php echo $GLOBALS['piwikAnalyticsSiteId']; ?>"]); + var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; + g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s); + })(); +</script> +<?php if ( isset($GLOBALS['piwikAnalyticsNoScript']) && $GLOBALS['piwikAnalyticsNoScript'] == true ) { + $url = 'http'; + if ( isset($GLOBALS['piwikAnalyticsNoScriptHttps']) && $GLOBALS['piwikAnalyticsNoScriptHttps'] == true ) { + $url .= 's'; + } + $url .= '://' . $GLOBALS['piwikAnalyticsUrl'] . '/piwik.php?idsite=' . $GLOBALS['piwikAnalyticsSiteId'] . '&rec=1'; + ?> + <noscript> + <img src="<?php echo $url; ?>" style="border:0" alt=""> + </noscript> +<?php } ?> +<!-- End Piwik Code -->
\ No newline at end of file diff --git a/data/templates/minimal/profile.tpl.php b/data/templates/minimal/profile.tpl.php new file mode 100644 index 0000000..60bbae1 --- /dev/null +++ b/data/templates/minimal/profile.tpl.php @@ -0,0 +1,80 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <dl id="profile"> + <dt><?php echo T_('Username'); ?></dt> + <dd><?php echo $user; ?></dd> + <?php + if ($userservice->isLoggedOn() && $currentUser->isAdmin()) { + ?> + <dt><?php echo T_('Email'); ?></dt> + <dd><?php echo filter($objectUser->getEmail()) ?></dd> + <?php + } + if ($objectUser->getName() != "") { + ?> + <dt><?php echo T_('Name'); ?></dt> + <dd><?php echo filter($objectUser->getName()); ?></dd> + <?php + } + if ($objectUser->getHomepage() != "") { + ?> + <dt><?php echo T_('Homepage'); ?></dt> + <dd><a href="<?php echo filter($objectUser->getHomepage()); ?>"><?php echo filter($objectUser->getHomepage()); ?></a></dd> + <?php + } + ?> + <dt><?php echo T_('Member Since'); ?></dt> + <dd><?php echo date($GLOBALS['longdate'], strtotime($objectUser->getDatetime())); ?></dd> + <?php + if ($objectUser->getContent() != "") { + ?> + <dt><?php echo T_('Description'); ?></dt> + <dd><?php echo $objectUser->getContent(); ?></dd> + <?php + } + $watching = $userservice->getWatchNames($userid); + if ($watching) { + ?> + <dt><?php echo T_('Watching'); ?></dt> + <dd> + <?php + $list = ''; + foreach($watching as $watchuser) { + $list .= '<a href="'. createURL('bookmarks', $watchuser) .'">'. $watchuser .'</a>, '; + } + echo substr($list, 0, -2); + ?> + </dd> + <?php + } + $watchnames = $userservice->getWatchNames($userid, true); + if ($watchnames) { + ?> + <dt><?php echo T_('Watched By'); ?></dt> + <dd> + <?php + $list = ''; + foreach($watchnames as $watchuser) { + $list .= '<a href="'. createURL('bookmarks', $watchuser) .'">'. $watchuser .'</a>, '; + } + echo substr($list, 0, -2); + ?> + </dd> + <?php + } + ?> + <dt><?php echo T_('Bookmarks'); ?></dt> + <dd><a href="<?php echo createURL('bookmarks', $user) ?>"><?php echo T_('Go to bookmarks')?> >></a></dd> + </dl> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/register.tpl.php b/data/templates/minimal/register.tpl.php new file mode 100644 index 0000000..7c05a39 --- /dev/null +++ b/data/templates/minimal/register.tpl.php @@ -0,0 +1,50 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<script type="text/javascript"> +window.onload = function() { + document.getElementById("username").focus(); +} +</script> +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <p><?php echo sprintf(T_('Sign up here to create a free %s account. All the information requested below is required'), $GLOBALS['sitename']); ?>.</p> + + <form action="<?php echo $formaction; ?>" method="post"> + <div class="form-group"> + <label for="username"><?php echo T_('Username'); ?></label> + <input class="form-control" type="text" id="username" name="username" size="20" class="required" onkeyup="isAvailable(this, '')" /> + <span id="availability"><?php echo '<i class="fa fa-chevron-up"></i> '.T_(' at least 5 characters, alphanumeric (no spaces, no dots or other special ones)') ?></span> + </div> + <div class="form-group"> + <label for="password"><?php echo T_('Password'); ?></label> + <input class="form-control" type="password" id="password" name="password" size="20" class="required" /> + </div> + <div class="form-group"> + <label for="password2"><?php echo T_('Repeat Password'); ?></label> + <input class="form-control" type="password" id="password2" name="password2" size="20" class="required" /> + + </div> + <div class="form-group"> + <label for="email"><?php echo T_('E-mail'); ?></label> + <input class="form-control" type="text" id="email" name="email" size="40" class="required" value="<?php echo htmlspecialchars(POST_MAIL); ?>" /> + <span><?php echo '<i class="fa fa-chevron-up"></i> '.T_(' to send you your password if you forget it')?></span> + </div> + + <?php if(strlen($antispamQuestion)>0) {?> + <div class="form-group"> + <label for="antispamAnswer"><?php echo T_('Antispam question'); ?></label> + <input class="form-control" type="text" id="antispamAnswer" name="antispamAnswer" size="40" class="required" placeholder="<?php echo $antispamQuestion; ?>"/> + </div> + <?php } ?> + <input class="btn btn-default" type="submit" name="submitted" value="<?php echo T_('Register'); ?>" /> + </form> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/rss.tpl.php b/data/templates/minimal/rss.tpl.php new file mode 100644 index 0000000..4aba277 --- /dev/null +++ b/data/templates/minimal/rss.tpl.php @@ -0,0 +1,30 @@ +<?php +echo '<' . '?xml version="1.0" encoding="utf-8" ?' . ">\n"; +?> +<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:atom="http://www.w3.org/2005/Atom" +> +<channel> + <title><?php echo $feedtitle; ?></title> + <link><?php echo htmlspecialchars($pagelink); ?></link> + <atom:link rel="self" type="application/rss+xml" href="<?php echo htmlspecialchars($feedlink); ?>"/> + <description><?php echo htmlspecialchars($feeddescription); ?></description> + <pubDate><?php echo date('r'); ?></pubDate> + <lastBuildDate><?php echo $feedlastupdate ?></lastBuildDate> + <ttl>60</ttl> + +<?php foreach($bookmarks as $bookmark): ?> + <item> + <title><?php echo htmlspecialchars($bookmark['title']); ?></title> + <link><?php echo htmlspecialchars($bookmark['link']); ?></link> + <guid><?php echo $bookmark['guid']; ?></guid> + <description><?php echo htmlspecialchars($bookmark['description']); ?></description> + <dc:creator><?php echo htmlspecialchars($bookmark['creator']); ?></dc:creator> + <pubDate><?php echo $bookmark['pubdate']; ?></pubDate> +<?php foreach($bookmark['tags'] as $tag): ?> + <category><?php echo htmlspecialchars($tag); ?></category> +<?php endforeach; ?> + </item> +<?php endforeach; ?> +</channel> +</rss> diff --git a/data/templates/minimal/search.menu.php b/data/templates/minimal/search.menu.php new file mode 100644 index 0000000..cb82a95 --- /dev/null +++ b/data/templates/minimal/search.menu.php @@ -0,0 +1,55 @@ +<?php + + +/* Managing all possible inputs */ +$select_watchlist = isset($select_watchlist) ? $select_watchlist : ''; +$select_all = isset($select_all) ? $select_all : ''; + +$selected = ' selected="selected"'; +if (!isset($range)) { + $range = ''; +} +?> + + +<form id="search" action="<?php echo createURL('search'); ?>" method="post"> + + <?php + $currentUser = $currentUsername = null; + if ($userservice->isLoggedOn()) { + $currentUser = $userservice->getCurrentObjectUser(); + $currentUsername = $currentUser->getUsername(); + } + if ($userservice->isLoggedOn() || isset($user)) { + ?> + + <input class="form-control" type="text" name="terms" size="25" placeholder="<?php $terms=!isset($terms)?T_('Search...'):$terms; echo filter($terms); ?>" /> + <?php echo T_('in') ?> + + <select name="range" class="form-control"> + <?php + if ($range == 'user' && $user!=$currentUsername) { + ?> + <option value="<?php echo $user ?>"><?php echo T_("this user's bookmarks"); ?></option> + <?php + } + if ($userservice->isLoggedOn()) { + ?> + <option value="<?php echo $currentUsername; ?>"><?php echo T_('my bookmarks'); ?></option> + <option value="watchlist" <?php echo ($range == 'watchlist')?$selected:''?> ><?php echo T_('my watchlist'); ?></option> + <?php + } + ?> + <option value="all" <?php echo ($range == 'all' || $range == '')?$selected:'' ?> ><?php echo T_('all bookmarks'); ?></option> + </select> + + <?php + } else { + ?> + <input type="hidden" name="range" value="all" /> + <?php + } + ?> + <input class="form-control" type="submit" value="<?php echo T_('Search'); ?>" /> + +</form> diff --git a/data/templates/minimal/sidebar.block.common.php b/data/templates/minimal/sidebar.block.common.php new file mode 100644 index 0000000..dfc83ef --- /dev/null +++ b/data/templates/minimal/sidebar.block.common.php @@ -0,0 +1,28 @@ +<?php +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); +$commonTags = $b2tservice->getRelatedTagsByHash($hash); +$commonTags = $b2tservice->tagCloud($commonTags, 5, 90, 225, 'alphabet_asc'); + +if ($commonTags && count($commonTags) > 0) { + ?> + +<h2><?php echo T_('Popular Tags'); ?></h2> +<div id="common"> +<p class="tags"><?php +$contents = ''; + +if(strlen($user)==0) { + $cat_url = createURL('tags', '%2$s'); +} + +foreach ($commonTags as $row) { + $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); + $contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> '; +} +echo $contents ."\n"; +?></p> +</div> + +<?php +} +?> diff --git a/data/templates/minimal/sidebar.block.linked.php b/data/templates/minimal/sidebar.block.linked.php new file mode 100644 index 0000000..d3a25a5 --- /dev/null +++ b/data/templates/minimal/sidebar.block.linked.php @@ -0,0 +1,66 @@ +<?php +/* + * Used in: + * - populartags.php + * - bookmarks.php + * - alltags.php + * - tags.php + */ +/* Service creation: only useful services are created */ +$tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); + +require_once('sidebar.linkedtags.inc.php'); + +/* Manage input */ +$user = isset($user)?$user:''; +$userid = isset($userid)?$userid:0; +$currenttag = isset($currenttag) ? str_replace('+', ',', $currenttag) : ''; +//$summarizeLinkedTags = isset($summarizeLinkedTags)?$summarizeLinkedTags:false; + +$logged_on_userid = $userservice->getCurrentUserId(); +$editingMode = $logged_on_userid !== false; +?> +<h2><?php echo T_('Linked Tags'); ?></h2> +<div id="related"> +<?php +if ($editingMode) { + echo '<p style="margin-bottom: 13px;text-align:center;">'; + echo ' (<a href="'. createURL('tag2tagadd','') .'" rel="tag">'.T_('Add new link').'</a>) '; + echo ' (<a href="'. createURL('tag2tagdelete','') .'" rel="tag">'.T_('Delete link').'</a>)'; + echo '</p>'; +} +?> + <div id="related-content"></div> + <script type="text/javascript">//<![CDATA[ +jQuery("#related-content") +.jstree({ + "themes" : { + "theme": "default", + "dots": false, + "icons": true, + "url": '<?php echo ROOT_JS ?>themes/default/style.css' + }, + "json_data" : { + "ajax" : { + "url": function(node) { + //-1 is root + parentparam = ""; + if (node == -1 ) { + node = <?php echo json_encode($currenttag); ?>; + parentparam = "&parent=true"; + } else if (node.attr('rel')) { + node = node.attr('rel'); + } else { + return; + } + + return "<?php echo ROOT ?>ajax/getlinkedtags.php?tag=" + node + + parentparam; + } + } + }, + plugins : [ "themes", "json_data"] +}); +//]]> + </script> +</div>
\ No newline at end of file diff --git a/data/templates/minimal/sidebar.block.menu.php b/data/templates/minimal/sidebar.block.menu.php new file mode 100644 index 0000000..94a9fa2 --- /dev/null +++ b/data/templates/minimal/sidebar.block.menu.php @@ -0,0 +1,80 @@ +<?php +/* Service creation: only useful services are created */ +$tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); + + +require_once('sidebar.linkedtags.inc.php'); + +/* Manage input */ +$userid = isset($userid)?$userid:0; +$user = isset($user)?$user:null; + + +$logged_on_userid = $userservice->getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} + +// editing mode +if(($logged_on_userid != null) && ($userid === $logged_on_userid)) { + $editingMode = true; +} else { + $editingMode = false; +} + +if(!isset($user) || $user == '') { + $cat_url = createURL('tags', '%2$s'); +} + +$menuTags = $tag2tagservice->getMenuTags($userid); +if (sizeof($menuTags) > 0 || ($userid != 0 && $userid === $logged_on_userid)) { +?> + +<h2> +<?php + echo '<span title="'.sprintf(T_('Tags included into the tag \'%s\''), $GLOBALS['menuTag']).'">'.T_('Menu Tags').'</span> '; + //} +?> +</h2> + + +<div id="related"> +<table> +<?php + if($editingMode) { + echo '<tr><td></td><td>'; + echo ' (<a href="'. createURL('tag2tagadd','menu') .'" rel="tag">'.T_('Add new link').'</a>) '; + echo ' (<a href="'. createURL('tag2tagdelete','menu') .'" rel="tag">'.T_('Delete link').'</a>)'; + echo '</td></tr>'; + } + + $stopList = array(); + foreach($menuTags as $menuTag) { + $tag = $menuTag['tag']; + if(!in_array($tag, $stopList)) { + $displayLinkedTags = displayLinkedTags($tag, '>', $userid, $cat_url, $user, $editingMode, null, 1); + echo $displayLinkedTags['output']; + if(is_array($displayLinkedTags['stopList'])) { + $stopList = array_merge($stopList, $displayLinkedTags['stopList']); + } + } + } +?> +</table> + +<?php $cUser = $userservice->getUser($userid); ?> +<?php if($userid>0): ?> +<?php if($userid==$logged_on_userid): ?> +<p style="text-align:right"><a href="<?php echo createURL('alltags', $cUser['username']); ?>" title="<?php echo T_('See all your tags')?>"><?php echo T_('all your tags'); ?></a> →</p> +<?php else: ?> +<p style="text-align:right"><a href="<?php echo createURL('alltags', $cUser['username']); ?>" title="<?php echo T_('See all tags from this user')?>"><?php echo T_('all tags from this user'); ?></a> →</p> +<?php endif; ?> + +<?php else : ?> +<p style="text-align:right"><a href="<?php echo createURL('populartags', $cUser['username']); ?>" title="<?php echo T_('See popular tags')?>"><?php echo T_('Popular Tags'); ?></a> →</p> +<?php endif; ?> +</div> + +<?php +} +?> diff --git a/data/templates/minimal/sidebar.block.menu2.php b/data/templates/minimal/sidebar.block.menu2.php new file mode 100644 index 0000000..1c177a5 --- /dev/null +++ b/data/templates/minimal/sidebar.block.menu2.php @@ -0,0 +1,71 @@ +<?php +require_once('sidebar.linkedtags.inc.php'); + +/* Manage input */ +$userid = isset($userid)?$userid:0; +$user = isset($user)?$user:null; + + +$logged_on_userid = $userservice->getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} + + +$cat_url = createURL('tags', '%s'); +$menu2Tags = $GLOBALS['menu2Tags']; + +if (count($menu2Tags) > 0) { +?> + +<h2><?php echo T_('Featured Menu Tags');?></h2> + + +<div id="maintagsmenu" +<?php echo 'title="'.T_('This menu is composed of keywords (tags) organized by admins.').'"'?>> + <ul> +<?php +//this is unneeded and replaced by the ajax tree anyway. we keep it for +// non-js browsers +foreach ($menu2Tags as $menu2Tag) { + echo ' <li>' + . sprintf( + '<a href="%s">%s</a>', + sprintf($cat_url, $menu2Tag), + $menu2Tag + ) + . '</li>' . "\n"; +} +?> + </ul> +</div> +<script type="text/javascript"> +jQuery("#maintagsmenu") +.jstree({ + "themes" : { + "theme": "default", + "dots": false, + "icons": true, + "url": '<?php echo ROOT_JS ?>themes/default/style.css' + }, + "json_data" : { + "ajax" : { + "url": function(node) { + //-1 is root + if (node == -1 ) { + node = ""; + } else if (node.attr('rel')) { + node = node.attr('rel'); + } else { + return; + } + return "<?php echo ROOT ?>ajax/getadminlinkedtags.php?tag=" + node; + } + } + }, + plugins : [ "themes", "json_data"] +}); +</script> +<?php +} +?> diff --git a/data/templates/minimal/sidebar.block.popular.php b/data/templates/minimal/sidebar.block.popular.php new file mode 100644 index 0000000..524b1da --- /dev/null +++ b/data/templates/minimal/sidebar.block.popular.php @@ -0,0 +1,44 @@ +<?php +/* Service creation: only useful services are created */ +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); + + +if(!isset($user)) { + $user = ''; +} +if(!isset($userid)) { + $userid = NULL; +} + +$logged_on_userid = $userservice->getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} +$popularTags = $b2tservice->getPopularTags($userid, $popCount, $logged_on_userid); +$popularTags = $b2tservice->tagCloud($popularTags, 5, 90, 225, 'alphabet_asc'); + +if ($popularTags && count($popularTags) > 0) { +?> + +<h2><?php echo T_('Tags'); ?></h2> +<div id="popular"> + <p class="tags"> + <?php + $contents = ''; + + if(strlen($user)==0) { + $cat_url = createURL('tags', '%2$s'); + } + + foreach ($popularTags as $row) { + $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); + $contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> '; + } + echo $contents ."\n"; + ?> + </p> +</div> + +<?php +} +?> diff --git a/data/templates/minimal/sidebar.block.recent.php b/data/templates/minimal/sidebar.block.recent.php new file mode 100644 index 0000000..80ae71c --- /dev/null +++ b/data/templates/minimal/sidebar.block.recent.php @@ -0,0 +1,39 @@ +<?php +/* Service creation: only useful services are created */ +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); + +/* Manage input */ +$userid = isset($userid)?$userid:NULL; + +$logged_on_userid = $userservice->getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} +$recentTags = $b2tservice->getPopularTags($userid, $popCount, $logged_on_userid, $GLOBALS['defaultRecentDays']); +$recentTags = $b2tservice->tagCloud($recentTags, 5, 90, 225, 'alphabet_asc'); + +if ($recentTags && count($recentTags) > 0) { +?> + +<h2><?php echo T_('Recent Tags'); ?></h2> +<div id="recent"> + <?php + $contents = '<p class="tags">'; + + if(!isset($user) || $user == '') { + $user = ''; + $cat_url = createURL('tags', '%2$s'); + } + + foreach ($recentTags as $row) { + $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); + $contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> '; + } + echo $contents ."</p>\n"; + ?> + <p style="text-align:right"><a href="<?php echo createURL('populartags'); ?>"><?php echo T_('Popular Tags'); ?></a> →</p> +</div> + +<?php +} +?> diff --git a/data/templates/minimal/sidebar.block.related.php b/data/templates/minimal/sidebar.block.related.php new file mode 100644 index 0000000..60ee486 --- /dev/null +++ b/data/templates/minimal/sidebar.block.related.php @@ -0,0 +1,40 @@ +<?php +/* Service creation: only useful services are created */ +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); + + +if(!isset($user)) $user=""; + + +$logged_on_userid = $userservice->getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} + +if(!isset($userid)) { + $userid = NULL; +} + +if(isset($user) && strlen($user)==0) { + $cat_url = createURL('tags', '%2$s'); +} +if ($currenttag) { + $relatedTags = $b2tservice->getRelatedTags($currenttag, $userid, $logged_on_userid); + if (sizeof($relatedTags) > 0) { +?> + +<h2><?php echo T_('Related Tags'); ?></h2> +<div id="related"> + <table> + <?php foreach($relatedTags as $row): ?> + <tr> + <td><a href="<?php echo sprintf($cat_url, filter($user, 'url'), filter($row['tag'], 'url')); ?>" rel="tag"><?php echo filter($row['tag']); ?></a> <a href="<?php echo sprintf($cat_url, filter($user, 'url'), filter($currenttag, 'url') .'+'. filter($row['tag'], 'url')); ?>" title="<?php echo $currenttag . '+' . filter($row['tag']); ?>" class="crossTags">+</a></td> + </tr> + <?php endforeach; ?> + </table> +</div> + +<?php + } +} +?> diff --git a/data/templates/minimal/sidebar.block.search.php b/data/templates/minimal/sidebar.block.search.php new file mode 100644 index 0000000..d3cd8a5 --- /dev/null +++ b/data/templates/minimal/sidebar.block.search.php @@ -0,0 +1,51 @@ +<?php +/** + * Show a list of the last searches. + * + * SemanticScuttle - your social bookmark manager. + * + * PHP version 5. + * + * @category Bookmarking + * @package SemanticScuttle + * @subcategory Templates + * @author Benjamin Huynh-Kim-Bang <mensonge@users.sourceforge.net> + * @author Christian Weiske <cweiske@cweiske.de> + * @author Eric Dane <ericdane@users.sourceforge.net> + * @license GPL http://www.gnu.org/licenses/gpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ +/* Service creation: only useful services are created */ +$searchhistoryservice = SemanticScuttle_Service_Factory::get('SearchHistory'); + +$lastSearches = $searchhistoryservice->getAllSearches( + 'all', NULL, 3, NULL, true, false +); + +if ($lastSearches && count($lastSearches) > 0) { +?> + +<h2><?php echo T_('Last Searches'); ?></h2> +<div id="searches"> + <table> +<?php +foreach ($lastSearches as $row) { + echo ' <tr><td>'; + echo '<a href="' + . htmlspecialchars(createURL('search', $range.'/'.$row['shTerms'])) + . '">'; + echo htmlspecialchars($row['shTerms']); + echo '</a>'; + echo ' <span title="' + . T_('Number of bookmarks for this query') + . '">(' . $row['shNbResults'] . ')</span>'; + echo '</td></tr>' . "\n"; +} +//echo '<tr><td><a href="'.createURL('users').'">...</a></td></tr>'; +?> + + </table> +</div> +<?php +} +?> diff --git a/data/templates/minimal/sidebar.block.tagactions.php b/data/templates/minimal/sidebar.block.tagactions.php new file mode 100644 index 0000000..3351866 --- /dev/null +++ b/data/templates/minimal/sidebar.block.tagactions.php @@ -0,0 +1,35 @@ +<?php +/* Service creation: only useful services are created */ +//No specific services + +if ($userservice->isLoggedOn()) { + + if ($currentUser->getUsername() == $user) { + $tags = explode('+', $currenttag); + $renametext = T_ngettext('Rename Tag', 'Rename Tags', count($tags)); + $renamelink = createURL('tagrename', $currenttag); + $deletelink = createURL('tagdelete', $currenttag); + $tagdesclink = createURL('tagedit', $currenttag); + $commondesclink = createURL('tagcommondescriptionedit', $currenttag); + $addtag2taglinklink = createURL('tag2tagadd', $currenttag); +?> + +<h2><?php echo T_('Actions'); ?></h2> +<div id="tagactions"> + <ul> + <li><a href="<?php echo $renamelink; ?>"><?php echo $renametext ?></a></li> + <?php if (count($tags) == 1): ?> + <li><a href="<?php echo $deletelink; ?>"><?php echo T_('Delete Tag') ?></a></li> + <?php endif; ?> + <li><a href="<?php echo $tagdesclink; ?>"><?php echo T_('Edit Tag Description') ?></a></li> + <?php if ($GLOBALS['enableCommonTagDescription'] && ($GLOBALS['enableCommonTagDescriptionEditedByAll'] || $currentUser->isAdmin() )): ?> + <li><a href="<?php echo $commondesclink; ?>"><?php echo T_('Edit Tag Common Description') ?></a></li> + <?php endif; ?> + <li><a href="<?php echo $addtag2taglinklink; ?>"><?php echo T_('Create a link to another tag') ?></a></li> + </ul> +</div> + +<?php + } +} +?> diff --git a/data/templates/minimal/sidebar.block.users.php b/data/templates/minimal/sidebar.block.users.php new file mode 100644 index 0000000..58fdfb7 --- /dev/null +++ b/data/templates/minimal/sidebar.block.users.php @@ -0,0 +1,34 @@ +<?php +/* Service creation: only useful services are created */ +//No specific services + +$logged_on_userid = $userservice->getCurrentUserId(); +if ($logged_on_userid === false) { + $logged_on_userid = NULL; +} +$lastUsers = $userservice->getUsers(3); + +if ($lastUsers && count($lastUsers) > 0) { +?> + +<h2><?php echo T_('New Users'); ?></h2> +<div id="users"> +<table> +<?php +foreach ($lastUsers as $row) { + echo '<tr><td>'; + echo '<a href="'.createURL('profile', $row['username']).'">'; + echo SemanticScuttle_Model_UserArray::getName($row); + echo '</a>'; + echo ' (<a href="'.createURL('bookmarks', $row['username']).'">'.T_('bookmarks').'</a>)'; + echo '</td></tr>'; +} +//echo '<tr><td><a href="'.createURL('users').'">...</a></td></tr>'; +?> + +</table> +<p style="text-align:right"><a href="<?php echo createURL('users'); ?>" title="<?php echo T_('See all users')?>"><?php echo T_('All users'); ?></a> →</p> +</div> +<?php +} +?> diff --git a/data/templates/minimal/sidebar.block.watchlist.php b/data/templates/minimal/sidebar.block.watchlist.php new file mode 100644 index 0000000..3af9c5a --- /dev/null +++ b/data/templates/minimal/sidebar.block.watchlist.php @@ -0,0 +1,60 @@ +<?php +/* Service creation: only useful services are created */ +//No specific services + +$watching = $userservice->getWatchNames($userid); +$watchedBy = $userservice->getWatchNames($userid, true); + + +$closeContacts = array(); // people in my contacts list and who I am also in the contacts list +foreach($watching as $watchuser) { + if(in_array($watchuser, $watchedBy)) { + $closeContacts[] = $watchuser; + } +} + +?> + +<?php if(count($closeContacts)>0):?> +<h2 title="<?php echo T_('Close contacts are mutual contacts');?>"><?php echo ' ↔ '. T_('Close contacts'); ?></h2> +<div id="watching"> + <ul> + <?php foreach($closeContacts as $watchuser): ?> + <li><a href="<?php echo createURL('bookmarks', $watchuser); ?>"><?php echo $watchuser; ?></a> </li> + <?php endforeach; ?> + </ul> +</div> +<?php endif; ?> + + +<h2><?php echo ' → '. T_('Watching'); ?></h2> +<div id="watching"> + <ul> + <?php if($userservice->isLoggedOn() && $currentUser->getUsername() == $user): ?> + <li> + <form action="<?php echo createURL('watch', '');?>" method="post"> + <input type="text" name="contact" value="<?php echo T_('Add a contact...');?>" onfocus="if (this.value == '<?php echo T_('Add a contact...');?>') this.value = '';" onblur="if (this.value == '') this.value = '<?php echo T_('Add a contact...');?>';" title="<?php echo T_('Type a username to add it to your contacts.') ?>" /> + </form> + </li> + <?php endif; ?> + + <?php foreach($watching as $watchuser): ?> + <li><a href="<?php echo createURL('bookmarks', $watchuser); ?>"><?php echo $watchuser; ?></a> + <?php if($userservice->isLoggedOn() && $currentUser->getUsername() == $user): ?> + - <a href="<?php echo createUrl('watch','?contact='.$watchuser); ?>" title="<?php echo T_('Remove this contact'); ?>">x</a> + </li> + <?php endif; ?> + <?php endforeach; ?> + + </ul> +</div> + +<h2><?php echo ' ← '. T_('Watched By'); ?></h2> +<div id="watching"> + <ul> + <?php foreach($watchedBy as $watchuser): ?> + <li><a href="<?php echo createURL('bookmarks', $watchuser); ?>"><?php echo $watchuser; ?></a> </li> + <?php endforeach; ?> + </ul> + +</div> diff --git a/data/templates/minimal/sidebar.block.watchstatus.php b/data/templates/minimal/sidebar.block.watchstatus.php new file mode 100644 index 0000000..99574aa --- /dev/null +++ b/data/templates/minimal/sidebar.block.watchstatus.php @@ -0,0 +1,28 @@ +<?php +/* Service creation: only useful services are created */ +//No specific services + + +if ($userservice->isLoggedOn()) { + + if ($currentUser->getUsername() != $user) { + $result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId()); + if ($result) { + $linkText = T_('Remove from Watchlist'); + } else { + $linkText = T_('Add to Watchlist'); + } + $linkAddress = createURL('watch', $user); +?> + +<h2><?php echo T_('Actions'); ?></h2> +<div id="watchlist"> + <ul> + <li><a href="<?php echo $linkAddress ?>"><?php echo $linkText ?></a></li> + </ul> +</div> + +<?php + } +} +?>
\ No newline at end of file diff --git a/data/templates/minimal/sidebar.linkedtags.inc.php b/data/templates/minimal/sidebar.linkedtags.inc.php new file mode 100644 index 0000000..020d0f0 --- /dev/null +++ b/data/templates/minimal/sidebar.linkedtags.inc.php @@ -0,0 +1,84 @@ +<?php +/* +To be inserted into blocks where structured tags must be displayed in a tree format. +*/ + +function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode =false, $precedentTag =null, $level=0, $stopList=array()) { + + if(in_array($tag, $stopList)) { + return array('output' => '', 'stoplist' => $stopList); + } + + $tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); + $tagstatservice =SemanticScuttle_Service_Factory::get('TagStat'); + + // link '>' + if($level>1) { + if($editingMode) { + $link = '<small><a href="'.createURL('tag2tagedit', $precedentTag.'/'.$tag).'" title="'._('Edit link').'">></a> </small>'; + } else { + $link = '> '; + } + } else { + $link = ''; + } + + $output = ''; + $output.= '<tr>'; + $output.= '<td></td>'; + $output.= '<td>'; + $output.= $level == 1?'<b>':''; + $output.= str_repeat(' ', $level*2) .$link.'<a href="'. sprintf($cat_url, filter($user, 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>'; + $output.= $level == 1?'</b>':''; + //$output.= ' - '. $tagstatservice->getMaxDepth($tag, $linkType, $uId); + + $synonymTags = $tag2tagservice->getAllLinkedTags($tag, '=', $uId); + $synonymTags = is_array($synonymTags)?$synonymTags:array($synonymTags); + sort($synonymTags); + $synonymList = ''; + foreach($synonymTags as $synonymTag) { + //$output.= ", ".$synonymTag; + $synonymList.= $synonymTag.' '; + } + if(count($synonymTags)>0) { + $output.= ', '.$synonymTags[0]; + } + if(count($synonymTags)>1) { + $output.= '<span title="'.T_('Synonyms:').' '.$synonymList.'">, etc</span>'; + } + + /*if($editingMode) { + $output.= ' ('; + $output.= '<a href="'.createURL('tag2tagadd', $tag).'" title="'._('Add a subtag').'">+</a>'; + if(1) { + $output.= ' - '; + $output.= '<a href="'.createURL('tag2tagdelete', $tag).'">-</a>'; + } + $output.= ')'; + }*/ + $output.= '</td>'; + $output.= '</tr>'; + + $tags = array($tag); + $tags = array_merge($tags, $synonymTags); + foreach($tags as $tag) { + + if(!in_array($tag, $stopList)) { + $linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $uId); + $precedentTag = $tag; + $stopList[] = $tag; + foreach($linkedTags as $linkedTag) { + $displayLinkedTags = displayLinkedTags($linkedTag, $linkType, $uId, $cat_url, $user, $editingMode, $precedentTag, $level + 1, $stopList); + $output.= $displayLinkedTags['output']; + } + if(isset($displayLinkedTags) && is_array($displayLinkedTags['stopList'])) { + $stopList = array_merge($stopList, $displayLinkedTags['stopList']); + $stopList = array_unique($stopList); + } + } + + } + return array('output' => $output, 'stopList' => $stopList); +} + +?> diff --git a/data/templates/minimal/sidebar.tpl.php b/data/templates/minimal/sidebar.tpl.php new file mode 100644 index 0000000..b4fac96 --- /dev/null +++ b/data/templates/minimal/sidebar.tpl.php @@ -0,0 +1,23 @@ +<?php if ($GLOBALS['enableAdminColors'] != false + && isset($userid) && $userservice->isAdmin($userid) +): ?> +<div id="sidebar" class="adminBackground"> +<?php else: ?> +<div id="sidebar"> +<?php endif ?> + + +<?php +echo $GLOBALS['sidebarTopMessage'].' '; + +if (isset($sidebar_blocks) && count($sidebar_blocks)) { + $size = count($sidebar_blocks); + for ($i = 0; $i < $size; $i++) { + $this->includeTemplate('sidebar.block.'. $sidebar_blocks[$i]); + } +} + +echo $GLOBALS['sidebarBottomMessage']; +?> + +</div> diff --git a/data/templates/minimal/tag2tagadd.tpl.php b/data/templates/minimal/tag2tagadd.tpl.php new file mode 100644 index 0000000..c21e891 --- /dev/null +++ b/data/templates/minimal/tag2tagadd.tpl.php @@ -0,0 +1,64 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <form action="<?php echo $formaction; ?>" method="post"> + + <p align="right" style="float:right"> + <small style="text-align:right"><?php echo T_('Note: use "=" to make synonym two tags. e.g.: france=frenchcountry')?></small><br/> + <small style="text-align:right"><?php echo T_('Note: use ">" to include one tag in another. e.g.: europe>france>paris')?></small><br/> + </p> + + <p><?php echo T_('Create new link:')?></p> + <p> + <input class="form-control" type="text" name="tag1" value="<?php echo $tag1 ?>"/> + <input class="form-control" type="text" name="linkType" value=">" size="1" maxlength="1"/> + <input class="form-control" type="text" name="tag2" /> + </p> + <p> + <small style="text-align:right"><?php echo sprintf(T_('Note: include a tag into \'%s\' tag (e.g. %s>countries) display the tag into the menu box'), $GLOBALS['menuTag'], $GLOBALS['menuTag'])?></small> + </p> + <!--p><?php echo T_('Are you sure?'); ?></p--> + <p> + <input class="btn btn-default" type="submit" name="confirm" value="<?php echo T_('Create'); ?>" /> + <input class="btn btn-default" type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" /> + </p> + + <?php if (isset($referrer)): ?> + <div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> + <?php endif; ?> + + </form> + + <?php + if(count($links)>0) { + echo T_("Existing links:"); + foreach($links as $link) { + echo '<span style="white-space:nowrap;margin-left:25px;">'; + if($link['tag1'] == $tag1 || $link['tag1'] == $tag2) { + $textTag1 = '<b>'.$tag1.'</b>'; + } else { + $textTag1 = $link['tag1']; + } + if($link['tag2'] == $tag1 || $link['tag2'] == $tag2) { + $textTag2 = '<b>'.$tag2.'</b>'; + } else { + $textTag2 = $link['tag2']; + } + + echo $textTag1.' '.$link['relationType'].' '.$textTag2; + echo "</span> "; + } + } else { + echo T_('No links'); + } + ?> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/tag2tagdelete.tpl.php b/data/templates/minimal/tag2tagdelete.tpl.php new file mode 100644 index 0000000..085612d --- /dev/null +++ b/data/templates/minimal/tag2tagdelete.tpl.php @@ -0,0 +1,56 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <form action="<?php echo $formaction; ?>" method="post"> + <!--input type="hidden" name="tag1" value="<?php echo $tag1 ?>" /> + <input type="hidden" name="tag2" value="<?php echo $tag2 ?>" /--> + <p> + <input class="form-control" type="text" name="tag1" value="<?php echo $tag1 ?>"/> + <input class="form-control" type="text" name="linkType" value=">" size="1" maxlength="1"/> + <input class="form-control" type="text" name="tag2" value="<?php echo $tag2 ?>"/> + </p> + <p><?php echo T_('Are you sure?'); ?></p> + <p> + <input class="btn btn-default" type="submit" name="confirm" value="<?php echo T_('Yes'); ?>" /> + <input class="btn btn-default" type="submit" name="cancel" value="<?php echo T_('No'); ?>" /> + </p> + + <?php if (isset($referrer)): ?> + <div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> + <?php endif; ?> + + </form> + + <?php + if(count($links)>0) { + echo T_("Existing links:"); + foreach($links as $link) { + echo '<span style="white-space:nowrap;margin-left:25px;">'; + if($link['tag1'] == $tag1 || $link['tag1'] == $tag2) { + $textTag1 = '<b>'.$tag1.'</b>'; + } else { + $textTag1 = $link['tag1']; + } + if($link['tag2'] == $tag1 || $link['tag2'] == $tag2) { + $textTag2 = '<b>'.$tag2.'</b>'; + } else { + $textTag2 = $link['tag2']; + } + + echo $textTag1.' '.$link['relationType'].' '.$textTag2; + echo "</span> "; + } + } else { + echo T_('No links'); + } + ?> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/tag2tagedit.tpl.php b/data/templates/minimal/tag2tagedit.tpl.php new file mode 100644 index 0000000..03ca7c1 --- /dev/null +++ b/data/templates/minimal/tag2tagedit.tpl.php @@ -0,0 +1,81 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <form action="<?php echo $formdeleteaction; ?>" method="post"> + <p><?php echo T_('Delete the link')?></p> + <!--input type="hidden" name="tag1" value="<?php echo $tag1 ?>" /> + <input type="hidden" name="tag2" value="<?php echo $tag2 ?>" /--> + <p> + <input class="form-control" type="text" name="tag1" value="<?php echo $tag1 ?>"/> + <input class="form-control" type="text" name="linkType" value=">" size="1" maxlength="1"/> + <input class="form-control" type="text" name="tag2" value="<?php echo $tag2 ?>"/> + </p> + <p><?php echo T_('Are you sure?'); ?></p> + <p> + <input class="btn btn-default" type="submit" name="confirm" value="<?php echo T_('Yes'); ?>" /> + <input class="btn btn-default" type="submit" name="cancel" value="<?php echo T_('No'); ?>" /> + </p> + + <?php if (isset($referrer)): ?> + <div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> + <?php endif; ?> + + </form> + + <hr /> + + <form action="<?php echo $formaddaction; ?>" method="post"> + <p><?php echo T_('Create new link')?></p> + <p> + <input type="text" name="tag1" value="<?php echo $tag1 ?>"/> + <input type="text" name="linkType" value=">" size="1" maxlength="1"/> + <input type="text" name="tag2" /> + </p> + <!--p><?php echo T_('Are you sure?'); ?></p--> + <p> + <input type="submit" name="confirm" value="<?php echo T_('Create'); ?>" /> + <input type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" /> + </p> + + <?php if (isset($referrer)): ?> + <div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> + <?php endif; ?> + + </form> + + <hr> + + <?php + if(count($links)>0) { + echo T_("Existing links:"); + foreach($links as $link) { + echo '<span style="white-space:nowrap;margin-left:25px;">'; + if($link['tag1'] == $tag1 || $link['tag1'] == $tag2) { + $textTag1 = '<b>'.$tag1.'</b>'; + } else { + $textTag1 = $link['tag1']; + } + if($link['tag2'] == $tag1 || $link['tag2'] == $tag2) { + $textTag2 = '<b>'.$tag2.'</b>'; + } else { + $textTag2 = $link['tag2']; + } + + echo $textTag1.' '.$link['relationType'].' '.$textTag2; + echo "</span> "; + } + } else { + echo T_('No links'); + } + ?> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/tagcommondescriptionedit.tpl.php b/data/templates/minimal/tagcommondescriptionedit.tpl.php new file mode 100644 index 0000000..e46c184 --- /dev/null +++ b/data/templates/minimal/tagcommondescriptionedit.tpl.php @@ -0,0 +1,55 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); + +?> +<script type="text/javascript"> +window.onload = function() { + document.getElementById("description").focus(); +} +</script> + +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <form action="<?php echo $formaction; ?>" method="post"> + <table> + <tr> + <th align="left"><?php echo T_('Description'); ?></th> + <td><textarea class="form-control" name="description" cols="75" rows="10"><?php echo $description['cdDescription']; ?></textarea></td> + </tr> + <tr> + <td></td> + <td> + <?php + if(strlen($description['cdDatetime'])>0) { + echo T_('Last modification:').' '.$description['cdDatetime'].', '; + $lastUser = $userservice->getUser($description['uId']); + echo '<a href="' . createURL('profile', $lastUser['username']) . '">' + . SemanticScuttle_Model_UserArray::getName($lastUser) . '</a>'; + } + ?> + </td> + <td></td> + </tr> + <tr> + <td></td> + <td> + <input class="btn btn-default" type="submit" name="confirm" value="<?php echo T_('Update'); ?>" /> + <input class="btn btn-default" type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" /> + </td> + <td></td> + </tr> + </table> + + <?php if (isset($referrer)): ?> + <div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> + <?php endif; ?> + <div><input type="hidden" name="tag" value="<?php echo $tag; ?>" /></div> + </form> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/tagdelete.tpl.php b/data/templates/minimal/tagdelete.tpl.php new file mode 100644 index 0000000..41dd3c3 --- /dev/null +++ b/data/templates/minimal/tagdelete.tpl.php @@ -0,0 +1,25 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <form action="<?php echo $formaction; ?>" method="post"> + <p><?php echo T_('Are you sure?'); ?></p> + <p> + <input class="btn btn-default" type="submit" name="confirm" value="<?php echo T_('Yes'); ?>" /> + <input class="btn btn-default" type="submit" name="cancel" value="<?php echo T_('No'); ?>" /> + </p> + + <?php if (isset($referrer)): ?> + <div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> + <?php endif; ?> + + </form> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?>
\ No newline at end of file diff --git a/data/templates/minimal/tagedit.tpl.php b/data/templates/minimal/tagedit.tpl.php new file mode 100644 index 0000000..079b0d7 --- /dev/null +++ b/data/templates/minimal/tagedit.tpl.php @@ -0,0 +1,40 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> +<script type="text/javascript"> +window.onload = function() { + document.getElementById("description").focus(); +} +</script> + +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <form action="<?php echo $formaction; ?>" method="post"> + <table> + <tr> + <th align="left"><?php echo T_('Description'); ?></th> + <td><textarea class="form-control" name="description" cols="75" rows="10"><?php echo $description['tDescription']; ?></textarea></td> + </tr> + <tr> + <td></td> + <td> + <input class="btn btn-default" type="submit" name="confirm" value="<?php echo T_('Update'); ?>" /> + <input class="btn btn-default" type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" /> + </td> + <td></td> + </tr> + </table> + + <?php if (isset($referrer)): ?> + <div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> + <?php endif; ?> + <div><input type="hidden" name="tag" value="<?php echo $tag; ?>" /></div> + </form> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/tagrename.tpl.php b/data/templates/minimal/tagrename.tpl.php new file mode 100644 index 0000000..8a31088 --- /dev/null +++ b/data/templates/minimal/tagrename.tpl.php @@ -0,0 +1,46 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> +<script type="text/javascript"> +window.onload = function() { + document.getElementById("new").focus(); +} +</script> +<div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <form action="<?php echo $formaction; ?>" method="post"> + <table> + <tr> + <th align="left"><?php echo T_('Old'); ?></th> + <td><input class="form-control" type="text" name="old" id="old" value="<?php echo $old; ?>" /></td> + <td>← <?php echo T_('Required'); ?></td> + </tr> + <tr> + <th align="left"><?php echo T_('New'); ?></th> + <td><input class="form-control" type="text" name="new" id="new" value="" /></td> + <td>← <?php echo T_('Required'); ?></td> + </tr> + <tr> + <td></td> + <td> + <input class="btn btn-default" type="submit" name="confirm" value="<?php echo T_('Rename'); ?>" /> + <input class="btn btn-default" type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" /> + </td> + <td></td> + </tr> + + </table> + + <?php if (isset($referrer)): ?> + <div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div> + <?php endif; ?> + + </form> + </div> + </div> +</div> + +<?php +$this->includeTemplate($GLOBALS['bottom_include']); +?>
\ No newline at end of file diff --git a/data/templates/minimal/tags.tpl.php b/data/templates/minimal/tags.tpl.php new file mode 100644 index 0000000..9a650b1 --- /dev/null +++ b/data/templates/minimal/tags.tpl.php @@ -0,0 +1,40 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); +?> + +<?php +if ($tags && count($tags) > 0) { +?> +<div class="container-full"> + <div class="row"> + <div class="col-8 col-xs-12 col-sm-8 col-lg-8"> + <p id="sort"> + <?php echo T_("Sort by:"); ?> + <a href="?sort=alphabet_asc"><?php echo T_("Alphabet"); ?></a><span> / </span> + <a href="?sort=popularity_asc"><?php echo T_("Popularity"); ?></a> + </p> + <p class="tags"> + + <?php + $contents = ''; + foreach ($tags as $row) { + $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); + $contents .= '<a href="'. sprintf($cat_url, $user, filter($row['tag'], 'url')) .'" title="'. $row['bCount'] .' '. $entries .'" rel="tag" style="font-size:'. $row['size'] .'">'. filter($row['tag']) .'</a> '; + } + echo $contents ."\n"; + ?> + + </p> + </div> + <div class="col-4 col-xs-12 col-sm-4 col-lg-4"> + <?php + $this->includeTemplate('sidebar.tpl'); + ?> + </div> + </div> +</div> +<?php +} + +$this->includeTemplate($GLOBALS['bottom_include']); +?> diff --git a/data/templates/minimal/toolbar.inc.php b/data/templates/minimal/toolbar.inc.php new file mode 100644 index 0000000..0237553 --- /dev/null +++ b/data/templates/minimal/toolbar.inc.php @@ -0,0 +1,41 @@ +<?php +if ($userservice->isLoggedOn() && is_object($currentUser)) { + $cUserId = $userservice->getCurrentUserId(); + $cUsername = $currentUser->getUsername(); +?> + + <ul class="nav navbar-nav navigation"> + <li><a href="<?php echo createURL(''); ?>"><i class="fa fa-home"></i> <?php echo T_('All'); ?></a></li> + <li><a href="<?php echo createURL('bookmarks', $cUsername); ?>"><i class="fa fa-star"></i> <?php echo T_('Bookmarks'); ?></a></li> + <li><a href="<?php echo createURL('alltags', $cUsername); ?>"><i class="fa fa-tags"></i> <?php echo T_('Tags'); ?></a></li> + <li><a href="<?php echo createURL('watchlist', $cUsername); ?>"><i class="fa fa-users"></i> <?php echo T_('Watchlist'); ?></a></li> + <li><a href="<?php echo $userservice->getProfileUrl($cUserId, $cUsername); ?>"><i class="fa fa-user"></i> <?php echo T_('Profile'); ?></a></li> + <li><a href="<?php echo createURL('bookmarks', $cUsername . '?action=add'); ?>"><i class="fa fa-bookmark"></i> <?php echo T_('Add a Bookmark'); ?></a></li> + <li><a href="<?php echo createURL('about'); ?>"><i class="fa fa-info-circle"></i> <?php echo T_('About'); ?></a></li> + </ul> + <ul class="nav navbar-nav navbar-right navigation"> + <?php if($currentUser->isAdmin()): ?> + <li><a href="<?php echo createURL('admin', ''); ?>">[<i class="fa fa-gears"></i> <?php echo T_('Admin'); ?>]</a></li> + <?php endif; ?> + <li><a href="<?php echo $userservice->getProfileUrl($cUserId, $cUsername); ?>"><i class="fa fa-user"></i> <?php echo $cUsername?></a></li> + <li><a href="<?php echo ROOT ?>?action=logout">(<i class="fa fa-power-off"></i> <?php echo T_('Log Out'); ?>)</a></li> + </ul> + +<?php +} else { +?> + <ul class="nav navbar-nav navigation"> + <li><a href="<?php echo createURL(''); ?>"><i class="fa fa-home"></i> <?php echo T_('All'); ?></a></li> + <li><a href="<?php echo createURL('populartags'); ?>"><i class="fa fa-tags"></i> <?php echo T_('Tags'); ?></a></li> + <li><a href="<?php echo createURL('about'); ?>"><i class="fa fa-info-circle"></i> <?php echo T_('About'); ?></a></li> + </ul> + <ul class="nav navbar-nav navbar-right navigation"> + <li><a href="<?php echo createURL('login'); ?>"><i class="fa fa-user"></i> <?php echo T_('Log In'); ?></a></li> + <?php if ($GLOBALS['enableRegistration']) { ?> + <li><a href="<?php echo createURL('register'); ?>"><i class="fa fa-plus"></i> <?php echo T_('Register'); ?></a></li> + <?php } ?> + </ul> + +<?php +} +?> diff --git a/data/templates/minimal/top.inc.php b/data/templates/minimal/top.inc.php new file mode 100644 index 0000000..c95ee3a --- /dev/null +++ b/data/templates/minimal/top.inc.php @@ -0,0 +1,115 @@ +<!DOCTYPE html> +<html class="no-js"> +<head> + <meta charset="utf-8"/> + <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <title><?php echo filter($GLOBALS['sitename'] .(isset($pagetitle) ? ' » ' . $pagetitle : '')); ?></title> + <meta name="description" content=""/> + <meta name="viewport" content="width=device-width, initial-scale=1"/> + <link rel="icon" type="image/png" href="<?php echo $theme->resource('icon.png');?>"/> + <link rel="stylesheet" type="text/css" href="<?php echo $theme->resource('css/bootstrap.min.css');?>"/> + <link rel="stylesheet" type="text/css" href="<?php echo $theme->resource('css/font-awesome.min.css');?>"/> + <link rel="stylesheet" type="text/css" href="<?php echo $theme->resource('scuttle.css');?>"/> + <link rel="search" type="application/opensearchdescription" href="<?php echo ROOT ?>api/opensearch.php" title="<?php echo htmlspecialchars($GLOBALS['sitename']) ?>"/> + <?php + if (isset($rsschannels)) { + $size = count($rsschannels); + for ($i = 0; $i < $size; $i++) { + echo ' <link rel="alternate" type="application/rss" title="' . htmlspecialchars($rsschannels[$i][0]) . '"' . ' href="'. htmlspecialchars($rsschannels[$i][1]) .'" />' . "\n"; + } + } + ?> + + <script type="text/javascript" src="<?php echo ROOT ?>js/sscuttlizr/modernizr.min.js"></script> + <?php if (DEBUG_MODE) : ?> + <script type="text/javascript" src="<?php echo ROOT ?>js/sscuttlizr/jquery-1.11.0.js"></script> + <script type="text/javascript" src="<?php echo ROOT_JS ?>jquery.jstree.js"></script> + <script type="text/javascript" src="<?php echo ROOT ?>js/sscuttlizr/bootstrap.js"></script> + <?php else: ?> + <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> + <script> + window.jQuery || document.write('<script src="<?php echo ROOT ?>js/sscuttlizr/jquery-1.11.0.min.js"><\/script>') + </script> + <script type="text/javascript" src="<?php echo ROOT_JS ?>jquery.jstree.min.js"></script> + <script type="text/javascript" src="<?php echo ROOT ?>js/sscuttlizr/bootstrap.min.js"></script> + <?php endif ?> + <?php + if ( isset($bookmarks) && ! empty($bookmarks) && isset($GLOBALS['enableQrCodes']) && $GLOBALS['enableQrCodes'] == true ) { + ?> + <script type="text/javascript" src="<?php echo ROOT ?>js/sscuttlizr/jquery.qrcode.min.js"></script> + <?php + } + ?> + <script type="text/javascript" src="<?php echo ROOT ?>jsScuttle.php"></script> + +</head> +<body> + <!--[if lt IE 8]> + <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> + <![endif]--> + <div id="page"> + <?php + $headerstyle = ''; + if(isset($_GET['popup'])) { + $headerstyle = ' popup'; + } + ?> + <nav id="header" class="navbar navbar-default<?php echo $headerstyle; ?>" role="navigation"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#sscuttlizr-navbar"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="<?php echo ROOT ?>"><?php echo $GLOBALS['sitename']; ?></a> + </div> + <div class="collapse navbar-collapse" id="sscuttlizr-navbar"> + <?php + if(!isset($_GET['popup'])) { + $this->includeTemplate('toolbar.inc'); + } + ?> + </div> + </nav> + <div class="container-full"> + <div class="row" id="subtitle"> + <div class="col-4 col-xs-12 col-sm-4 col-lg-4"> + <?php + if (isset($subtitlehtml)) { + echo '<div class="container-full">' . $subtitlehtml . "</div>"; + } else if (isset($subtitle)) { + echo '<div class="container-full">' . htmlspecialchars($subtitle) . "</div>"; + } + ?> + </div> + <div class="col-4 col-xs-12 col-sm-4 col-lg-4"></div> + <div class="col-4 col-xs-12 col-sm-4 col-lg-4"> + <?php + if ( ! isset($_GET['popup']) && ($pageName == 'bookmarks' || $pageName == 'index') ) { + include('search.menu.php'); + } + ?> + </div> + </div> + </div> + <div class="container-full"> + <div class="row"> + <div class="col-12 col-xs-12 col-sm-12 col-lg-12"> + <?php + if(DEBUG_MODE) { + echo '<p class="error">'. T_('Admins, your installation is in "Debug Mode" ($debugMode = true). To go in "Normal Mode" and hide debugging messages, change $debugMode to false into config.php.') ."</p>\n"; + } + if (isset($error) && $error!='') { + echo '<p class="error">'. $error ."</p>\n"; + } + if (isset($msg) && $msg!='') { + echo '<p class="success">'. $msg ."</p>\n"; + } + if (isset($tipMsg) && $tipMsg!='') { + echo '<p class="tipMsg">'. $tipMsg ."</p>\n"; + } + ?> + </div> + </div> + </div> diff --git a/data/templates/minimal/users.tpl.php b/data/templates/minimal/users.tpl.php new file mode 100644 index 0000000..7df286a --- /dev/null +++ b/data/templates/minimal/users.tpl.php @@ -0,0 +1,42 @@ +<?php +$this->includeTemplate($GLOBALS['top_include']); + +if ($users && count($users) > 0) { +?> + +<div class="container-full"> + <div class="row"> + <div class="col-12 col-sm-12 col-xs-12 col-lg-12"> + + <!--p id="sort"> + <?php echo T_("Sort by:"); ?> + <a href="?sort=alphabet_asc"><?php echo T_("Alphabet"); ?></a><span> / </span> + <a href="?sort=popularity_asc"><?php echo T_("Popularity"); ?></a> + </p--> + + <p class="users"> + <ul> + <?php + $contents = '<'; + foreach ($users as $row) { + echo '<li><strong>' + . SemanticScuttle_Model_UserArray::getName($row) . '</strong>' + . ' (<a href="' . createURL('profile', $row['username']) . '">' + . T_('profile') . '</a> ' + . T_('created in') . ' ' + . date('M Y', strtotime($row['uDatetime'])) . ')' + . ' : <a href="' . createURL('bookmarks', $row['username']).'">' + . T_('bookmarks') . '</a></li>'; + } + ?> + </ul> + </p> + + </div> + </div> +</div> + +<?php +} +$this->includeTemplate($GLOBALS['bottom_include']); +?> |