mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 15:55:13 +00:00
code cleanup continued
This commit is contained in:
parent
4b4f24057b
commit
4dd6c376aa
15 changed files with 57 additions and 32 deletions
|
@ -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: '),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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/<language>/strings.php
|
||||
|
||||
|
|
2
util/dcp
2
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 <args>' . PHP_EOL;
|
||||
echo 'Run dcp from the top level web directory, as util/dcp <args>' . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 <args>' . PHP_EOL;
|
||||
echo 'Run dmkdir from the top level web directory, as util/dmkdir <args>' . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
// Hubzilla thumbnails storage convertor
|
||||
// thumbnails storage convertor
|
||||
function usage() {
|
||||
echo <<< EOT
|
||||
Hubzilla thumbnails storage convertor
|
||||
thumbnails storage convertor
|
||||
|
||||
Usage:
|
||||
util/storageconv stats # show current stats
|
||||
|
|
|
@ -1901,3 +1901,7 @@ dl.bb-dl > dd > li {
|
|||
margin: 0 10px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.screenshot img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* * Name: Redbasic
|
||||
* * Description: Hubzilla standard theme
|
||||
* * Description: standard theme
|
||||
* * Version: 2.1
|
||||
* * Author: Fabrixxm
|
||||
* * Maintainer: Mike Macgirvin
|
||||
|
|
|
@ -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('<img class="chat-item-photo" src="' + item.img + '" alt="' + item.name + '" /><div class="chat-body"><div class="chat-item-title wall-item-ago"><span class="chat-item-name">' + item.name + ' </span><span class="autotime chat-item-time" title="' + item.isotime + '">' + item.localtime + '</span></div><div class="chat-item-text">' + item.text + '</div></div>');
|
||||
chat_issue_notification(item.name + ':\n' + item.text, 'Hubzilla Chat');
|
||||
chat_issue_notification(item.name + ':\n' + item.text, 'Chat');
|
||||
}
|
||||
$('#chatLineHolder').append(newNode);
|
||||
$(".autotime").timeago();
|
||||
|
|
|
@ -6,21 +6,21 @@
|
|||
<Property
|
||||
type="http://www.oexchange.org/spec/0.8/prop/vendor">Code</Property>
|
||||
<Property
|
||||
type="http://www.oexchange.org/spec/0.8/prop/title">Hubzilla</Property>
|
||||
type="http://www.oexchange.org/spec/0.8/prop/title">Streams</Property>
|
||||
<Property
|
||||
type="http://www.oexchange.org/spec/0.8/prop/name">Hubzilla</Property>
|
||||
type="http://www.oexchange.org/spec/0.8/prop/name">Streams</Property>
|
||||
<Property
|
||||
type="http://www.oexchange.org/spec/0.8/prop/prompt">Send to Hubzilla</Property>
|
||||
type="http://www.oexchange.org/spec/0.8/prop/prompt">Send to Streams</Property>
|
||||
|
||||
<Link
|
||||
rel="icon"
|
||||
href="{{$base}}/images/hz-16.png"
|
||||
href="{{$base}}/images/streams-16.png"
|
||||
type="image/png"
|
||||
/>
|
||||
|
||||
<Link
|
||||
rel="icon32"
|
||||
href="{{$base}}/images/hz-32.png"
|
||||
href="{{$base}}/images/streams-32.png"
|
||||
type="image/png"
|
||||
/>
|
||||
|
||||
|
|
Loading…
Reference in a new issue