From 4728e72d182f78dc2f5768fdb55d1e142fc92129 Mon Sep 17 00:00:00 2001 From: git-marijus Date: Mon, 17 Jul 2017 16:19:19 +0200 Subject: some love for the installer --- Zotlabs/Module/Setup.php | 27 ++++++++++++-------- view/css/mod_setup.css | 40 ----------------------------- view/php/mod_import.php | 2 -- view/php/mod_setup.php | 2 ++ view/tpl/install.tpl | 20 ++++++++++----- view/tpl/install_checks.tpl | 49 +++++++++++++++++++---------------- view/tpl/install_db.tpl | 59 ++++++++++++++++++++++--------------------- view/tpl/install_settings.tpl | 56 ++++++++++++++++++++-------------------- 8 files changed, 116 insertions(+), 139 deletions(-) delete mode 100644 view/css/mod_setup.css delete mode 100644 view/php/mod_import.php create mode 100644 view/php/mod_setup.php diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index e5b54cc5f..2134288d6 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -186,14 +186,17 @@ class Setup extends \Zotlabs\Web\Controller { } $db_return_text = ''; if(x(\App::$data, 'db_installed')) { - $txt = '

'; - $txt .= t('Your site database has been installed.') . EOL; + $pass = 'Installation succeeded!'; + $icon = 'check'; + $txt = t('Your site database has been installed.') . EOL; $db_return_text .= $txt; } if(x(\App::$data, 'db_failed')) { + $pass = 'Database install failed!'; + $icon = 'exclamation-triangle'; $txt = t('You may need to import the file "install/schema_xxx.sql" manually using a database client.') . EOL; $txt .= t('Please see the file "install/INSTALL.txt".') . EOL ."


" ; - $txt .= "
".\App::$data['db_failed'] . "
". EOL ; + $txt .= "
" . \App::$data['db_failed'] . "
". EOL ; $db_return_text .= $txt; } if(\DBA::$dba && \DBA::$dba->connected) { @@ -217,8 +220,10 @@ class Setup extends \Zotlabs\Web\Controller { $tpl = get_markup_template('install.tpl'); return replace_macros($tpl, array( '$title' => $install_title, - '$pass' => '', - '$text' => $db_return_text . $this->what_next(), + '$icon' => $icon, + '$pass' => $pass, + '$text' => $db_return_text, + '$what_next' => $this->what_next() )); } @@ -395,7 +400,7 @@ class Setup extends \Zotlabs\Web\Controller { if(!$passed) { $help .= t('Could not find a command line version of PHP in the web server PATH.'). EOL; $help .= t('If you don\'t have a command line version of PHP installed on server, you will not be able to run background polling via cron.') . EOL; - $help .= EOL . EOL ; + $help .= EOL; $tpl = get_markup_template('field_input.tpl'); $help .= replace_macros($tpl, array( '$field' => array('phpath', t('PHP executable path'), $phpath, t('Enter full path to php executable. You can leave this blank to continue the installation.')), @@ -443,7 +448,7 @@ class Setup extends \Zotlabs\Web\Controller { userReadableSize($result['max_upload_filesize']), $result['max_file_uploads'] ); - $help .= '
' . t('You can adjust these settings in the server php.ini file.'); + $help .= '

' . t('You can adjust these settings in the server php.ini file.'); $this->check_add($checks, t('PHP upload limits'), true, false, $help); } @@ -735,12 +740,12 @@ class Setup extends \Zotlabs\Web\Controller { $baseurl = z_root(); return - t('

What next

') - ."

".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.') + t('

What next?

') + ."
".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.').EOL .t('Please see the file "install/INSTALL.txt".') - ."

" + ."

" .t("Go to your new hub registration page and register as new member. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.") - ."

"; + ."
"; } /** diff --git a/view/css/mod_setup.css b/view/css/mod_setup.css deleted file mode 100644 index f0d91a0ae..000000000 --- a/view/css/mod_setup.css +++ /dev/null @@ -1,40 +0,0 @@ -#install-dbhost-label, -#install-dbuser-label, -#install-dbpass-label, -#install-dbdata-label, -#install-tz-desc { - float: left; - width: 250px; - margin-top: 10px; - margin-bottom: 10px; - -} - -#install-dbhost, -#install-dbuser, -#install-dbpass, -#install-dbdata { - float: left; - width: 200px; - margin-left: 20px; -} - -#install-dbhost-end, -#install-dbuser-end, -#install-dbpass-end, -#install-dbdata-end, -#install-tz-end { - clear: both; -} - -#install-form select#timezone_select { - float: left; - margin-top: 18px; - margin-left: 20px; -} - -main { - max-width: 790px; - margin-left: auto; - margin-right: auto; -} diff --git a/view/php/mod_import.php b/view/php/mod_import.php deleted file mode 100644 index 56c4eff86..000000000 --- a/view/php/mod_import.php +++ /dev/null @@ -1,2 +0,0 @@ -{{$title}} -

{{$pass}}

+
+
+

{{$title}}

+
+

  {{$pass}}

+
+ {{if $status}} +
{{$status}}
+ {{/if}} -{{if $status}} -

{{$status}}

-{{/if}} - -{{$text}} +
{{$text}}
+
+ {{$what_next}} +
diff --git a/view/tpl/install_checks.tpl b/view/tpl/install_checks.tpl index ad0aef6a3..8bbb9f26d 100755 --- a/view/tpl/install_checks.tpl +++ b/view/tpl/install_checks.tpl @@ -1,24 +1,29 @@ -

{{$title}}

-

{{$pass}}

-
- -{{foreach $checks as $check}} - - {{if $check.help}} - - {{/if}} -{{/foreach}} -
{{$check.title}} {{if $check.required}}(required){{/if}}
{{$check.help}}
+
+
+

{{$title}}

+
+

  {{$pass}}

+
+ + + {{foreach $checks as $check}} + {{$check.title}} + {{if $check.help}} + + {{/if}} + {{/foreach}} +
{{if $check.required}}(required){{/if}}
{{$check.help}}
-{{if $phpath}} - -{{/if}} + {{if $phpath}} + + {{/if}} -{{if $passed}} - - -{{else}} - - -{{/if}} - + {{if $passed}} + + + {{else}} + + + {{/if}} + +
diff --git a/view/tpl/install_db.tpl b/view/tpl/install_db.tpl index 1a58de129..8b9023443 100755 --- a/view/tpl/install_db.tpl +++ b/view/tpl/install_db.tpl @@ -1,30 +1,31 @@ -

{{$title}}

-

{{$pass}}

- - -

-{{$info_01}}
-{{$info_02}}
-{{$info_03}} -

- -{{if $status}} -

{{$status}}

-{{/if}} - -
- - - - -{{include file="field_input.tpl" field=$dbhost}} -{{include file="field_input.tpl" field=$dbport}} -{{include file="field_input.tpl" field=$dbuser}} -{{include file="field_password.tpl" field=$dbpass}} -{{include file="field_input.tpl" field=$dbdata}} -{{include file="field_select.tpl" field=$dbtype}} - - - -
+
+
+

{{$title}}

+
+

  {{$pass}}

+
+
+ {{$info_01}}
+ {{$info_02}}
+ {{$info_03}} +
+ + {{if $status}} +
{{$status}}
+ {{/if}} + +
+ + + + {{include file="field_input.tpl" field=$dbhost}} + {{include file="field_input.tpl" field=$dbport}} + {{include file="field_input.tpl" field=$dbuser}} + {{include file="field_password.tpl" field=$dbpass}} + {{include file="field_input.tpl" field=$dbdata}} + {{include file="field_select.tpl" field=$dbtype}} + + +
+
diff --git a/view/tpl/install_settings.tpl b/view/tpl/install_settings.tpl index 62dcbb8b3..b62f8508b 100755 --- a/view/tpl/install_settings.tpl +++ b/view/tpl/install_settings.tpl @@ -1,28 +1,28 @@ -

{{$title}}

-

{{$pass}}

- - -{{if $status}} -

{{$status}}

-{{/if}} - -
- - - - - - - - - - -{{include file="field_input.tpl" field=$adminmail}} -{{include file="field_input.tpl" field=$siteurl}} - -{{include file="field_select_grouped.tpl" field=$timezone}} - - - -
- +
+
+

{{$title}}

+
+

  {{$pass}}

+
+ + {{if $status}} +
{{$status}}
+ {{/if}} + +
+ + + + + + + + + + {{include file="field_input.tpl" field=$adminmail}} + {{include file="field_input.tpl" field=$siteurl}} + {{include file="field_select_grouped.tpl" field=$timezone}} + + +
+
-- cgit v1.2.3 From 08c0d78296d4518a5ece4d6a2c05b9be83580aa8 Mon Sep 17 00:00:00 2001 From: git-marijus Date: Tue, 18 Jul 2017 13:56:09 +0200 Subject: issue #827 provide backward compatibility for album links generated in earlier times before the ambiguity of photo album names was solved. This may provide incorrect results if two or more photo albums with the same basename exist in different directories of the file tree; but there is no easy way to solve that ambiguity - which is why the link format changed. --- Zotlabs/Module/Photos.php | 2 +- include/photos.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index d993c481e..18d7abc48 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -689,7 +689,7 @@ class Photos extends \Zotlabs\Web\Controller { (SELECT resource_id, max(imgscale) imgscale FROM photo left join attach on folder = '%s' and photo.resource_id = attach.hash WHERE attach.uid = %d AND imgscale <= 4 AND photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY resource_id) ph ON (p.resource_id = ph.resource_id AND p.imgscale = ph.imgscale) ORDER BY created $order LIMIT %d OFFSET %d", - dbesc($datum), + dbesc($x['hash']), intval($owner_uid), intval(PHOTO_NORMAL), intval(PHOTO_PROFILE), diff --git a/include/photos.php b/include/photos.php index 6ea444e2e..f5d5fdb48 100644 --- a/include/photos.php +++ b/include/photos.php @@ -593,6 +593,15 @@ function photos_album_exists($channel_id, $observer_hash, $album) { intval($channel_id) ); + // partial backward compatibility with Hubzilla < 2.4 when we used the filename only + // (ambiguous which would get chosen if you had two albums of the same name in different directories) + if(!$r) { + $r = q("SELECT folder, hash, is_dir, filename, os_path, display_path FROM attach WHERE filename = '%s' AND is_dir = 1 AND uid = %d $sql_extra limit 1", + dbesc(hex2bin($album)), + intval($channel_id) + ); + } + return (($r) ? $r[0] : false); } -- cgit v1.2.3 From 229f95d55584008740ce50859ca54fd94c6db11f Mon Sep 17 00:00:00 2001 From: git-marijus Date: Tue, 18 Jul 2017 15:45:45 +0200 Subject: some fixes for the bs-default schema --- view/theme/redbasic/schema/BS-Default.css | 7 +++++++ view/theme/redbasic/schema/BS-Default.php | 20 +++++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) create mode 100644 view/theme/redbasic/schema/BS-Default.css diff --git a/view/theme/redbasic/schema/BS-Default.css b/view/theme/redbasic/schema/BS-Default.css new file mode 100644 index 000000000..9045d3b97 --- /dev/null +++ b/view/theme/redbasic/schema/BS-Default.css @@ -0,0 +1,7 @@ +.navbar-dark .navbar-toggler { + color: rgba(0,0,0,0.7); +} + +#notifications-btn.text-white { + color: #777 !important; +} diff --git a/view/theme/redbasic/schema/BS-Default.php b/view/theme/redbasic/schema/BS-Default.php index ce464fe2c..14ee130d9 100644 --- a/view/theme/redbasic/schema/BS-Default.php +++ b/view/theme/redbasic/schema/BS-Default.php @@ -1,22 +1,12 @@