├── cache
├── .cvsignore
└── .htaccess
├── tests
├── dox.html
├── FactoryTest.php
├── data
│ ├── BookmarkTest_deliciousbookmarks_private.xml
│ ├── BookmarkTest_deliciousbookmarks_longdesc_3469257.xml
│ ├── BookmarkTest_deliciousbookmarks.xml
│ └── BookmarkTest_netscapebookmarks.html
├── phpunit.xml
├── LAUNCH_TESTS
├── www
│ ├── importTest.php
│ ├── importNetscapeTest.php
│ ├── editTest.php
│ ├── indexTest.php
│ └── searchTest.php
├── prepare.php
├── UserArrayTest.php
├── Model
│ └── BookmarkTest.php
├── AllTests.php
└── Api
│ └── OpenSearchTest.php
├── data
├── schema
│ ├── 5.sql
│ ├── 4.sql
│ ├── 2.sql
│ ├── 6.sql
│ └── 1.sql
├── locales
│ ├── de_AT
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── de_DE
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── dk_DK
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── en_GB
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── es_ES
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── fr_CA
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── fr_FR
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── hi_IN
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── it_IT
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── ja_JP
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── lt_LT
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── nl_NL
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── pt_BR
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── ru_RU
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── tr_TR
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ ├── vn_VN
│ │ └── LC_MESSAGES
│ │ │ └── messages.mo
│ └── zh_CN
│ │ └── LC_MESSAGES
│ │ └── messages.mo
└── templates
│ └── default
│ ├── error.404.tpl.php
│ ├── error.500.tpl.php
│ ├── bookmarks-thumbnail.inc.tpl.php
│ ├── tagdelete.tpl.php
│ ├── sidebar.tpl.php
│ ├── sidebar.block.watchstatus.php
│ ├── sidebar.block.common.php
│ ├── tags.tpl.php
│ ├── users.tpl.php
│ ├── bottom.inc.php
│ ├── tagedit.tpl.php
│ ├── sidebar.block.users.php
│ ├── password.tpl.php
│ ├── tagrename.tpl.php
│ ├── admin.tpl.php
│ ├── sidebar.block.related.php
│ ├── sidebar.block.popular.php
│ ├── importStructure.tpl.php
│ ├── rss.tpl.php
│ ├── sidebar.block.recent.php
│ ├── login.tpl.php
│ ├── bookmarks-vote.inc.tpl.php
│ ├── tagcommondescriptionedit.tpl.php
│ ├── sidebar.block.tagactions.php
│ ├── sidebar.block.search.php
│ ├── tag2tagdelete.tpl.php
│ ├── bookmarks-vote-horizontal.inc.tpl.php
│ ├── importDelicious.tpl.php
│ ├── sidebar.block.menu2.php
│ ├── toolbar.inc.php
│ ├── bookmarkcommondescriptionedit.tpl.php
│ ├── tag2tagadd.tpl.php
│ ├── about.tpl.php
│ ├── sidebar.block.linked.php
│ ├── importNetscape.tpl.php
│ ├── editprofile-sslclientcerts.tpl.php
│ ├── profile.tpl.php
│ ├── search.menu.php
│ ├── register.tpl.php
│ ├── tag2tagedit.tpl.php
│ └── sidebar.block.watchlist.php
├── www
├── player
│ ├── load.swf
│ ├── play.swf
│ ├── stop.swf
│ ├── error.swf
│ ├── musicplayer_f6.swf
│ └── license.txt
├── themes
│ ├── default
│ │ ├── icon.png
│ │ └── images
│ │ │ ├── logo.png
│ │ │ ├── rss.gif
│ │ │ ├── b_edit.png
│ │ │ ├── bg_bar.png
│ │ │ ├── loading.gif
│ │ │ ├── logo_24.gif
│ │ │ ├── bg_admin.png
│ │ │ ├── bg_header.png
│ │ │ ├── vote-for.png
│ │ │ ├── bg_sidebar.png
│ │ │ ├── logo-empty.png
│ │ │ ├── vote-against.png
│ │ │ ├── thumbs_up.orig.png
│ │ │ ├── vote-for-voted.png
│ │ │ └── vote-against-voted.png
│ └── testdummy
│ │ ├── images
│ │ └── logo.png
│ │ └── scuttle.css
├── js
│ ├── jquery-ui-1.8.11
│ │ └── themes
│ │ │ └── base
│ │ │ ├── jquery.ui.base.css
│ │ │ ├── images
│ │ │ ├── ui-icons_222222_256x240.png
│ │ │ ├── ui-icons_2e83ff_256x240.png
│ │ │ ├── ui-icons_454545_256x240.png
│ │ │ ├── ui-icons_888888_256x240.png
│ │ │ ├── ui-icons_cd0a0a_256x240.png
│ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png
│ │ │ ├── ui-bg_flat_75_ffffff_40x100.png
│ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png
│ │ │ ├── ui-bg_glass_65_ffffff_1x400.png
│ │ │ ├── ui-bg_glass_75_dadada_1x400.png
│ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png
│ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png
│ │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png
│ │ │ ├── jquery.ui.all.css
│ │ │ ├── jquery.ui.autocomplete.css
│ │ │ └── jquery.ui.core.css
│ └── jstree-1.0-rc2
│ │ └── themes
│ │ ├── apple
│ │ ├── bg.jpg
│ │ ├── d.png
│ │ ├── throbber.gif
│ │ └── dot_for_ie.gif
│ │ ├── classic
│ │ ├── d.png
│ │ ├── throbber.gif
│ │ └── dot_for_ie.gif
│ │ ├── default
│ │ ├── d.gif
│ │ ├── d.png
│ │ └── throbber.gif
│ │ └── default-rtl
│ │ ├── d.gif
│ │ ├── d.png
│ │ ├── dots.gif
│ │ └── throbber.gif
├── ajaxVote.php
├── api
│ ├── tags_get.php
│ ├── tags_rename.php
│ ├── opensearch.php
│ ├── posts_delete.php
│ ├── posts_dates.php
│ ├── export_gcs.php
│ ├── posts_public.php
│ ├── posts_update.php
│ ├── posts_all.php
│ ├── httpauth.inc.php
│ └── export_csv.php
├── www-header.php
├── ajaxGetNewPrivateKey.php
├── .htaccess
├── about.php
├── go.php
├── ajax
│ ├── getadmintags.php
│ ├── getcontacttags.php
│ └── gettags.php
├── gsearch
│ └── context.php
├── ajaxGetTitle.php
├── ajaxIsAvailable.php
├── vote.php
├── ajaxDelete.php
├── users.php
├── watch.php
├── tag2tagedit.php
└── tagdelete.php
├── src
├── SemanticScuttle
│ ├── utf8.php
│ ├── header-standalone.php
│ ├── Model
│ │ ├── UserArray.php
│ │ ├── RemoteUser.php
│ │ └── Bookmark.php
│ ├── Environment.php
│ ├── DbService.php
│ ├── Thumbnailer
│ │ └── Null.php
│ ├── Service.php
│ ├── Service
│ │ ├── Thumbnails.php
│ │ └── Cache.php
│ └── UrlHelper.php
└── php-gettext
│ ├── examples
│ ├── locale
│ │ ├── de_CH
│ │ │ └── LC_MESSAGES
│ │ │ │ ├── messages.mo
│ │ │ │ └── messages.po
│ │ └── sr_CS
│ │ │ └── LC_MESSAGES
│ │ │ ├── messages.mo
│ │ │ └── messages.po
│ ├── update
│ └── index.php
│ ├── AUTHORS
│ ├── Makefile
│ └── tests
│ ├── ParsingTest.php
│ └── LocalesTest.php
├── .gitignore
├── html.properties
├── doc
├── developers
│ ├── doc-TODO.rst
│ ├── api.rst
│ ├── debugging.rst
│ ├── running-unit-tests.rst
│ ├── rules.rst
│ ├── release-new-version.rst
│ └── translation.rst
├── allinone.rst
├── AUTHORS
├── index.rst
├── tools.rst
├── themes.rst
└── README.rst
├── scripts
├── create-testuser.php
├── update-translation-base.php
├── compile-translation.php
├── update-translation.php
├── create-testbookmarks.php
├── database-dump.php
├── database-restore.php
└── fix-unfiled-tags.php
├── res
└── docs
│ └── header.tpl.html
└── .travis.yml
/cache/.cvsignore:
--------------------------------------------------------------------------------
1 | *.cache
--------------------------------------------------------------------------------
/tests/dox.html:
--------------------------------------------------------------------------------
1 |
TagsCache
--------------------------------------------------------------------------------
/cache/.htaccess:
--------------------------------------------------------------------------------
1 | order allow,deny
2 | deny from all
--------------------------------------------------------------------------------
/data/schema/5.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `sc_bookmarks` ADD `bShort` VARCHAR(16) NULL DEFAULT NULL;
2 |
--------------------------------------------------------------------------------
/www/player/load.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/player/load.swf
--------------------------------------------------------------------------------
/www/player/play.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/player/play.swf
--------------------------------------------------------------------------------
/www/player/stop.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/player/stop.swf
--------------------------------------------------------------------------------
/www/player/error.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/player/error.swf
--------------------------------------------------------------------------------
/www/themes/default/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/icon.png
--------------------------------------------------------------------------------
/src/SemanticScuttle/utf8.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/src/SemanticScuttle/utf8.php
--------------------------------------------------------------------------------
/www/player/musicplayer_f6.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/player/musicplayer_f6.swf
--------------------------------------------------------------------------------
/www/themes/default/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/logo.png
--------------------------------------------------------------------------------
/www/themes/default/images/rss.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/rss.gif
--------------------------------------------------------------------------------
/www/themes/default/images/b_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/b_edit.png
--------------------------------------------------------------------------------
/www/themes/default/images/bg_bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/bg_bar.png
--------------------------------------------------------------------------------
/www/themes/default/images/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/loading.gif
--------------------------------------------------------------------------------
/www/themes/default/images/logo_24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/logo_24.gif
--------------------------------------------------------------------------------
/www/themes/testdummy/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/testdummy/images/logo.png
--------------------------------------------------------------------------------
/www/themes/default/images/bg_admin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/bg_admin.png
--------------------------------------------------------------------------------
/www/themes/default/images/bg_header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/bg_header.png
--------------------------------------------------------------------------------
/www/themes/default/images/vote-for.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/vote-for.png
--------------------------------------------------------------------------------
/data/locales/de_AT/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/de_AT/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/de_DE/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/de_DE/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/dk_DK/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/dk_DK/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/en_GB/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/en_GB/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/es_ES/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/es_ES/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/fr_CA/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/fr_CA/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/fr_FR/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/fr_FR/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/hi_IN/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/hi_IN/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/it_IT/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/it_IT/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/ja_JP/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/ja_JP/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/lt_LT/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/lt_LT/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/nl_NL/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/nl_NL/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/pt_BR/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/pt_BR/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/ru_RU/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/ru_RU/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/tr_TR/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/tr_TR/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/vn_VN/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/vn_VN/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/data/locales/zh_CN/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/data/locales/zh_CN/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/jquery.ui.base.css:
--------------------------------------------------------------------------------
1 | @import url("jquery.ui.core.css");
2 | @import url("jquery.ui.autocomplete.css");
3 |
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/apple/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/apple/bg.jpg
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/apple/d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/apple/d.png
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/classic/d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/classic/d.png
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/default/d.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/default/d.gif
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/default/d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/default/d.png
--------------------------------------------------------------------------------
/www/themes/default/images/bg_sidebar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/bg_sidebar.png
--------------------------------------------------------------------------------
/www/themes/default/images/logo-empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/logo-empty.png
--------------------------------------------------------------------------------
/www/themes/default/images/vote-against.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/vote-against.png
--------------------------------------------------------------------------------
/www/themes/default/images/thumbs_up.orig.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/thumbs_up.orig.png
--------------------------------------------------------------------------------
/www/themes/default/images/vote-for-voted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/vote-for-voted.png
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/apple/throbber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/apple/throbber.gif
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/default-rtl/d.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/default-rtl/d.gif
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/default-rtl/d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/default-rtl/d.png
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/apple/dot_for_ie.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/apple/dot_for_ie.gif
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/classic/throbber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/classic/throbber.gif
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/default-rtl/dots.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/default-rtl/dots.gif
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/default/throbber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/default/throbber.gif
--------------------------------------------------------------------------------
/www/themes/default/images/vote-against-voted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/themes/default/images/vote-against-voted.png
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/classic/dot_for_ie.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/classic/dot_for_ie.gif
--------------------------------------------------------------------------------
/www/js/jstree-1.0-rc2/themes/default-rtl/throbber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jstree-1.0-rc2/themes/default-rtl/throbber.gif
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | doc/*.html
2 | dist/
3 | build.properties
4 | package.xml
5 | semanticscuttle-dump.sql
6 | data/config.php
7 | data/config.testing.php
8 | data/config.testing-tmp.php
9 |
--------------------------------------------------------------------------------
/src/php-gettext/examples/locale/de_CH/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/src/php-gettext/examples/locale/de_CH/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/src/php-gettext/examples/locale/sr_CS/LC_MESSAGES/messages.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/src/php-gettext/examples/locale/sr_CS/LC_MESSAGES/messages.mo
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-icons_222222_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-icons_222222_256x240.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-icons_2e83ff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-icons_2e83ff_256x240.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-icons_454545_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-icons_454545_256x240.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-icons_888888_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-icons_888888_256x240.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-icons_cd0a0a_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-icons_cd0a0a_256x240.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_flat_75_ffffff_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_flat_75_ffffff_40x100.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_glass_65_ffffff_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_glass_65_ffffff_1x400.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_glass_75_dadada_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_glass_75_dadada_1x400.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cweiske/SemanticScuttle/HEAD/www/js/jquery-ui-1.8.11/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png
--------------------------------------------------------------------------------
/src/php-gettext/AUTHORS:
--------------------------------------------------------------------------------
1 | Danilo Segan
2 | Nico Kaiser (contributed most changes between 1.0.2 and 1.0.3, bugfix for 1.0.5)
3 | Steven Armstrong (gettext.inc, leading to 1.0.6)
4 |
--------------------------------------------------------------------------------
/www/themes/testdummy/scuttle.css:
--------------------------------------------------------------------------------
1 | @import url(../default/scuttle.css);
2 |
3 | body {
4 | background-color: #FEA;
5 | }
6 |
7 | html > body h1 {
8 | background: url('images/logo.png') no-repeat 10px;
9 | }
10 | div#header {
11 | background: #FEA;
12 | }
13 |
--------------------------------------------------------------------------------
/tests/FactoryTest.php:
--------------------------------------------------------------------------------
1 | assertInstanceOf(
8 | 'sql_db',
9 | SemanticScuttle_Service_Factory::getDb()
10 | );
11 | }
12 | }
13 | ?>
--------------------------------------------------------------------------------
/html.properties:
--------------------------------------------------------------------------------
1 | html.sflogo =
2 |
--------------------------------------------------------------------------------
/doc/developers/doc-TODO.rst:
--------------------------------------------------------------------------------
1 | - Bookmarklets: Text selection is used as description
2 | - Tag nesting: Paris > France > World
3 | - Tag alias: Deutschland = Germany
4 |
5 |
6 | - Which fields are searched?
7 | title, description, private note, username, tags
8 |
9 | - What are [isbn] and so for?
10 |
--------------------------------------------------------------------------------
/tests/data/BookmarkTest_deliciousbookmarks_private.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/data/templates/default/error.404.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
4 | if (!$error) {
5 | echo ''. T_('Not Found') .' ';
6 | echo ''. T_('The requested URL was not found on this server') .'
';
7 | }
8 | $this->includeTemplate($GLOBALS['bottom_include']);
9 | ?>
--------------------------------------------------------------------------------
/data/templates/default/error.500.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
4 | if (!$error) {
5 | echo ''. T_('General server error') .' ';
6 | echo ''. T_('The requested URL could not be processed') .'
';
7 | }
8 | $this->includeTemplate($GLOBALS['bottom_include']);
9 | ?>
10 |
--------------------------------------------------------------------------------
/scripts/create-testuser.php:
--------------------------------------------------------------------------------
1 | addUser('test', 'test', 'test@example.org');
9 | $us->addUser('admin', 'admin', 'admin@example.org');
10 | ?>
--------------------------------------------------------------------------------
/www/js/jquery-ui-1.8.11/themes/base/jquery.ui.all.css:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI CSS Framework @VERSION
3 | *
4 | * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5 | * Dual licensed under the MIT or GPL Version 2 licenses.
6 | * http://jquery.org/license
7 | *
8 | * http://docs.jquery.com/UI/Theming
9 | */
10 | @import "jquery.ui.base.css";
11 | @import "jquery.ui.theme.css";
12 |
--------------------------------------------------------------------------------
/data/schema/4.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `sc_bookmarks` ADD `bVoting` INT NOT NULL;
2 | ALTER TABLE `sc_bookmarks` ADD `bVotes` INT NOT NULL;
3 |
4 | CREATE TABLE `sc_votes` (
5 | `bId` INT NOT NULL ,
6 | `uId` INT NOT NULL ,
7 | `vote` INT( 2 ) NOT NULL ,
8 | UNIQUE KEY `bid_2` (`bId`,`uId`),
9 | KEY `bid` (`bId`),
10 | KEY `uid` (`uId`)
11 | ) CHARACTER SET utf8 COLLATE utf8_general_ci ;
12 |
--------------------------------------------------------------------------------
/res/docs/header.tpl.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/src/php-gettext/examples/update:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | TEMPLATE=pigs.pot
3 | xgettext -kT_ngettext:1,2 -kT_ -L PHP -o $TEMPLATE pigs_dropin.php
4 | if [ "x$1" = "x-p" ]; then
5 | msgfmt --statistics $TEMPLATE
6 | else
7 | if [ -f $1.po ]; then
8 | msgmerge -o .tmp$1.po $1.po $TEMPLATE
9 | mv .tmp$1.po $1.po
10 | msgfmt --statistics $1.po
11 | else
12 | echo "Usage: $0 [-p|]"
13 | fi
14 | fi
15 |
--------------------------------------------------------------------------------
/doc/developers/api.rst:
--------------------------------------------------------------------------------
1 | SemanticScuttle API
2 | ===================
3 |
4 | SemanticScuttle tries to implement the delicious API v1 as closely as sensible.
5 |
6 | Where it makes sense and the delicious API just does things plainly wrong
7 | (i.e. when returning a wrong status code on an error), we do it better.
8 |
9 | - http://www.delicious.com/help/api
10 | - http://support.delicious.com/forum/comments.php?DiscussionID=5286&page=1
11 |
--------------------------------------------------------------------------------
/data/schema/2.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `sc_bookmarks` CHANGE `bDescription` `bDescription` VARCHAR( 1500 )
2 | CREATE TABLE `sc_tagscache` (
3 | `tcId` int(11) NOT NULL auto_increment,
4 | `tag1` varchar(100) NOT NULL default '',
5 | `tag2` varchar(100) NOT NULL default '',
6 | `relationType` varchar(32) NOT NULL default '',
7 | `uId` int(11) NOT NULL default '0',
8 | PRIMARY KEY (`tcId`),
9 | UNIQUE KEY `sc_tagscache_tag1_tag2_type_uId` (`tag1`,`tag2`,`relationType`,`uId`)
10 | );
11 |
--------------------------------------------------------------------------------
/scripts/update-translation-base.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | ../src/SemanticScuttle/
8 | ../data/templates/
9 | ../www/
10 |
11 | ../src/SemanticScuttle/db/
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/doc/developers/debugging.rst:
--------------------------------------------------------------------------------
1 | How to debug SemanticScuttle
2 | ============================
3 |
4 |
5 | Database queries
6 | ----------------
7 |
8 | In ``data/config.php``, enable ``debugMode``.
9 | Further, add the following afterwards: ::
10 |
11 | register_shutdown_function(
12 | create_function('', <<sql_report('display');
15 | FNC
16 | )
17 | );
18 |
19 |
20 | To see database queries in SemanticScuttle, add ::
21 |
22 | ?explain=1
23 |
24 | to your URL.
25 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 | phps:
3 | - 5.3
4 | script: cd tests && phpunit .
5 | notifications:
6 | irc: "irc.freenode.org#semanticscuttle"
7 |
8 | before_script:
9 | - mysql -e 'create database semanticscuttle_test;'
10 | - mysql semanticscuttle_test < data/tables.sql
11 | - cat data/config.php.dist | sed "s/'username'/'root'/" | sed "s/'password'/''/" | sed "s/'scuttle'/'semanticscuttle_test'/" | sed "s/'mysql4'/'mysqli'/" > data/config.php
12 | - pyrus install pear/HTTP_Request2
13 | - pyrus install pear/PEAR
14 | - pyrus install pear/Stream_Var
15 | - phpenv rehash
16 |
--------------------------------------------------------------------------------
/scripts/compile-translation.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/scripts/update-translation.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/SemanticScuttle/header-standalone.php:
--------------------------------------------------------------------------------
1 |
13 | * @license GPL http://www.gnu.org/licenses/gpl.html
14 | * @link http://sourceforge.net/projects/semanticscuttle
15 | */
16 | $_SERVER['HTTP_HOST'] = 'http://localhost/';
17 |
18 | require_once dirname(__FILE__) . '/header.php';
19 | ?>
--------------------------------------------------------------------------------
/data/templates/default/bookmarks-thumbnail.inc.tpl.php:
--------------------------------------------------------------------------------
1 | getThumbnailer();
10 | $imgUrl = $thumbnailer->getThumbnailUrl($address, 120, 90);
11 | if ($imgUrl !== false) {
12 | echo ''
13 | . ' '
16 | . ' ';
17 | }
18 | ?>
--------------------------------------------------------------------------------
/data/templates/default/tagdelete.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
3 | ?>
4 |
5 |
17 |
18 | includeTemplate($GLOBALS['bottom_include']);
20 | ?>
--------------------------------------------------------------------------------
/data/templates/default/sidebar.tpl.php:
--------------------------------------------------------------------------------
1 | isAdmin($userid)
3 | ): ?>
4 | ';
50 | ?>
--------------------------------------------------------------------------------
/src/SemanticScuttle/Model/Bookmark.php:
--------------------------------------------------------------------------------
1 |
10 | * @license GPL http://www.gnu.org/licenses/gpl.html
11 | * @link http://sourceforge.net/projects/semanticscuttle
12 | */
13 |
14 | /**
15 | * Bookmark model class, keeping the data of a single bookmark.
16 | * It will slowly replace the old array style format.
17 | *
18 | * @category Bookmarking
19 | * @package SemanticScuttle
20 | * @author Christian Weiske
21 | * @license GPL http://www.gnu.org/licenses/gpl.html
22 | * @link http://sourceforge.net/projects/semanticscuttle
23 | */
24 | class SemanticScuttle_Model_Bookmark
25 | {
26 | /**
27 | * Status "public" / visible for all
28 | */
29 | const SPUBLIC = 0;
30 |
31 | /**
32 | * Status "shared" / visible for people on your watchlist
33 | */
34 | const SWATCHLIST = 1;
35 |
36 | /**
37 | * Status "private" / visible for yourself only
38 | */
39 | const SPRIVATE = 2;
40 |
41 |
42 |
43 | /**
44 | * Checks if the given URL is valid and may be used with this
45 | * SemanticScuttle installation.
46 | *
47 | * @param string $url URL to verify.
48 | *
49 | * @return boolean True if the URL is allowed, false if not
50 | */
51 | public static function isValidUrl($url)
52 | {
53 | $scheme = parse_url($url, PHP_URL_SCHEME);
54 | if (array_search($scheme, $GLOBALS['allowedProtocols']) === false) {
55 | return false;
56 | }
57 | return true;
58 | }
59 |
60 | }
61 |
62 |
63 | ?>
--------------------------------------------------------------------------------
/www/ajaxIsAvailable.php:
--------------------------------------------------------------------------------
1 | isReserved(GET_USERNAME)) {
36 | $result = 'false';
37 | } else {
38 | $result = $userservice->getUserByUsername(GET_USERNAME) ? 'false' : 'true';
39 | }
40 | ?>
41 |
42 | isAvailable
43 |
44 |
--------------------------------------------------------------------------------
/data/templates/default/importDelicious.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
3 | ?>
4 |
5 |
30 |
31 |
32 |
33 | export page at del.icio.us'); ?>.
34 | XML file to your computer'); ?>.
35 | Browse... to find this file on your computer. The maximum size the file can be is 1MB'); ?>.
36 | .
37 | Import to start importing the bookmarks; it may take a minute'); ?>.
38 |
39 |
40 | includeTemplate($GLOBALS['bottom_include']);
42 | ?>
--------------------------------------------------------------------------------
/src/SemanticScuttle/Service.php:
--------------------------------------------------------------------------------
1 |
10 | * @author Christian Weiske
11 | * @author Eric Dane
12 | * @license GPL http://www.gnu.org/licenses/gpl.html
13 | * @link http://sourceforge.net/projects/semanticscuttle
14 | */
15 |
16 | /**
17 | * SemanticScuttle base service class.
18 | *
19 | * @category Bookmarking
20 | * @package SemanticScuttle
21 | * @author Benjamin Huynh-Kim-Bang
22 | * @author Christian Weiske
23 | * @author Eric Dane
24 | * @license GPL http://www.gnu.org/licenses/gpl.html
25 | * @link http://sourceforge.net/projects/semanticscuttle
26 | */
27 | class SemanticScuttle_Service
28 | {
29 | /**
30 | * SQL database object
31 | *
32 | * @var sql_db
33 | */
34 | protected $db;
35 |
36 |
37 |
38 | /**
39 | * Returns the single service instance
40 | *
41 | * @internal
42 | * This function can be used once PHP 5.3 is minimum, because only
43 | * 5.3 supports late static binding. For all lower php versions,
44 | * we still need a copy of this method in each service class.
45 | *
46 | * @param DB $db Database object
47 | *
48 | * @return SemanticScuttle_Service
49 | */
50 | public static function getInstance($db)
51 | {
52 | static $instance;
53 | if (!isset($instance)) {
54 | $instance = new static($db);
55 | }
56 | return $instance;
57 | }
58 |
59 | }
60 | ?>
--------------------------------------------------------------------------------
/doc/themes.rst:
--------------------------------------------------------------------------------
1 | ======================
2 | SemanticScuttle Themes
3 | ======================
4 | SemanticScuttle may be changed visually by supplying custom "themes" (skins)
5 | that modify the visual appearance.
6 |
7 |
8 | Changing the current theme
9 | ==========================
10 | In ``data/config.php``, set your theme like this: ::
11 |
12 | $theme = 'darkmood';
13 |
14 | The available themes are the folders in ``www/themes/``.
15 | By default, SemanticScuttle ships only one usable theme ("default") and one
16 | to demonstrate how to create your own theme ("testdummy").
17 |
18 |
19 | Creating your own theme
20 | =======================
21 | Have a look at the "testdummy" theme in ``www/themes/testdummy/``.
22 |
23 | CSS and image files
24 | -------------------
25 | Since both file types need to be accessible via the web server directly,
26 | they are located in the ``www/`` folder: ::
27 |
28 | www/themes/$themename/
29 |
30 | The main CSS file that automatically gets included is ::
31 |
32 | www/themes/$themename/scuttle.css
33 |
34 | Several template files in SemanticScuttle include image files. If they do not
35 | exist in your theme, the default ones are used automatically.
36 | Note that this is not true for images that are specified in the CSS files.
37 |
38 |
39 | Template files
40 | --------------
41 | The templates of the default file are located in ::
42 |
43 | data/templates/default/
44 |
45 | You may put your theme template files into ::
46 |
47 | data/templates/$themename/
48 |
49 |
50 | Existing themes
51 | ===============
52 |
53 | * `Flat`__ by Roman Lehnhof. See the `introduction blog post`__
54 | * `sscuttlizr`__
55 |
56 | __ https://github.com/rlehnhof/flat
57 | __ http://lehnhof.net/2013/08/semantic-scuttle-new-flat-interface-theme-template/
58 | __ https://github.com/jonrandoem/sscuttlizr
59 |
--------------------------------------------------------------------------------
/tests/UserArrayTest.php:
--------------------------------------------------------------------------------
1 |
10 | * @license GPL http://www.gnu.org/licenses/gpl.html
11 | * @link http://sourceforge.net/projects/semanticscuttle
12 | */
13 |
14 | /**
15 | * Unit tests for the SemanticScuttle user array model.
16 | *
17 | * @category Bookmarking
18 | * @package SemanticScuttle
19 | * @author Christian Weiske
20 | * @license GPL http://www.gnu.org/licenses/gpl.html
21 | * @link http://sourceforge.net/projects/semanticscuttle
22 | */
23 | class UserArrayTest extends PHPUnit_Framework_TestCase
24 | {
25 |
26 | public function testGetNameLongName()
27 | {
28 | $this->assertEquals(
29 | 'John Doe',
30 | SemanticScuttle_Model_UserArray::getName(
31 | array(
32 | 'name' => 'John Doe',
33 | 'username' => 'jdoe'
34 | )
35 | )
36 | );
37 | }
38 |
39 | public function testGetNameUsernameIfNameIsEmpty()
40 | {
41 | $this->assertEquals(
42 | 'jdoe',
43 | SemanticScuttle_Model_UserArray::getName(
44 | array(
45 | 'name' => '',
46 | 'username' => 'jdoe'
47 | )
48 | )
49 | );
50 | }
51 |
52 | public function testGetNameUsernameIfNameIsNotSet()
53 | {
54 | $this->assertEquals(
55 | 'jdoe',
56 | SemanticScuttle_Model_UserArray::getName(
57 | array(
58 | 'username' => 'jdoe'
59 | )
60 | )
61 | );
62 | }
63 |
64 | }
65 |
66 | ?>
--------------------------------------------------------------------------------
/www/vote.php:
--------------------------------------------------------------------------------
1 | isLoggedOn()) {
23 | header('HTTP/1.0 400 Bad Request');
24 | echo 'You need to be logged on to vote.';
25 | exit(1);
26 | }
27 | $user = $us->getCurrentUser();
28 | $user = $user['uId'];
29 |
30 | if (!isset($_SERVER['PATH_INFO'])) {
31 | //we got a problem
32 | header('HTTP/1.0 500 Internal Server Error');
33 | echo 'PATH_INFO not found';
34 | exit(2);
35 | }
36 |
37 | //we should really use net_url_mapper here
38 | list($url, $type, $bookmark) = explode('/', $_SERVER['PATH_INFO']);
39 |
40 | if ($type != 'for' && $type != 'against') {
41 | header('HTTP/1.0 400 Bad Request');
42 | echo 'type has to be "for" or "against"';
43 | exit(3);
44 | }
45 | if (!is_numeric($bookmark)) {
46 | header('HTTP/1.0 400 Bad Request');
47 | echo 'Bookmark must be numeric';
48 | exit(4);
49 | }
50 | $bookmark = (int)$bookmark;
51 |
52 | if (!isset($GLOBALS['lastUrl']) || $GLOBALS['lastUrl'] == '') {
53 | header('HTTP/1.0 412 Precondition failed');
54 | echo 'Missing last URL in session';
55 | exit(5);
56 | }
57 | $from = $GLOBALS['lastUrl'];
58 |
59 |
60 | $vs->vote($bookmark, $user, $type == 'for' ? 1 : -1);
61 |
62 | if (isset($GLOBALS['ajaxRequest']) && $GLOBALS['ajaxRequest']) {
63 | //we are in ajax mode and return the badge in ajaxVote.php
64 | return;
65 | }
66 |
67 | header('Location: ' . $from);
68 | ?>
--------------------------------------------------------------------------------
/src/SemanticScuttle/Service/Thumbnails.php:
--------------------------------------------------------------------------------
1 |
10 | * @license GPL http://www.gnu.org/licenses/gpl.html
11 | * @link http://sourceforge.net/projects/semanticscuttle
12 | */
13 |
14 | /**
15 | * Instantiates the configured website thumbnailer object.
16 | *
17 | * @category Bookmarking
18 | * @package SemanticScuttle
19 | * @author Christian Weiske
20 | * @license GPL http://www.gnu.org/licenses/gpl.html
21 | * @link http://sourceforge.net/projects/semanticscuttle
22 | */
23 | class SemanticScuttle_Service_Thumbnails extends SemanticScuttle_Service
24 | {
25 | /**
26 | * Instantiates the configured website thumbnailer object.
27 | *
28 | * @return object Website thumbnailer
29 | */
30 | public function getThumbnailer()
31 | {
32 | if (!isset($GLOBALS['thumbnailsType'])
33 | || $GLOBALS['thumbnailsType'] == ''
34 | ) {
35 | $class = 'SemanticScuttle_Thumbnailer_Null';
36 | } else {
37 | $class = 'SemanticScuttle_Thumbnailer_'
38 | . ucfirst($GLOBALS['thumbnailsType']);
39 | }
40 | if (!class_exists($class)) {
41 | //PEAR classname to filename rule
42 | $file = str_replace('_', '/', $class) . '.php';
43 | include_once $file;
44 | }
45 |
46 | $thumbnailer = new $class();
47 |
48 | if (!isset($GLOBALS['thumbnailsConfig'])
49 | || $GLOBALS['thumbnailsConfig'] == ''
50 | ) {
51 | $thumbnailer->setConfig(null);
52 | } else {
53 | $thumbnailer->setConfig($GLOBALS['thumbnailsConfig']);
54 | }
55 |
56 | return $thumbnailer;
57 | }
58 | }
59 | ?>
60 |
--------------------------------------------------------------------------------
/www/ajaxDelete.php:
--------------------------------------------------------------------------------
1 | editAllowed($bookmark)) {
37 | $result = T_('You are not allowed to delete this bookmark');
38 | } elseif ($bookmarkservice->deleteBookmark($bookmark)) {
39 | $result = 'true';
40 | } else {
41 | $result = T_('Failed to delete bookmark');
42 | }
43 |
44 | ?>
45 |
46 | deleteConfirmed
47 |
48 |
--------------------------------------------------------------------------------
/data/templates/default/sidebar.block.menu2.php:
--------------------------------------------------------------------------------
1 | getCurrentUserId();
10 | if ($logged_on_userid === false) {
11 | $logged_on_userid = NULL;
12 | }
13 |
14 |
15 | $cat_url = createURL('tags', '%s');
16 | $menu2Tags = $GLOBALS['menu2Tags'];
17 |
18 | if (count($menu2Tags) > 0) {
19 | ?>
20 |
21 |
22 |
23 |
24 | >
26 |
27 | '
32 | . sprintf(
33 | '%s ',
34 | sprintf($cat_url, $menu2Tag),
35 | $menu2Tag
36 | )
37 | . '' . "\n";
38 | }
39 | ?>
40 |
41 |
42 |
69 |
72 |
--------------------------------------------------------------------------------
/tests/Model/BookmarkTest.php:
--------------------------------------------------------------------------------
1 |
10 | * @license GPL http://www.gnu.org/licenses/gpl.html
11 | * @link http://sourceforge.net/projects/semanticscuttle
12 | */
13 |
14 | /**
15 | * Unit tests for the SemanticScuttle Bookmark model
16 | *
17 | * @category Bookmarking
18 | * @package SemanticScuttle
19 | * @author Christian Weiske
20 | * @license GPL http://www.gnu.org/licenses/gpl.html
21 | * @link http://sourceforge.net/projects/semanticscuttle
22 | */
23 | class Model_BookmarkTest extends TestBase
24 | {
25 | public function testIsValidUrlValid()
26 | {
27 | $this->assertTrue(
28 | SemanticScuttle_Model_Bookmark::isValidUrl(
29 | 'http://example.org/foo/bar?baz=foorina'
30 | )
31 | );
32 | $this->assertTrue(
33 | SemanticScuttle_Model_Bookmark::isValidUrl(
34 | 'https://example.org/'
35 | )
36 | );
37 | $this->assertTrue(
38 | SemanticScuttle_Model_Bookmark::isValidUrl(
39 | 'ftp://user:pass@example.org/'
40 | )
41 | );
42 | $this->assertTrue(
43 | SemanticScuttle_Model_Bookmark::isValidUrl(
44 | 'mailto:cweiske@example.org'
45 | )
46 | );
47 | }
48 |
49 | public function testIsValidUrlInvalid()
50 | {
51 | $this->assertFalse(
52 | SemanticScuttle_Model_Bookmark::isValidUrl(
53 | 'javascript:alert("foo")'
54 | )
55 | );
56 | $this->assertFalse(
57 | SemanticScuttle_Model_Bookmark::isValidUrl(
58 | 'foo://example.org/foo/bar'
59 | )
60 | );
61 | }
62 |
63 | }
64 |
65 | ?>
--------------------------------------------------------------------------------
/www/api/posts_delete.php:
--------------------------------------------------------------------------------
1 |
18 | * @author Christian Weiske
19 | * @author Eric Dane
20 | * @license GPL http://www.gnu.org/licenses/gpl.html
21 | * @link http://sourceforge.net/projects/semanticscuttle
22 | * @link http://www.delicious.com/help/api
23 | */
24 |
25 | // Force HTTP authentication first!
26 | $httpContentType = 'text/xml';
27 | require_once 'httpauth.inc.php';
28 |
29 | $bs = SemanticScuttle_Service_Factory::get('Bookmark');
30 | $uId = $userservice->getCurrentUserId();
31 |
32 |
33 | // Error out if there's no address
34 | if (!isset($_REQUEST['url'])
35 | || $_REQUEST['url'] == ''
36 | ) {
37 | $msg = 'something went wrong';
38 | } else if (!$bs->bookmarkExists($_REQUEST['url'], $uId)) {
39 | //the user does not have such a bookmark
40 | header('HTTP/1.0 404 Not Found');
41 | $msg = 'item not found';
42 | } else {
43 | $bookmark = $bs->getBookmarkByAddress($_REQUEST['url'], false);
44 | $bId = $bookmark['bId'];
45 | $deleted = $bs->deleteBookmark($bId);
46 | $msg = 'done';
47 | if (!$deleted) {
48 | //something really went wrong
49 | header('HTTP/1.0 500 Internal Server Error');
50 | $msg = 'something really went wrong';
51 | }
52 | }
53 |
54 | // Set up the XML file and output the result.
55 | echo '\r\n";
56 | echo ' ';
57 | ?>
--------------------------------------------------------------------------------
/tests/www/editTest.php:
--------------------------------------------------------------------------------
1 | setUnittestConfig(
16 | array('defaults' => array('privacy' => 2))
17 | );
18 |
19 | list($req, $uId) = $this->getLoggedInRequest('?unittestMode=1');
20 | $cookies = $req->getCookieJar();
21 | $req->setMethod(HTTP_Request2::METHOD_POST);
22 | $req->addPostParameter('url', 'http://www.example.org/testdefaultprivacyposts_edit');
23 | $req->addPostParameter('description', 'Test bookmark 2 for default privacy.');
24 | $req->addPostParameter('status', '0');
25 | $res = $req->send();
26 | $this->assertEquals(
27 | 200, $res->getStatus(),
28 | 'Adding bookmark failed: ' . $res->getBody());
29 | $bms = $this->bs->getBookmarks(0, null, $uId);
30 | $bm = reset($bms['bookmarks']);
31 | $bmId = $bm['bId'];
32 |
33 | $reqUrl = $GLOBALS['unittestUrl'] . 'edit.php/' . $bmId . '?unittestMode=1';
34 | $req2 = new HTTP_Request2($reqUrl, HTTP_Request2::METHOD_POST);
35 | $req2->setCookieJar($cookies);
36 | $req2->addPostParameter('address', 'http://www.example.org/testdefaultprivacyposts_edit');
37 | $req2->addPostParameter('title', 'Test bookmark 2 for default privacy.');
38 | $req2->addPostParameter('submitted', '1');
39 | $res = $req2->send();
40 |
41 | $this->assertEquals(302, $res->getStatus(), 'Editing bookmark failed');
42 |
43 | $bm = $this->bs->getBookmark($bmId);
44 | $this->assertEquals('2', $bm['bStatus']);
45 | }//end testDefaultPrivacyEdit
46 |
47 | }//end class www_editTest
48 | ?>
49 |
--------------------------------------------------------------------------------
/data/templates/default/toolbar.inc.php:
--------------------------------------------------------------------------------
1 | isLoggedOn() && is_object($currentUser)) {
3 | $cUserId = $userservice->getCurrentUserId();
4 | $cUsername = $currentUser->getUsername();
5 | ?>
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | ()
15 |
16 | isAdmin()): ?>
17 |
18 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 |
--------------------------------------------------------------------------------
/data/templates/default/bookmarkcommondescriptionedit.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
4 |
5 | list ($url, $hash) = explode('/', $_SERVER['PATH_INFO']);
6 |
7 |
8 | ?>
9 |
14 |
15 |
55 |
56 | includeTemplate($GLOBALS['bottom_include']);
58 | ?>
59 |
--------------------------------------------------------------------------------
/www/api/posts_dates.php:
--------------------------------------------------------------------------------
1 |
13 | * @author Christian Weiske
14 | * @author Eric Dane
15 | * @license GPL http://www.gnu.org/licenses/gpl.html
16 | * @link http://sourceforge.net/projects/semanticscuttle
17 | */
18 |
19 | // Force HTTP authentication first!
20 | $httpContentType = 'text/xml';
21 | require_once 'httpauth.inc.php';
22 |
23 | /* Service creation: only useful services are created */
24 | $bookmarkservice = SemanticScuttle_Service_Factory::get('Bookmark');
25 |
26 |
27 | // Check to see if a tag was specified.
28 | if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != '')) {
29 | $tag = trim($_REQUEST['tag']);
30 | } else {
31 | $tag = null;
32 | }
33 |
34 | // Get the posts relevant to the passed-in variables.
35 | $bookmarks = $bookmarkservice->getBookmarks(
36 | 0, null, $userservice->getCurrentUserId(), $tag
37 | );
38 |
39 | // Set up the XML file and output all the tags.
40 | echo '\r\n";
41 | echo '\r\n";
42 |
43 | $lastdate = null;
44 | $count = 0;
45 | foreach ($bookmarks['bookmarks'] as $row) {
46 | $thisdate = gmdate('Y-m-d', strtotime($row['bDatetime']));
47 | if ($thisdate != $lastdate && $lastdate != null) {
48 | echo "\t \r\n";
49 | $count = 1;
50 | } else {
51 | ++$count;
52 | }
53 | $lastdate = $thisdate;
54 | }
55 | if ($lastdate !== null) {
56 | echo "\t \r\n";
57 | }
58 |
59 | echo " ";
60 | ?>
--------------------------------------------------------------------------------
/data/templates/default/tag2tagadd.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
3 | ?>
4 |
5 |
6 |
7 |
8 |
9 | " to include one tag in another. e.g.: europe>france>paris')?>
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | countries) display the tag into the menu box'), $GLOBALS['menuTag'], $GLOBALS['menuTag'])?>
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | 0) {
35 | echo T_("Existing links:");
36 | foreach($links as $link) {
37 | echo '';
38 | if($link['tag1'] == $tag1 || $link['tag1'] == $tag2) {
39 | $textTag1 = ''.$tag1.' ';
40 | } else {
41 | $textTag1 = $link['tag1'];
42 | }
43 | if($link['tag2'] == $tag1 || $link['tag2'] == $tag2) {
44 | $textTag2 = ''.$tag2.' ';
45 | } else {
46 | $textTag2 = $link['tag2'];
47 | }
48 |
49 | echo $textTag1.' '.$link['relationType'].' '.$textTag2;
50 | echo " ";
51 | }
52 | } else {
53 | echo T_('No links');
54 | }
55 |
56 | $this->includeTemplate($GLOBALS['bottom_include']);
57 | ?>
58 |
--------------------------------------------------------------------------------
/www/api/export_gcs.php:
--------------------------------------------------------------------------------
1 | isAdmin($userservice->getCurrentUserId())) {
23 | die(T_('You are not allowed to do this action (admin access)'));
24 | }*/
25 |
26 | // Check if queried format is xml
27 | if (isset($_REQUEST['xml']) && (trim($_REQUEST['xml']) == 1))
28 | $xml = true;
29 | else
30 | $xml = false;
31 |
32 | // Check to see if a tag was specified.
33 | if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
34 | $tag = trim($_REQUEST['tag']);
35 | else
36 | $tag = NULL;
37 |
38 | // Get the posts relevant to the passed-in variables.
39 | $bookmarks = $bookmarkservice->getBookmarks(0, NULL, NULL, $tag, NULL, getSortOrder());
40 |
41 |
42 | // Set up the plain file and output all the posts.
43 | header('Content-Type: text/plain; charset=utf-8');
44 | if(!$xml) {
45 | header('Content-Type: text/plain');
46 | foreach($bookmarks['bookmarks'] as $row) {
47 | if(checkUrl($row['bAddress'], false)) {
48 | echo $row['bAddress']."\n";
49 | }
50 | }
51 | } else {
52 | header('Content-Type: text/xml');
53 | echo ''."\n";
54 | echo ' '."\n";
55 | foreach($bookmarks['bookmarks'] as $row) {
56 | //if(substr($row['bAddress'], 0, 7) == "http://") {
57 | if(checkUrl($row['bAddress'], false)) {
58 | echo ' '."\n";
59 | echo ' '."\n";
60 | echo ' '."\n";
61 | }
62 | }
63 | echo ' '."\n";
64 | echo ' '."\n";
65 | }
66 |
67 | ?>
68 |
--------------------------------------------------------------------------------
/src/SemanticScuttle/UrlHelper.php:
--------------------------------------------------------------------------------
1 |
10 | * @license GPL http://www.gnu.org/licenses/gpl.html
11 | * @link http://sourceforge.net/projects/semanticscuttle
12 | */
13 |
14 | /**
15 | * Work with URLs
16 | *
17 | * @category Bookmarking
18 | * @package SemanticScuttle
19 | * @author Christian Weiske
20 | * @license GPL http://www.gnu.org/licenses/gpl.html
21 | * @link http://sourceforge.net/projects/semanticscuttle
22 | */
23 | class SemanticScuttle_UrlHelper
24 | {
25 | function getTitle($url)
26 | {
27 | $fd = @fopen($url, 'r');
28 | $title = '';
29 | if ($fd) {
30 | $html = fread($fd, 1750);
31 | fclose($fd);
32 |
33 | // Get title from title tag
34 | preg_match_all('/]*>(.*)<\/title>/si', $html, $matches);
35 | $title = $matches[1][0];
36 |
37 | $encoding = 'utf-8';
38 | // Get encoding from charset attribute
39 | preg_match_all('//i', $html, $matches);
40 | if (isset($matches[1][0])) {
41 | $encoding = strtoupper($matches[1][0]);
42 | }
43 |
44 | // Convert to UTF-8 from the original encoding
45 | if (function_exists("mb_convert_encoding")) {
46 | $title = @mb_convert_encoding($title, 'UTF-8', $encoding);
47 | }
48 |
49 | $title = trim($title);
50 | }
51 |
52 | if (utf8_strlen($title) > 0) {
53 | $title = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
54 | return $title;
55 | } else {
56 | // No title, so return filename
57 | $uriparts = explode('/', $url);
58 | $filename = end($uriparts);
59 | unset($uriparts);
60 |
61 | return $filename;
62 | }
63 | }
64 | }
65 | ?>
66 |
--------------------------------------------------------------------------------
/www/api/posts_public.php:
--------------------------------------------------------------------------------
1 | getBookmarks(0, NULL, NULL, $tag);
27 |
28 | // Set up the XML file and output all the posts.
29 | echo '\r\n";
30 | echo '\r\n";
31 |
32 | foreach($bookmarks['bookmarks'] as $row) {
33 | if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))
34 | $description = '';
35 | else
36 | $description = 'extended="'. filter($row['bDescription'], 'xml') .'" ';
37 |
38 | $taglist = '';
39 | if (count($row['tags']) > 0) {
40 | foreach($row['tags'] as $tag)
41 | $taglist .= convertTag($tag) .' ';
42 | $taglist = substr($taglist, 0, -1);
43 | } else {
44 | $taglist = 'system:unfiled';
45 | }
46 |
47 | echo "\t \r\n";
48 | }
49 |
50 | echo ' ';
51 | ?>
52 |
--------------------------------------------------------------------------------
/doc/README.rst:
--------------------------------------------------------------------------------
1 | ======================
2 | SemanticScuttle 0.98.5
3 | ======================
4 | A social bookmarking tool experimenting with new features
5 | like structured tags or collaborative descriptions of tags.
6 |
7 | - Home page: http://semanticscuttle.sourceforge.net/
8 | - Project page: https://sourceforge.net/projects/semanticscuttle/
9 | - Demo: http://semanticscuttle.sourceforge.net/demo/
10 |
11 | Available under the GNU General Public License
12 |
13 |
14 | Installation
15 | ============
16 | See `INSTALL.rst`__
17 |
18 |
19 | __ INSTALL.html
20 |
21 |
22 | Upgrading from a previous version
23 | =================================
24 | See `UPGRADE.txt`__
25 |
26 | __ UPGRADE.html
27 |
28 |
29 | Public API
30 | ==========
31 | SemanticScuttle supports most of the `del.icio.us API`__.
32 | Almost all of the neat tools made for that system can be modified
33 | to work with your SemanticScuttle installation. If you find a tool
34 | that won't let you change the API address, ask the creator to add
35 | this setting. You never know, they might just do it.
36 |
37 | __ http://del.icio.us/doc/api
38 |
39 |
40 |
41 | Links
42 | -----
43 | - `further documentation`__
44 | - `support and help questions`__
45 | - `development mailing list instructions`__
46 | - `suggestions`_ for SemanticScuttle
47 | - `bug reports`_
48 | - `feature requests`_
49 |
50 | __ http://semanticscuttle.wiki.sourceforge.net/
51 | __ http://sourceforge.net/forum/forum.php?forum_id=759510
52 | __ https://sourceforge.net/mailarchive/forum.php?forum_name=semanticscuttle-devel
53 | .. _suggestions: http://sourceforge.net/forum/forum.php?forum_id=759511
54 | .. _bug reports: http://sourceforge.net/tracker/?group_id=211356&atid=1017430
55 | .. _feature requests: https://sourceforge.net/tracker/?group_id=211356&atid=1017433
56 |
57 |
58 |
59 |
60 | Known issues
61 | ============
62 |
63 | Number of bookmarks always 0: "0 bookmark(s)"
64 | ---------------------------------------------
65 | This issue occurs when debug mode is enabled.
66 | Technically, this is because the database layers ``DEBUG_EXTRA`` gets
67 | enabled through debug mode.
68 |
--------------------------------------------------------------------------------
/www/api/posts_update.php:
--------------------------------------------------------------------------------
1 |
24 | * @author Christian Weiske
25 | * @author Eric Dane
26 | * @license GPL http://www.gnu.org/licenses/gpl.html
27 | * @link http://sourceforge.net/projects/semanticscuttle
28 | * @link http://www.delicious.com/help/api
29 | */
30 |
31 | // Force HTTP authentication first!
32 | $httpContentType = 'text/xml';
33 | require_once 'httpauth.inc.php';
34 |
35 | // parameter "datemode=modified" will get last modified date
36 | // instead of last created date
37 | $orderby = null;
38 | $timeField = 'bDatetime';
39 | if (isset($_GET['datemode']) && $_GET['datemode'] == 'modified') {
40 | $orderby = 'modified_desc';
41 | $timeField = 'bModified';
42 | }
43 |
44 | $bs = SemanticScuttle_Service_Factory::get('Bookmark');
45 |
46 | $bookmarks = $bs->getBookmarks(0, 1, $userservice->getCurrentUserId(), null, null, $orderby);
47 |
48 | // Set up the XML file and output all the tags.
49 | echo '\r\n";
50 | //foreach is used in case there are no bookmarks
51 | foreach ($bookmarks['bookmarks'] as $row) {
52 | echo ' ';
57 | }
58 | ?>
59 |
--------------------------------------------------------------------------------
/www/api/posts_all.php:
--------------------------------------------------------------------------------
1 | getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag);
26 |
27 | // Set up the XML file and output all the posts.
28 | echo '\r\n";
29 | echo '\r\n";
30 |
31 | foreach($bookmarks['bookmarks'] as $row) {
32 | if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))
33 | $description = '';
34 | else
35 | $description = 'extended="'. filter($row['bDescription'], 'xml') .'" ';
36 |
37 | $taglist = '';
38 | if (count($row['tags']) > 0) {
39 | foreach($row['tags'] as $tag)
40 | $taglist .= convertTag($tag) .' ';
41 | $taglist = substr($taglist, 0, -1);
42 | } else {
43 | $taglist = 'system:unfiled';
44 | }
45 |
46 | echo "\t \r\n";
47 | }
48 |
49 | echo ' ';
50 | ?>
51 |
--------------------------------------------------------------------------------
/www/api/httpauth.inc.php:
--------------------------------------------------------------------------------
1 |
15 | * @author Christian Weiske
16 | * @author Eric Dane
17 | * @license GPL http://www.gnu.org/licenses/gpl.html
18 | * @link http://sourceforge.net/projects/semanticscuttle
19 | */
20 | require_once '../www-header.php';
21 |
22 | /**
23 | * Sends HTTP auth headers to the browser
24 | */
25 | function authenticate()
26 | {
27 | header('WWW-Authenticate: Basic realm="SemanticScuttle API"');
28 | header('HTTP/1.0 401 Unauthorized');
29 |
30 | die(T_("Use of the API calls requires authentication."));
31 | }
32 |
33 | if (!$userservice->isLoggedOn()) {
34 | /* Maybe we have caught authentication data in $_SERVER['REMOTE_USER']
35 | ( Inspired by http://www.yetanothercommunitysystem.com/article-321-regle-comment-utiliser-l-authentification-http-en-php-chez-ovh ) */
36 | if ((!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']))
37 | && isset($_SERVER['REMOTE_USER'])
38 | && preg_match('/Basic\s+(.*)$/i', $_SERVER['REMOTE_USER'], $matches)
39 | ) {
40 | list($name, $password) = explode(':', base64_decode($matches[1]));
41 | $_SERVER['PHP_AUTH_USER'] = strip_tags($name);
42 | $_SERVER['PHP_AUTH_PW'] = strip_tags($password);
43 | }
44 |
45 | if (!isset($_SERVER['PHP_AUTH_USER'])) {
46 | authenticate();
47 | } else {
48 | $login = $userservice->login(
49 | $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']
50 | );
51 | if ($login) {
52 | $currentUser = $userservice->getCurrentObjectUser();
53 | } else {
54 | authenticate();
55 | }
56 | }
57 | }
58 | ?>
59 |
--------------------------------------------------------------------------------
/data/templates/default/about.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
3 | ?>
4 |
5 |
6 | Store all your favourite links in one place, accessible from anywhere.'); ?>
7 | Share your bookmarks with everyone, with friends on your watchlist or just keep them private.') ;?>
8 | Tag your bookmarks with as many labels as you want, instead of wrestling with folders.'); ?>
9 | '.T_('Register now').' '.T_(' to start using %s!'), $GLOBALS['sitename']); ?>
10 |
11 |
12 |
13 |
14 | Semantic Scuttle GNU General Public License ()
15 | del.icio.us API . Almost all of the neat tools made for that system can be modified to work with %1$s instead. If you find a tool that won\'t let you change the API address, ask the creator to add this setting. You never know, they might just do it.'), $GLOBALS['sitename']); ?>
16 |
17 |
18 |
19 | isAdmin()): ?>
20 | SemanticScuttle v0.98.5
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 | includeTemplate($GLOBALS['bottom_include']);
34 | ?>
35 |
--------------------------------------------------------------------------------
/data/templates/default/sidebar.block.linked.php:
--------------------------------------------------------------------------------
1 | getCurrentUserId();
21 | $editingMode = $logged_on_userid !== false;
22 | ?>
23 |
24 |
--------------------------------------------------------------------------------
/www/api/export_csv.php:
--------------------------------------------------------------------------------
1 |
11 | * @author Christian Weiske
12 | * @author Eric Dane
13 | * @license GPL http://www.gnu.org/licenses/gpl.html
14 | * @link http://sourceforge.net/projects/semanticscuttle
15 | */
16 |
17 | // Force HTTP authentication first!
18 | $httpContentType = 'application/csv-tab-delimited-table';
19 | require_once 'httpauth.inc.php';
20 | header("Content-disposition: filename=exportBookmarks.csv");
21 |
22 | /* Service creation: only useful services are created */
23 | $bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark');
24 |
25 | // Check to see if a tag was specified.
26 | if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != '')) {
27 | //$_GET vars have + replaced to " " automatically
28 | $tag = str_replace(' ', '+', trim($_REQUEST['tag']));
29 | } else {
30 | $tag = null;
31 | }
32 |
33 | // Get the posts relevant to the passed-in variables.
34 | $bookmarks = $bookmarkservice->getBookmarks(
35 | 0, null, $userservice->getCurrentUserId(),
36 | $tag, null, getSortOrder()
37 | );
38 |
39 | //columns titles
40 | echo 'url;title;tags;description';
41 | echo "\n";
42 |
43 | foreach($bookmarks['bookmarks'] as $row) {
44 | if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))
45 | $description = '';
46 | else
47 | $description = filter(str_replace(array("\r\n", "\n", "\r"),"", $row['bDescription']), 'xml');
48 |
49 | $taglist = '';
50 | if (count($row['tags']) > 0) {
51 | foreach($row['tags'] as $tag)
52 | $taglist .= convertTag($tag) .',';
53 | $taglist = substr($taglist, 0, -1);
54 | } else {
55 | $taglist = 'system:unfiled';
56 | }
57 |
58 | echo '"'.filter($row['bAddress'], 'xml') .'";"'. filter($row['bTitle'], 'xml') .'";"'. filter($taglist, 'xml') .'";"'. $description .'"';
59 | echo "\n";
60 | }
61 |
62 |
63 | ?>
64 |
--------------------------------------------------------------------------------
/data/templates/default/importNetscape.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
3 | ?>
4 |
5 |
6 |
7 |
30 |
31 |
32 |
33 |
34 |
35 | :
36 |
37 | File > Import and Export... > Export Favorites'); ?>
38 | Bookmarks > Manage Bookmarks... > File > Export...'); ?>
39 | Bookmarks > Manage Bookmarks... > Tools > Export...'); ?>
40 |
41 |
42 | Browse... to find the saved bookmark file on your computer. The maximum size the file can be is 1MB'); ?>.
43 | .
44 | Import to start importing the bookmarks; it may take a minute'); ?>.
45 |
46 |
47 |
48 | includeTemplate($GLOBALS['bottom_include']);
50 | ?>
--------------------------------------------------------------------------------
/data/templates/default/editprofile-sslclientcerts.tpl.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 | Options
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | isCurrent()) { echo 'class="ssl-current"'; } ?>>
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | sslSerial); ?>
35 | sslName); ?>
36 | sslEmail); ?>
37 | sslClientIssuerDn); ?>
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | isRegistered($sslClientCerts)) { ?>
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/www/users.php:
--------------------------------------------------------------------------------
1 | getCurrentObjectUser();
30 |
31 | $pagetitle = T_('Users');
32 |
33 | if ($usecache) {
34 | // Generate hash for caching on
35 | if ($userservice->isLoggedOn()) {
36 | $hash = md5($_SERVER['REQUEST_URI'] . $currentUser->getId());
37 | } else {
38 | $hash = md5($_SERVER['REQUEST_URI']);
39 | }
40 |
41 | // Cache for 30 minutes
42 | $cacheservice->Start($hash, 1800);
43 | }
44 |
45 | // Header variables
46 | $tplVars['pagetitle'] = $pagetitle;
47 | $tplVars['loadjs'] = true;
48 |
49 | $tplVars['sidebar_blocks'] = array('recent', 'popular');
50 | $tplVars['subtitle'] = filter($pagetitle);
51 |
52 | $tplVars['users'] = $userservice->getUsers();
53 | //$tplVars['cat_url'] = createURL('tags', '%2$s');
54 | //$tplVars['nav_url'] = createURL('tags', '%2$s%3$s');
55 |
56 | $templateservice->loadTemplate('users.tpl', $tplVars);
57 |
58 | if ($usecache) {
59 | // Cache output if existing copy has expired
60 | $cacheservice->End($hash);
61 | }
62 | ?>
63 |
--------------------------------------------------------------------------------
/tests/www/indexTest.php:
--------------------------------------------------------------------------------
1 | getLoggedInRequest('?unittestMode=1', true, true);
16 |
17 | $user = $this->us->getUser($uId);
18 | $response = $req->send();
19 | $response_body = $response->getBody();
20 |
21 | $this->assertNotEquals('', $response_body, 'Response is empty');
22 |
23 | $x = simplexml_load_string($response_body);
24 | $ns = $x->getDocNamespaces();
25 | $x->registerXPathNamespace('ns', reset($ns));
26 |
27 | $elements = $x->xpath('//ns:link[@rel="alternate" and @type="application/rss+xml"]');
28 | $this->assertEquals(2, count($elements), 'Number of Links in Head not correct');
29 | $this->assertContains('privateKey=', (string)$elements[1]['href']);
30 | }//end testVerifyPrivateRSSLinkExists
31 |
32 |
33 |
34 | /**
35 | * Test that the private RSS link doesn't exists when a user
36 | * does not have a private key, or the private key is not enabled
37 | */
38 | public function testVerifyPrivateRSSLinkDoesNotExist()
39 | {
40 | list($req, $uId) = $this->getLoggedInRequest('?unittestMode=1', true);
41 |
42 | $user = $this->us->getUser($uId);
43 | $response = $req->send();
44 | $response_body = $response->getBody();
45 | $this->assertNotEquals('', $response_body, 'Response is empty');
46 |
47 | $x = simplexml_load_string($response_body);
48 | $ns = $x->getDocNamespaces();
49 | $x->registerXPathNamespace('ns', reset($ns));
50 |
51 | $elements = $x->xpath('//ns:link[@rel="alternate" and @type="application/rss+xml"]');
52 | $this->assertEquals(1, count($elements), 'Number of Links in Head not correct');
53 | $this->assertNotContains('privateKey=', (string)$elements[0]['href']);
54 | }//end testVerifyPrivateRSSLinkDoesNotExist
55 |
56 |
57 | }//end class www_bookmarksTest
58 | ?>
59 |
--------------------------------------------------------------------------------
/tests/AllTests.php:
--------------------------------------------------------------------------------
1 |
10 | * @author Christian Weiske
11 | * @author Eric Dane
12 | * @license GPL http://www.gnu.org/licenses/gpl.html
13 | * @link http://sourceforge.net/projects/semanticscuttle
14 | */
15 |
16 | /**
17 | * SemanticScuttle unit tests.
18 | *
19 | * To launch this tests, you need PHPUnit 3.
20 | * Run them with:
21 | * $ cd tests; phpunit .
22 | * or single files like:
23 | * $ cd tests; phpunit BookmarkTest.php
24 | *
25 | * @category Bookmarking
26 | * @package SemanticScuttle
27 | * @author Benjamin Huynh-Kim-Bang
28 | * @author Christian Weiske
29 | * @author Eric Dane
30 | * @license GPL http://www.gnu.org/licenses/gpl.html
31 | * @link http://sourceforge.net/projects/semanticscuttle
32 | */
33 | class AllTests extends PHPUnit_Framework_TestSuite
34 | {
35 | public static function suite()
36 | {
37 | $suite = new AllTests();
38 | $tdir = dirname(__FILE__);
39 | $suite->addTestFile($tdir . '/BookmarkTest.php');
40 | $suite->addTestFile($tdir . '/Bookmark2TagTest.php');
41 | $suite->addTestFile($tdir . '/Tag2TagTest.php');
42 | $suite->addTestFile($tdir . '/TagsCacheTest.php');
43 | $suite->addTestFile($tdir . '/CommonDescriptionTest.php');
44 | $suite->addTestFile($tdir . '/SearchHistoryTest.php');
45 | $suite->addTestFile($tdir . '/TagTest.php');
46 | $suite->addTestFile($tdir . '/VoteTest.php');
47 | $suite->addTestFile($tdir . '/UserTest.php');
48 | $suite->addTestFile($tdir . '/Api/ExportCsvTest.php');
49 | $suite->addTestFile($tdir . '/Api/OpenSearchTest.php');
50 | $suite->addTestFile($tdir . '/Api/PostsAddTest.php');
51 | $suite->addTestFile($tdir . '/Api/PostsDeleteTest.php');
52 | $suite->addTestFile($tdir . '/Api/PostsUpdateTest.php');
53 | return $suite;
54 | }
55 |
56 |
57 |
58 | protected function tearDown()
59 | {
60 | }
61 | }
62 | ?>
63 |
--------------------------------------------------------------------------------
/tests/www/searchTest.php:
--------------------------------------------------------------------------------
1 | addBookmark(null, null, 0, null, 'unittest foo bar');
18 | $res = $this->getRequest('/all/foo+bar')->send();
19 | $this->assertSelectCount(
20 | '.xfolkentry', true, $res->getBody(),
21 | 'No bookmark found', false
22 | );
23 |
24 | $res = $this->getRequest('/all/baz+bat')->send();
25 | $this->assertSelectCount(
26 | '.xfolkentry', false, $res->getBody(),
27 | 'Bookmarks found', false
28 | );
29 | }
30 |
31 |
32 | /**
33 | * Some browsers using opensearch do "rawurlencode" on the terms,
34 | * for example Opera. Multiple terms separated with space
35 | * appear as "foo%20bar" in the URL.
36 | */
37 | public function testMultipleTermsRawUrlEncoded()
38 | {
39 | $this->addBookmark(null, null, 0, null, 'unittest foo bar');
40 | $res = $this->getRequest('/all/foo%20bar')->send();
41 | $this->assertSelectCount(
42 | '.xfolkentry', true, $res->getBody(),
43 | 'No bookmark found', false
44 | );
45 |
46 | $res = $this->getRequest('/all/baz%20bat')->send();
47 | $this->assertSelectCount(
48 | '.xfolkentry', false, $res->getBody(),
49 | 'Bookmarks found', false
50 | );
51 | }
52 |
53 |
54 | public function testMultipleTags()
55 | {
56 | $this->markTestSkipped(
57 | 'FIXME: SemanticScuttle currently does not search multiple tags'
58 | );
59 |
60 | $this->addBookmark(null, null, 0, array('foo', 'bar'));
61 | $res = $this->getRequest('/all/foo+bar')->send();
62 | $this->assertSelectCount(
63 | '.xfolkentry', true, $res->getBody(),
64 | 'No bookmark found', false
65 | );
66 | }
67 |
68 | }
69 |
70 | ?>
71 |
--------------------------------------------------------------------------------
/src/SemanticScuttle/Service/Cache.php:
--------------------------------------------------------------------------------
1 |
10 | * @author Christian Weiske
11 | * @author Eric Dane
12 | * @license GPL http://www.gnu.org/licenses/gpl.html
13 | * @link http://sourceforge.net/projects/semanticscuttle
14 | */
15 |
16 | /**
17 | * SemanticScuttle caching service
18 | *
19 | * @category Bookmarking
20 | * @package SemanticScuttle
21 | * @author Benjamin Huynh-Kim-Bang
22 | * @author Christian Weiske
23 | * @author Eric Dane
24 | * @license GPL http://www.gnu.org/licenses/gpl.html
25 | * @link http://sourceforge.net/projects/semanticscuttle
26 | */
27 | class SemanticScuttle_Service_Cache extends SemanticScuttle_Service
28 | {
29 | var $basedir;
30 | var $fileextension = '.cache';
31 |
32 | /**
33 | * Returns the single service instance
34 | *
35 | * @param DB $db Database object
36 | *
37 | * @return SemanticScuttle_Service
38 | */
39 | public static function getInstance($db)
40 | {
41 | static $instance;
42 | if (!isset($instance)) {
43 | $instance = new self($db);
44 | }
45 | return $instance;
46 | }
47 |
48 | protected function __construct()
49 | {
50 | $this->basedir = $GLOBALS['dir_cache'];
51 | }
52 |
53 | function Start($hash, $time = 300) {
54 | $cachefile = $this->basedir .'/'. $hash . $this->fileextension;
55 | if (file_exists($cachefile) && time() < filemtime($cachefile) + $time) {
56 | @readfile($cachefile);
57 | echo "\n\n";
58 | unset($cachefile);
59 | exit;
60 | }
61 | ob_start("ob_gzhandler");
62 | }
63 |
64 | function End($hash) {
65 | $cachefile = $this->basedir .'/'. $hash . $this->fileextension;
66 | $handle = fopen($cachefile, 'w');
67 | fwrite($handle, ob_get_contents());
68 | fclose($handle);
69 | ob_flush();
70 | }
71 | }
72 | ?>
--------------------------------------------------------------------------------
/data/templates/default/profile.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
3 | ?>
4 |
5 |
6 |
7 |
8 | isLoggedOn() && $currentUser->isAdmin()) {
10 | ?>
11 |
12 | getEmail()) ?>
13 | getName() != "") {
16 | ?>
17 |
18 | getName()); ?>
19 | getHomepage() != "") {
22 | ?>
23 |
24 | getHomepage()); ?>
25 |
28 |
29 | getDatetime())); ?>
30 | getContent() != "") {
32 | ?>
33 |
34 | getContent(); ?>
35 | getWatchNames($userid);
38 | if ($watching) {
39 | ?>
40 |
41 |
42 | '. $watchuser .', ';
46 | }
47 | echo substr($list, 0, -2);
48 | ?>
49 |
50 | getWatchNames($userid, true);
53 | if ($watchnames) {
54 | ?>
55 |
56 |
57 | '. $watchuser .', ';
61 | }
62 | echo substr($list, 0, -2);
63 | ?>
64 |
65 |
68 |
69 | >>
70 |
71 |
72 | includeTemplate($GLOBALS['bottom_include']);
74 | ?>
75 |
--------------------------------------------------------------------------------
/www/watch.php:
--------------------------------------------------------------------------------
1 | isLoggedOn() && $user) {
40 | $pagetitle = '';
41 |
42 | $userid = $userservice->getIdFromUser($user);
43 |
44 | if($userid == NULL) {
45 | $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user);
46 | $templateservice->loadTemplate('error.404.tpl', $tplVars);
47 | exit();
48 | }
49 |
50 | $watched = $userservice->getWatchStatus($userid, $currentUser->getId());
51 | $changed = $userservice->setWatchStatus($userid);
52 |
53 | if ($watched) {
54 | $tplVars['msg'] = T_('User removed from your watchlist');
55 | } else {
56 | $tplVars['msg'] = T_('User added to your watchlist');
57 | }
58 |
59 | header('Location: '. createURL('watchlist', $currentUser->getUsername()));
60 | }
61 | ?>
62 |
--------------------------------------------------------------------------------
/data/templates/default/search.menu.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
57 |
58 |
--------------------------------------------------------------------------------
/data/templates/default/register.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
3 | ?>
4 |
5 |
10 |
11 | .
12 |
13 |
14 |
50 |
51 |
52 | includeTemplate($GLOBALS['bottom_include']);
54 | ?>
55 |
--------------------------------------------------------------------------------
/data/templates/default/tag2tagedit.tpl.php:
--------------------------------------------------------------------------------
1 | includeTemplate($GLOBALS['top_include']);
3 | ?>
4 |
5 |
6 |
7 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | 0) {
51 | echo T_("Existing links:");
52 | foreach($links as $link) {
53 | echo '';
54 | if($link['tag1'] == $tag1 || $link['tag1'] == $tag2) {
55 | $textTag1 = ''.$tag1.' ';
56 | } else {
57 | $textTag1 = $link['tag1'];
58 | }
59 | if($link['tag2'] == $tag1 || $link['tag2'] == $tag2) {
60 | $textTag2 = ''.$tag2.' ';
61 | } else {
62 | $textTag2 = $link['tag2'];
63 | }
64 |
65 | echo $textTag1.' '.$link['relationType'].' '.$textTag2;
66 | echo " ";
67 | }
68 | } else {
69 | echo T_('No links');
70 | }
71 |
72 | $this->includeTemplate($GLOBALS['bottom_include']);
73 | ?>
74 |
--------------------------------------------------------------------------------
/www/tag2tagedit.php:
--------------------------------------------------------------------------------
1 | loggedOn()) {
33 | $tplVars['error'] = T_('Permission denied.');
34 | $templateservice->loadTemplate('error.500.tpl', $tplVars);
35 | exit();
36 | }
37 |
38 | /* Managing path info */
39 | if(isset($_SERVER['PATH_INFO'])) {
40 | $exploded = explode('/', $_SERVER['PATH_INFO']);
41 | if(count($exploded) == 3) {
42 | list ($url, $tag1, $tag2) = explode('/', $_SERVER['PATH_INFO']);
43 | } else {
44 | list ($url, $tag1) = explode('/', $_SERVER['PATH_INFO']);
45 | $tag2 = '';
46 | }
47 | } else {
48 | $url = $tag1 = $tag2 = '';
49 | }
50 |
51 | $tplVars['links'] = $tag2tagservice->getLinks($userservice->getCurrentUserId());
52 |
53 | $tplVars['tag1'] = $tag1;
54 | $tplVars['tag2'] = $tag2;
55 | $tplVars['subtitle'] = T_('Edit Link Between Tags') .': '. $tag1.' > '.$tag2;
56 | $tplVars['formaddaction'] = createUrl('tag2tagadd');
57 | $tplVars['formdeleteaction'] = createUrl('tag2tagdelete');
58 | $tplVars['referrer'] = HTTP_REFERER;
59 | $templateservice->loadTemplate('tag2tagedit.tpl', $tplVars);
60 | ?>
61 |
--------------------------------------------------------------------------------
/data/templates/default/sidebar.block.watchlist.php:
--------------------------------------------------------------------------------
1 | getWatchNames($userid);
6 | $watchedBy = $userservice->getWatchNames($userid, true);
7 |
8 |
9 | $closeContacts = array(); // people in my contacts list and who I am also in the contacts list
10 | foreach($watching as $watchuser) {
11 | if(in_array($watchuser, $watchedBy)) {
12 | $closeContacts[] = $watchuser;
13 | }
14 | }
15 |
16 | ?>
17 |
18 | 0):?>
19 |
20 |
27 |
28 |
29 |
30 |
31 |
51 |
52 |
53 |
61 |
--------------------------------------------------------------------------------
/www/tagdelete.php:
--------------------------------------------------------------------------------
1 | getCurrentObjectUser();
35 |
36 | /* Managing path info */
37 | list ($url, $tag) = explode('/', $_SERVER['PATH_INFO']);
38 |
39 |
40 |
41 | if (POST_CONFIRM) {
42 | if ($b2tservice->deleteTag($currentUser->getId(), $tag)) {
43 | $tplVars['msg'] = T_('Tag deleted');
44 | header('Location: '. createURL('bookmarks', $currentUser->getUsername()));
45 | } else {
46 | $tplVars['error'] = T_('Failed to delete the tag');
47 | $templateservice->loadTemplate('error.500.tpl', $tplVars);
48 | exit();
49 | }
50 | } elseif (POST_CANCEL) {
51 | header('Location: '. POST_REFERRER);
52 | }
53 |
54 | $tplVars['subtitle'] = T_('Delete Tag') .': '. $tag;
55 | $tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] .'/'. $tag;
56 | $tplVars['referrer'] = $_SERVER['HTTP_REFERER'];
57 | $templateservice->loadTemplate('tagdelete.tpl', $tplVars);
58 | ?>
59 |
--------------------------------------------------------------------------------
/tests/Api/OpenSearchTest.php:
--------------------------------------------------------------------------------
1 | getRequest();
12 | $xhtml = $req->send()->getBody();
13 |
14 | $xml = simplexml_load_string($xhtml);
15 | $xml->registerXPathNamespace('h', rreset($xml->getDocNamespaces()));
16 |
17 | $this->assertInstanceOf(
18 | 'SimpleXMLElement', $xml,
19 | 'SemanticScuttle main page XHTML could not be loaded - maybe invalid?'
20 | );
21 |
22 | $arElements = $xml->xpath(
23 | '//h:head/h:link'
24 | . '[@rel="search" and @type="application/opensearchdescription+xml"]'
25 | );
26 | $this->assertEquals(
27 | 1, count($arElements),
28 | 'OpenSearch link in HTML is missing'
29 | );
30 | $searchDescUrl = $this->completeUrl((string)$arElements[0]['href']);
31 | $this->assertNotNull($searchDescUrl, 'Search description URL is empty');
32 |
33 | $req = new HTTP_Request2($searchDescUrl);
34 | $res = $req->send();
35 | $this->assertEquals(
36 | 200, $res->getStatus(),
37 | 'HTTP response status code is not 200'
38 | );
39 |
40 | $this->assertEquals(
41 | $GLOBALS['unittestUrl'] . 'api/opensearch.php',
42 | $searchDescUrl,
43 | 'OpenSearch URL found, but it is not the expected one.'
44 | . ' It may be that you misconfigured the "unittestUrl" setting'
45 | );
46 | }
47 |
48 | public function testOpenSearchContentType()
49 | {
50 | $res = $this->getRequest('api/opensearch.php')->send();
51 | $this->assertEquals(
52 | 'text/xml; charset=utf-8',
53 | $res->getHeader('content-type')
54 | );
55 | }
56 |
57 | public function testOpenSearchSearchUrl()
58 | {
59 | $xml = $this->getRequest('api/opensearch.php')->send()->getBody();
60 | $x = simplexml_load_string($xml);
61 | $x->registerXPathNamespace('os', rreset($x->getDocNamespaces()));
62 |
63 | $arElements = $x->xpath('//os:Url[@type="text/html"]');
64 | $this->assertEquals(
65 | 1, count($arElements),
66 | 'Url in OpenSearch description is missing'
67 | );
68 | $this->assertEquals(
69 | $GLOBALS['unittestUrl'] . 'search.php/all/{searchTerms}',
70 | (string)$arElements[0]['template']
71 | );
72 | }
73 |
74 | }
75 |
76 | ?>
--------------------------------------------------------------------------------
/src/php-gettext/tests/LocalesTest.php:
--------------------------------------------------------------------------------
1 | assertEquals('sr_RS', _setlocale(LC_MESSAGES, 0));
12 |
13 | // For an existing locale, it never needs emulation.
14 | putenv("LANG=C");
15 | _setlocale(LC_MESSAGES, "");
16 | $this->assertEquals(0, locale_emulation());
17 |
18 | // If we set it to a non-existent locale, it still works, but uses
19 | // emulation.
20 | _setlocale(LC_MESSAGES, "xxx_XXX");
21 | $this->assertEquals('xxx_XXX', _setlocale(LC_MESSAGES, 0));
22 | $this->assertEquals(1, locale_emulation());
23 | }
24 |
25 | public function test_get_list_of_locales()
26 | {
27 | // For a locale containing country code, we prefer
28 | // full locale name, but if that's not found, fall back
29 | // to the language only locale name.
30 | $this->assertEquals(array("sr_RS", "sr"),
31 | get_list_of_locales("sr_RS"));
32 |
33 | // If language code is used, it's the only thing returned.
34 | $this->assertEquals(array("sr"),
35 | get_list_of_locales("sr"));
36 |
37 | // There is support for language and charset only.
38 | $this->assertEquals(array("sr.UTF-8", "sr"),
39 | get_list_of_locales("sr.UTF-8"));
40 |
41 | // It can also split out character set from the full locale name.
42 | $this->assertEquals(array("sr_RS.UTF-8", "sr_RS", "sr"),
43 | get_list_of_locales("sr_RS.UTF-8"));
44 |
45 | // There is support for @modifier in locale names as well.
46 | $this->assertEquals(array("sr_RS.UTF-8@latin", "sr_RS@latin", "sr@latin",
47 | "sr_RS.UTF-8", "sr_RS", "sr"),
48 | get_list_of_locales("sr_RS.UTF-8@latin"));
49 |
50 | // We can pass in only language and modifier.
51 | $this->assertEquals(array("sr@latin", "sr"),
52 | get_list_of_locales("sr@latin"));
53 |
54 |
55 | // If locale name is not following the regular POSIX pattern,
56 | // it's used verbatim.
57 | $this->assertEquals(array("something"),
58 | get_list_of_locales("something"));
59 |
60 | // Passing in an empty string returns an empty array.
61 | $this->assertEquals(array(),
62 | get_list_of_locales(""));
63 | }
64 | }
65 |
66 | ?>
67 |
--------------------------------------------------------------------------------