Skip to content

Commit

Permalink
Fix Setup Bug - Minor CSS changes
Browse files Browse the repository at this point in the history
Fixed Setup Bug caused by undefined variables
Fixed Setup CSS for theme applications
Fixed CSS on version history
Added version history loading to show more or less
Added more language strings
Added Robots.txt
  • Loading branch information
causefx committed Mar 8, 2017
1 parent f9ca6ba commit 760f0da
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 19 deletions.
1 change: 1 addition & 0 deletions css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 33 additions & 10 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,34 @@ function getTimezone(){
endif;

$userpic = md5( strtolower( trim( $USER->email ) ) );
if(LOADINGICON !== "") : $loadingIcon = LOADINGICON; endif;
if(LOADINGICON !== "") :

$loadingIcon = LOADINGICON;

endif;

if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;

if($USER->authenticated) :

$showPic = "<img src='https://www.gravatar.com/avatar/$userpic?s=$userSize' class='img-circle'>";

else :

$showPic = "<img style='height: " . $userSize . "px'; src='images/login.png'>";

endif;

endif;

if(!defined('SLIMBAR')) : define('SLIMBAR', 'false'); endif;
if(!defined('LOADINGSCREEN')) : define('LOADINGSCREEN', 'true'); endif;
if(!isset($notifyExplode)) :

$notifyExplode = array("bar","slidetop");

endif;


if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;

Expand Down Expand Up @@ -759,7 +782,7 @@ function getTimezone(){

<a class="show-members">

<?php endif; endif; if($USER->authenticated) : $showPic = "<img src='https://www.gravatar.com/avatar/$userpic?s=$userSize' class='img-circle'>"; else : $showPic = "<img style='height: " . $userSize . "px'; src='images/login.png'>"; endif;?>
<?php endif; endif;?>

<i class="userpic"><?=$showPic;?></i>

Expand Down Expand Up @@ -807,7 +830,7 @@ function getTimezone(){

<!--Load Framed Content-->
<?php if($needSetup == "Yes" && $configReady == "Yes") : ?>
<div class="table-wrapper">
<div class="table-wrapper" style="background:<?=$sidebar;?>;">

<div class="table-row">

Expand All @@ -817,9 +840,9 @@ function getTimezone(){

<div class="content-box">

<div class="green-bg biggest-box">
<div class="biggest-box" style="background:<?=$topbar;?>;">

<h1 class="zero-m text-uppercase"><?php echo $language->translate("CREATE_ADMIN");?></h1>
<h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("CREATE_ADMIN");?></h1>

</div>

Expand Down Expand Up @@ -857,7 +880,7 @@ function getTimezone(){

</div>

<button id="registerSubmit" type="submit" class="btn green-bg btn-block btn-warning text-uppercase waves waves-effect waves-float" value="Register"><?php echo $language->translate("REGISTER");?></button>
<button id="registerSubmit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block text-uppercase waves waves-effect waves-float" value="Register"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("REGISTER");?></text></button>

</form>

Expand All @@ -876,7 +899,7 @@ function getTimezone(){


<?php if($needSetup == "Yes" && $configReady == "No") : ?>
<div class="table-wrapper">
<div class="table-wrapper" style="background:<?=$sidebar;?>;">

<div class="table-row">

Expand All @@ -886,9 +909,9 @@ function getTimezone(){

<div class="content-box">

<div class="green-bg biggest-box">
<div class="biggest-box" style="background:<?=$topbar;?>;">

<h1 class="zero-m text-uppercase"><?php echo $language->translate("DATABASE_PATH");?></h1>
<h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("DATABASE_PATH");?></h1>

</div>

Expand Down Expand Up @@ -923,7 +946,7 @@ function getTimezone(){

</div>

<button id="databaseLocationSubmit" type="submit" class="btn green-bg btn-block btn-sm text-uppercase waves waves-effect waves-float" value="Save Location"><?php echo $language->translate("SAVE_LOCATION");?></button>
<button style="background:<?=$topbar;?>;" id="databaseLocationSubmit" type="submit" class="btn btn-block btn-sm text-uppercase waves waves-effect waves-float" value="Save Location"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SAVE_LOCATION");?></text></button>

</form>

Expand Down
4 changes: 3 additions & 1 deletion lang/de.ini
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,6 @@ ENABLE_SLIMBAR = "Schmale Titelleiste aktivieren"
UPDATE_COMPLETE = "Organizer Version & Database Have Been Upgraded!"
ICON_COPY = "Icon Path Copied To Clipboard"
TEST_MESSAGE = "This is a test message"
TEST = "Test"
TEST = "Test"
SHOW_MORE = "Show More"
SHOW_LESS = "Show Less"
4 changes: 3 additions & 1 deletion lang/en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,6 @@ ENABLE_SLIMBAR = "Enable Slim Bar"
UPDATE_COMPLETE = "Organizer Version & Database Have Been Upgraded!"
ICON_COPY = "Icon Path Copied To Clipboard"
TEST_MESSAGE = "This is a test message"
TEST = "Test"
TEST = "Test"
SHOW_MORE = "Show More"
SHOW_LESS = "Show Less"
4 changes: 3 additions & 1 deletion lang/es.ini
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,6 @@ ENABLE_SLIMBAR = "Enable Slim Bar"
UPDATE_COMPLETE = "Organizer Version & Database Have Been Upgraded!"
ICON_COPY = "Icon Path Copied To Clipboard"
TEST_MESSAGE = "This is a test message"
TEST = "Test"
TEST = "Test"
SHOW_MORE = "Show More"
SHOW_LESS = "Show Less"
4 changes: 3 additions & 1 deletion lang/fr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,6 @@ ENABLE_SLIMBAR = "Enable Slim Bar"
UPDATE_COMPLETE = "Organizer Version & Database Have Been Upgraded!"
ICON_COPY = "Icon Path Copied To Clipboard"
TEST_MESSAGE = "This is a test message"
TEST = "Test"
TEST = "Test"
SHOW_MORE = "Show More"
SHOW_LESS = "Show Less"
4 changes: 3 additions & 1 deletion lang/it.ini
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,6 @@ ENABLE_SLIMBAR = "Enable Slim Bar"
UPDATE_COMPLETE = "Organizer Version & Database Have Been Upgraded!"
ICON_COPY = "Icon Path Copied To Clipboard"
TEST_MESSAGE = "This is a test message"
TEST = "Test"
TEST = "Test"
SHOW_MORE = "Show More"
SHOW_LESS = "Show Less"
4 changes: 3 additions & 1 deletion lang/nl.ini
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,6 @@ ENABLE_SLIMBAR = "Enable Slim Bar"
UPDATE_COMPLETE = "Organizer Version & Database Have Been Upgraded!"
ICON_COPY = "Icon Path Copied To Clipboard"
TEST_MESSAGE = "This is a test message"
TEST = "Test"
TEST = "Test"
SHOW_MORE = "Show More"
SHOW_LESS = "Show Less"
2 changes: 2 additions & 0 deletions robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /
108 changes: 105 additions & 3 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,59 @@ function get_browser_name() {

}

function getTimezone(){

$regions = array(
'Africa' => DateTimeZone::AFRICA,
'America' => DateTimeZone::AMERICA,
'Antarctica' => DateTimeZone::ANTARCTICA,
'Asia' => DateTimeZone::ASIA,
'Atlantic' => DateTimeZone::ATLANTIC,
'Europe' => DateTimeZone::EUROPE,
'Indian' => DateTimeZone::INDIAN,
'Pacific' => DateTimeZone::PACIFIC
);

$timezones = array();

foreach ($regions as $name => $mask) {

$zones = DateTimeZone::listIdentifiers($mask);

foreach($zones as $timezone) {

$time = new DateTime(NULL, new DateTimeZone($timezone));

$ampm = $time->format('H') > 12 ? ' ('. $time->format('g:i a'). ')' : '';

$timezones[$name][$timezone] = substr($timezone, strlen($name) + 1) . ' - ' . $time->format('H:i') . $ampm;

}

}

print '<select name="timezone" id="timezone" class="form-control material input-sm" required>';

foreach($timezones as $region => $list) {

print '<optgroup label="' . $region . '">' . "\n";

foreach($list as $timezone => $name) {

if($timezone == TIMEZONE) : $selected = " selected"; else : $selected = ""; endif;

print '<option value="' . $timezone . '"' . $selected . '>' . $name . '</option>' . "\n";

}

print '</optgroup>' . "\n";

}

print '</select>';

}

$dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
$databaseLocation = "databaseLocation.ini.php";
$userdirpath = USER_HOME;
Expand Down Expand Up @@ -1180,7 +1233,7 @@ function rcopy($src, $dst) {

<div class="form-group">

<input type="text" class="form-control material input-sm" name="timezone" placeholder="<?php echo $language->translate("SET_TIMEZONE");?>" value="<?php echo TIMEZONE;?>">
<?php echo getTimezone();?>
<p class="help-text"><?php echo $language->translate("SET_TIMEZONE");?></p>

</div>
Expand Down Expand Up @@ -1735,6 +1788,22 @@ function getColor($colorTest){

</ul>

<div class="btn-group-sm btn-group btn-group-justified">

<div id="loadMore" class="btn-group" role="group">

<button type="button" class="btn waves btn-primary waves-effect waves-float text-uppercase"><?php echo $language->translate("SHOW_MORE");?></button>

</div>

<div id="showLess" class="btn-group" role="group">

<button type="button" class="btn waves btn-warning waves-effect waves-float text-uppercase"><?php echo $language->translate("SHOW_LESS");?></button>

</div>

</div>

</div>

</div>
Expand Down Expand Up @@ -2287,7 +2356,34 @@ function set(key, value){

});

$('#showLess').hide();

$('#loadMore').click(function () {

x= (x+5 <= size_li) ? x+5 : size_li;

$('#versionHistory li:lt('+x+')').show();

$('#showLess').show();

if(x == size_li){

$('#loadMore').hide();

}

});

$('#showLess').click(function () {

$('#versionHistory li').not(':lt(2)').hide();

$('#loadMore').show();

$('#showLess').hide();

});

$('.icp-auto').iconpicker({placement: 'left', hideOnSelect: false, collision: true});

$("li[class^='list-group-item']").bind('mouseheld', function(e) {
Expand Down Expand Up @@ -2568,7 +2664,7 @@ function changeColor(elementName, elementColor) {
dataType: "json",
success: function(github) {

var currentVersion = "0.99997";
var currentVersion = "0.99998";

infoTabVersion = $('#about').find('#version');
infoTabVersionHistory = $('#about').find('#versionHistory');
Expand All @@ -2585,8 +2681,14 @@ function changeColor(elementName, elementColor) {

}

$(infoTabVersionHistory).append('<li><time class="cbp_tmtime" datetime="' + v.published_at + '"><span>' + v.published_at.substring(0,10) + '</span> <span class="label label-default">' + v.tag_name + '</span></time><div class="cbp_tmicon cbp_tmicon-earth animated jello"></div><div class="cbp_tmlabel"><h2 class="text-uppercase">' + v.name + '</h2><p>' + v.body + '</p></div></li>');
$(infoTabVersionHistory).append('<li style="display: none"><time class="cbp_tmtime" datetime="' + v.published_at + '"><span>' + v.published_at.substring(0,10) + '</span> <span>' + v.tag_name + '</span></time><div class="cbp_tmicon cbp_tmicon-earth animated jello"></div><div class="cbp_tmlabel"><h2 class="text-uppercase">' + v.name + '</h2><p>' + v.body + '</p></div></li>');

size_li = $("#versionHistory li").size();

x=2;

$('#versionHistory li:lt('+x+')').show();

});

if(currentVersion < githubVersion){
Expand Down
6 changes: 6 additions & 0 deletions user.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ function resetSession()
{
$_SESSION["username"] = User::GUEST_USER;
$_SESSION["token"] = -1;
unset($_COOKIE['Organizr']);
setcookie('Organizr', '', time() - 3600, '/');
unset($_COOKIE['OrganizrU']);
setcookie('OrganizrU', '', time() - 3600, '/');
unset($_COOKIE['cookiePassword']);
setcookie("cookiePassword", '', time() - 3600, '/');
}

/**
Expand Down

0 comments on commit 760f0da

Please sign in to comment.