Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge

This commit is contained in:
zotlabs 2017-07-18 19:16:47 -07:00
commit b52a968c74
12 changed files with 122 additions and 149 deletions

View File

@ -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 (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) ON (p.resource_id = ph.resource_id AND p.imgscale = ph.imgscale)
ORDER BY created $order LIMIT %d OFFSET %d", ORDER BY created $order LIMIT %d OFFSET %d",
dbesc($datum), dbesc($x['hash']),
intval($owner_uid), intval($owner_uid),
intval(PHOTO_NORMAL), intval(PHOTO_NORMAL),
intval(PHOTO_PROFILE), intval(PHOTO_PROFILE),

View File

@ -186,14 +186,17 @@ class Setup extends \Zotlabs\Web\Controller {
} }
$db_return_text = ''; $db_return_text = '';
if(x(\App::$data, 'db_installed')) { if(x(\App::$data, 'db_installed')) {
$txt = '<p style="font-size: 130%;">'; $pass = 'Installation succeeded!';
$txt .= t('Your site database has been installed.') . EOL; $icon = 'check';
$txt = t('Your site database has been installed.') . EOL;
$db_return_text .= $txt; $db_return_text .= $txt;
} }
if(x(\App::$data, 'db_failed')) { 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('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 ."<hr>" ; $txt .= t('Please see the file "install/INSTALL.txt".') . EOL ."<hr>" ;
$txt .= "<pre>".\App::$data['db_failed'] . "</pre>". EOL ; $txt .= "<pre>" . \App::$data['db_failed'] . "</pre>". EOL ;
$db_return_text .= $txt; $db_return_text .= $txt;
} }
if(\DBA::$dba && \DBA::$dba->connected) { if(\DBA::$dba && \DBA::$dba->connected) {
@ -217,8 +220,10 @@ class Setup extends \Zotlabs\Web\Controller {
$tpl = get_markup_template('install.tpl'); $tpl = get_markup_template('install.tpl');
return replace_macros($tpl, array( return replace_macros($tpl, array(
'$title' => $install_title, '$title' => $install_title,
'$pass' => '', '$icon' => $icon,
'$text' => $db_return_text . $this->what_next(), '$pass' => $pass,
'$text' => $db_return_text,
'$what_next' => $this->what_next()
)); ));
} }
@ -395,7 +400,7 @@ class Setup extends \Zotlabs\Web\Controller {
if(!$passed) { if(!$passed) {
$help .= t('Could not find a command line version of PHP in the web server PATH.'). EOL; $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 .= 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'); $tpl = get_markup_template('field_input.tpl');
$help .= replace_macros($tpl, array( $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.')), '$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']), userReadableSize($result['max_upload_filesize']),
$result['max_file_uploads'] $result['max_file_uploads']
); );
$help .= '<br>' . t('You can adjust these settings in the server php.ini file.'); $help .= '<br><br>' . t('You can adjust these settings in the server php.ini file.');
$this->check_add($checks, t('PHP upload limits'), true, false, $help); $this->check_add($checks, t('PHP upload limits'), true, false, $help);
} }
@ -735,12 +740,12 @@ class Setup extends \Zotlabs\Web\Controller {
$baseurl = z_root(); $baseurl = z_root();
return return
t('<h1>What next</h1>') t('<h1>What next?</h1>')
."<p>".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.') ."<div class=\"alert alert-info\">".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.').EOL
.t('Please see the file "install/INSTALL.txt".') .t('Please see the file "install/INSTALL.txt".')
."</p><p>" ."</div><div>"
.t("Go to your new hub <a href='$baseurl/register'>registration page</a> 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.") .t("Go to your new hub <a href='$baseurl/register'>registration page</a> 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.")
."</p>"; ."</div>";
} }
/** /**

View File

@ -595,8 +595,7 @@ function photos_album_exists($channel_id, $observer_hash, $album) {
// partial backward compatibility with Hubzilla < 2.4 when we used the filename only // 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) // (ambiguous which would get chosen if you had two albums of the same name in different directories)
if(!$r) {
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", $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)), dbesc(hex2bin($album)),
intval($channel_id) intval($channel_id)

View File

@ -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;
}

View File

@ -1,2 +0,0 @@
<?php
App::$page['template'] = 'full';

2
view/php/mod_setup.php Normal file
View File

@ -0,0 +1,2 @@
<?php
App::$page['template'] = 'zen';

View File

@ -0,0 +1,7 @@
.navbar-dark .navbar-toggler {
color: rgba(0,0,0,0.7);
}
#notifications-btn.text-white {
color: #777 !important;
}

View File

@ -1,22 +1,12 @@
<?php <?php
if (! $nav_bg) if (! $nav_bg)
$nav_bg = "#f8f8f8"; $nav_bg = "#f8f9fa";
if (! $nav_bd)
$nav_bd = "#e7e7e7";
if (! $nav_gradient_top)
$nav_gradient_top = "#fff";
if (! $nav_gradient_bottom)
$nav_gradient_bottom = "#f8f8f8";
if (! $nav_active_gradient_top)
$nav_active_gradient_top = "#ebebeb";
if (! $nav_active_gradient_bottom)
$nav_active_gradient_bottom = "#f3f3f3";
if (! $nav_icon_colour) if (! $nav_icon_colour)
$nav_icon_colour = "#777"; $nav_icon_colour = "rgba(0, 0, 0, 0.5);";
if (! $nav_active_icon_colour) if (! $nav_active_icon_colour)
$nav_active_icon_colour = "#555"; $nav_active_icon_colour = "rgba(0, 0, 0, 0.7)";
if (! $radius) if (! $radius)
$radius = "4"; $radius = "4px";
if (! $banner_colour) if (! $banner_colour)
$banner_colour = "#777"; $banner_colour = "rgba(0, 0, 0, 0.7)";

View File

@ -1,9 +1,15 @@
<h1>{{$title}}</h1> <div class="container mt-4 mb-4">
<h2>{{$pass}}</h2> <div class="jumbotron">
<h1>{{$title}}</h1>
<hr class="my-4">
<h2><i class="fa fa-{{$icon}}"></i>&nbsp; {{$pass}}</h2>
</div>
{{if $status}}
<div class="alert alert-danger">{{$status}}</div>
{{/if}}
{{if $status}} <div class="alert alert-info">{{$text}}</div>
<h3 class="error-message">{{$status}}</h3> <br>
{{/if}} {{$what_next}}
</div>
{{$text}}

View File

@ -1,24 +1,29 @@
<h1>{{$title}}</h1> <div class="container mt-4 mb-4">
<h2>{{$pass}}</h2> <div class="jumbotron">
<form action="{{$baseurl}}/index.php?q=setup" method="post"> <h1>{{$title}}</h1>
<table> <hr class="my-4">
{{foreach $checks as $check}} <h2><i class="fa fa-heartbeat"></i>&nbsp; {{$pass}}</h2>
<tr><td>{{$check.title}} </td><td><i class="fa {{if $check.status}}fa-check-square-o{{else}}{{if $check.required}}fa-square-o{{else}}fa-exclamation{{/if}}{{/if}}"></i></td><td>{{if $check.required}}(required){{/if}}</td></tr> </div>
{{if $check.help}} <form action="{{$baseurl}}/index.php?q=setup" method="post">
<tr><td colspan="3"><blockquote>{{$check.help}}</blockquote></td></tr> <table class="table">
{{/if}} {{foreach $checks as $check}}
{{/foreach}} <tr><td{{if ! $check.status}} class="text-danger"{{/if}}>{{$check.title}}</td><td><i class="fa {{if $check.status}}fa-check-square-o{{else}}{{if $check.required}}fa-square-o{{else}}fa-exclamation text-danger{{/if}}{{/if}}"></i></td><td>{{if $check.required}}(required){{/if}}</td></tr>
</table> {{if $check.help}}
<tr><td colspan="3" class="border-top-0 pt-0 pb-0"><div class="alert alert-info">{{$check.help}}</div></td></tr>
{{/if}}
{{/foreach}}
</table>
{{if $phpath}} {{if $phpath}}
<input type="hidden" name="phpath" value="{{$phpath}}"> <input type="hidden" name="phpath" value="{{$phpath}}">
{{/if}} {{/if}}
{{if $passed}} {{if $passed}}
<input type="hidden" name="pass" value="2"> <input type="hidden" name="pass" value="2">
<input type="submit" value="{{$next}}"> <button class="btn btn-success" type="submit"><i class="fa fa-check"></i> {{$next}}</button>
{{else}} {{else}}
<input type="hidden" name="pass" value="1"> <input type="hidden" name="pass" value="1">
<input type="submit" value="{{$reload}}"> <button class="btn btn-warning" type="submit"><i class="fa fa-refresh"></i> {{$reload}}</button>
{{/if}} {{/if}}
</form> </form>
</div>

View File

@ -1,30 +1,31 @@
<h1>{{$title}}</h1> <div class="container mt-4 mb-4">
<h2>{{$pass}}</h2> <div class="jumbotron">
<h1>{{$title}}</h1>
<hr class="my-4">
<h2><i class="fa fa-database"></i>&nbsp; {{$pass}}</h2>
</div>
<div class="alert alert-info">
{{$info_01}}<br>
{{$info_02}}<br>
{{$info_03}}
</div>
{{if $status}}
<div class="alert alert-danger">{{$status}}</div>
{{/if}}
<p> <form id="install-form" action="{{$baseurl}}/setup" method="post">
{{$info_01}}<br> <input type="hidden" name="phpath" value="{{$phpath}}" />
{{$info_02}}<br> <input type="hidden" name="pass" value="3" />
{{$info_03}}
</p>
{{if $status}} {{include file="field_input.tpl" field=$dbhost}}
<h3 class="error-message">{{$status}}</h3> {{include file="field_input.tpl" field=$dbport}}
{{/if}} {{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}}
<form id="install-form" action="{{$baseurl}}/setup" method="post"> <button class="btn btn-primary" id="install-submit" type="submit" name="submit" value="{{$submit}}">{{$submit}}</button>
</form>
<input type="hidden" name="phpath" value="{{$phpath}}" /> </div>
<input type="hidden" name="pass" value="3" />
{{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}}
<input id="install-submit" type="submit" name="submit" value="{{$submit}}" />
</form>

View File

@ -1,28 +1,28 @@
<h1>{{$title}}</h1> <div class="container mt-4 mb-4">
<h2>{{$pass}}</h2> <div class="jumbotron">
<h1>{{$title}}</h1>
<hr class="my-4">
<h2><i class="fa fa-cogs"></i>&nbsp; {{$pass}}</h2>
</div>
{{if $status}}
<div class="alert alert-danger">{{$status}}</div>
{{/if}}
{{if $status}} <form id="install-form" action="{{$baseurl}}/setup" method="post">
<h3 class="error-message">{{$status}}</h3> <input type="hidden" name="phpath" value="{{$phpath}}" />
{{/if}} <input type="hidden" name="dbhost" value="{{$dbhost}}" />
<input type="hidden" name="dbport" value="{{$dbport}}" />
<input type="hidden" name="dbuser" value="{{$dbuser}}" />
<input type="hidden" name="dbpass" value="{{$dbpass}}" />
<input type="hidden" name="dbdata" value="{{$dbdata}}" />
<input type="hidden" name="dbtype" value="{{$dbtype}}" />
<input type="hidden" name="pass" value="4" />
<form id="install-form" action="{{$baseurl}}/setup" method="post"> {{include file="field_input.tpl" field=$adminmail}}
{{include file="field_input.tpl" field=$siteurl}}
<input type="hidden" name="phpath" value="{{$phpath}}" /> {{include file="field_select_grouped.tpl" field=$timezone}}
<input type="hidden" name="dbhost" value="{{$dbhost}}" />
<input type="hidden" name="dbport" value="{{$dbport}}" />
<input type="hidden" name="dbuser" value="{{$dbuser}}" />
<input type="hidden" name="dbpass" value="{{$dbpass}}" />
<input type="hidden" name="dbdata" value="{{$dbdata}}" />
<input type="hidden" name="dbtype" value="{{$dbtype}}" />
<input type="hidden" name="pass" value="4" />
{{include file="field_input.tpl" field=$adminmail}}
{{include file="field_input.tpl" field=$siteurl}}
{{include file="field_select_grouped.tpl" field=$timezone}}
<input id="install-submit" type="submit" name="submit" value="{{$submit}}" />
</form>
<button class="btn btn-primary" id="install-submit" type="submit" name="submit" value="{{$submit}}">{{$submit}}</button>
</form>
</div>