diff --git a/Code/Module/Admin/Themes.php b/Code/Module/Admin/Themes.php index 969341f23..ed8e8c313 100644 --- a/Code/Module/Admin/Themes.php +++ b/Code/Module/Admin/Themes.php @@ -126,7 +126,7 @@ class Themes } } - $screenshot = array(get_theme_screenshot($theme), t('Screenshot')); + $screenshot = array(Theme::get_screenshot($theme), t('Screenshot')); if (!stristr($screenshot[0], $theme)) { $screenshot = null; } @@ -142,7 +142,7 @@ class Themes '$plugin' => $theme, '$status' => $status, '$action' => $action, - '$info' => get_theme_info($theme), + '$info' => Theme::get_info($theme), '$function' => 'themes', '$admin_form' => $admin_form, '$str_author' => t('Author: '), diff --git a/Code/Module/Theme_info.php b/Code/Module/Theme_info.php index 13168b64e..24fb10418 100644 --- a/Code/Module/Theme_info.php +++ b/Code/Module/Theme_info.php @@ -4,6 +4,7 @@ namespace Code\Module; use App; use Code\Web\Controller; +use Code\Render\Theme; class Theme_info extends Controller { @@ -32,7 +33,7 @@ class Theme_info extends Controller $theme_config = $th_config->get(); } } - $info = get_theme_info($theme); + $info = Theme::get_info($theme); if ($info) { // unfortunately there will be no translation for this string $desc = $info['description']; @@ -46,7 +47,7 @@ class Theme_info extends Controller $ret = [ 'theme' => $theme, - 'img' => get_theme_screenshot($theme), + 'img' => Theme::get_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits, @@ -70,4 +71,4 @@ class Theme_info extends Controller } return null; } -} +} \ No newline at end of file diff --git a/Code/Render/Theme.php b/Code/Render/Theme.php index b230e7fa7..e3c0349df 100644 --- a/Code/Render/Theme.php +++ b/Code/Render/Theme.php @@ -179,7 +179,7 @@ class Theme return ''; } - static public function get_info($theme) { + public static function get_info($theme) { $info = null; if (is_file("view/theme/$theme/$theme.yml")) { @@ -192,7 +192,7 @@ class Theme } - static public function get_email_template($s, $root = '') + public static function get_email_template($s, $root = '') { $testroot = ($root=='') ? $testroot = "ROOT" : $root; $t = App::template_engine(); @@ -216,7 +216,7 @@ class Theme } } - static public function get_template($s, $root = '') + public static function get_template($s, $root = '') { $testroot = ($root=='') ? $testroot = "ROOT" : $root; @@ -242,10 +242,30 @@ class Theme } + /** + * @brief Returns the theme's screenshot. + * + * The screenshot is expected as view/theme/$theme/img/screenshot.[png|jpg]. + * + * @param string $theme The name of the theme + * @return string + */ + public static function get_screenshot($theme) + { + + $exts = array('.png', '.jpg'); + foreach ($exts as $ext) { + if (file_exists('view/theme/' . $theme . '/img/screenshot' . $ext)) { + return(z_root() . '/view/theme/' . $theme . '/img/screenshot' . $ext); + } + } + + return(z_root() . '/images/blank.png'); + } - public function debug() + public static function debug() { logger('system_theme: ' . self::$system_theme); logger('session_theme: ' . self::$session_theme); diff --git a/util/Doxyfile b/util/Doxyfile index 0948c0183..7e82980ae 100644 --- a/util/Doxyfile +++ b/util/Doxyfile @@ -1,8 +1,8 @@ INPUT = README.md index.php boot.php include/ install/ util/ view/ Code/ RECURSIVE = YES -PROJECT_NAME = "Hubzilla" -PROJECT_LOGO = images/rm-64.png -EXCLUDE = .htconfig.php library/ doc/ store/ vendor/ .git/ util/zotsh/easywebdav/ util/generate-hooks-index/ +PROJECT_NAME = "Streams" +PROJECT_LOGO = images/streams-64.png +EXCLUDE = .htconfig.php library/ doc/ store/ vendor/ .git/ util/generate-hooks-index/ EXCLUDE_PATTERNS = *smarty3* *strings.php *.out *test* OUTPUT_DIRECTORY = doc GENERATE_HTML = YES diff --git a/util/README b/util/README index 75732bbf4..89dcc9325 100644 --- a/util/README +++ b/util/README @@ -102,7 +102,7 @@ When strings are added or modified in source, you could run to extract strings from source files and join them with the existing .po file: new strings are added, the existing are not overwritten. -If you already translated the Hubzilla using strings.php, you could import your old +If you already translated the project using strings.php, you could import your old translation to messages.po. Run: $ php util/php2po.php view//strings.php diff --git a/util/dcp b/util/dcp index 45a2d27d0..7bfa8aab4 100755 --- a/util/dcp +++ b/util/dcp @@ -7,7 +7,7 @@ use Code\Daemon\Run; use Code\Lib\Channel; if(!file_exists('include/cli_startup.php')) { - echo 'Run dcp from the top level Hubzilla web directory, as util/dcp ' . PHP_EOL; + echo 'Run dcp from the top level web directory, as util/dcp ' . PHP_EOL; exit(1); } diff --git a/util/dmkdir b/util/dmkdir index 90f35fea3..c58171c9c 100755 --- a/util/dmkdir +++ b/util/dmkdir @@ -8,7 +8,7 @@ use Code\Lib\Channel; // file import to DAV utility if(!file_exists('include/cli_startup.php')) { - echo 'Run dmkdir from the top level Hubzilla web directory, as util/dmkdir ' . PHP_EOL; + echo 'Run dmkdir from the top level web directory, as util/dmkdir ' . PHP_EOL; exit(1); } diff --git a/util/generate-hooks-index/README.md b/util/generate-hooks-index/README.md index a3d4f7666..0e1685d6d 100644 --- a/util/generate-hooks-index/README.md +++ b/util/generate-hooks-index/README.md @@ -1,12 +1,12 @@ # Generate hooks -This program generates hooks.html documentation from the Hubzilla source. +This program generates hooks.html documentation from the project source. ## Usage Download and install leiningen -Change directory into hubzilla/util/generate-hooks-index +Change directory into util/generate-hooks-index At shell prompt, do: @@ -14,7 +14,7 @@ At shell prompt, do: lein run ``` -Hooks docs will get dumped into hubzilla/doc/hooks.html +Hooks docs will get dumped into doc/hooks.html ## Requirements diff --git a/util/generate-hooks-index/project.clj b/util/generate-hooks-index/project.clj index dc0b92f51..ea7520efe 100644 --- a/util/generate-hooks-index/project.clj +++ b/util/generate-hooks-index/project.clj @@ -1,6 +1,6 @@ (defproject generate-hooks-index "0.1.0-SNAPSHOT" - :description "Generates Hooks docs for Hubzilla" - :url "https://framagit.org/hubzilla/core/" + :description "Generates Hooks docs from source code" + :url "https://codeberg.org/streams/streams" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.7.0"] diff --git a/util/storageconv b/util/storageconv index 356056a09..1f2ed8095 100755 --- a/util/storageconv +++ b/util/storageconv @@ -1,10 +1,10 @@ #!/usr/bin/env php dd > li { margin: 0 10px; padding: 10px 0; } + +.screenshot img { + max-width: 100%; +} diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index 440307304..0d117ea42 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -17,10 +17,10 @@ class RedbasicConfig { if(in_array('view/theme/redbasic/schema/default.php', $files)) { $scheme_choices['---'] = t('Default'); - $scheme_choices['focus'] = t('Focus (Hubzilla default)'); + $scheme_choices['focus'] = t('Focus (default)'); } else { - $scheme_choices['---'] = t('Focus (Hubzilla default)'); + $scheme_choices['---'] = t('Focus (default)'); } foreach($files as $file) { diff --git a/view/theme/redbasic/php/theme.php b/view/theme/redbasic/php/theme.php index e5614b9df..bed666638 100644 --- a/view/theme/redbasic/php/theme.php +++ b/view/theme/redbasic/php/theme.php @@ -2,7 +2,7 @@ /** * * Name: Redbasic - * * Description: Hubzilla standard theme + * * Description: standard theme * * Version: 2.1 * * Author: Fabrixxm * * Maintainer: Mike Macgirvin diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl index c189cbd15..4660a83be 100644 --- a/view/tpl/chat.tpl +++ b/view/tpl/chat.tpl @@ -160,7 +160,7 @@ function update_inroom(inroom) { memberChange = chatRoomMembersChange(inroom); // get list of arrivals and departures if(memberChange.membersArriving.length > 0) { // Issue pop-up notification if anyone enters the room. - chat_issue_notification(JSON.stringify(memberChange.membersArriving.pop().name) + ' entered the room', 'Hubzilla Chat'); + chat_issue_notification(JSON.stringify(memberChange.membersArriving.pop().name) + ' entered the room', 'Chat'); } $('#chatMembers').html(html); } @@ -201,7 +201,7 @@ function update_chats(chats) { else { newNode.setAttribute('class', 'chat-item clear'); $(newNode).html('' + item.name + '
' + item.name + ' ' + item.localtime + '
' + item.text + '
'); - chat_issue_notification(item.name + ':\n' + item.text, 'Hubzilla Chat'); + chat_issue_notification(item.name + ':\n' + item.text, 'Chat'); } $('#chatLineHolder').append(newNode); $(".autotime").timeago(); diff --git a/view/tpl/oexchange_xrd.tpl b/view/tpl/oexchange_xrd.tpl index 736a7181b..0f371879c 100755 --- a/view/tpl/oexchange_xrd.tpl +++ b/view/tpl/oexchange_xrd.tpl @@ -6,21 +6,21 @@ Code Hubzilla + type="http://www.oexchange.org/spec/0.8/prop/title">Streams Hubzilla + type="http://www.oexchange.org/spec/0.8/prop/name">Streams Send to Hubzilla + type="http://www.oexchange.org/spec/0.8/prop/prompt">Send to Streams