Skip to content

Commit

Permalink
Removed MAX_CRUMBSi, moved MAX_DAYS to web interface
Browse files Browse the repository at this point in the history
MAX_CRUMBS is now hardcoded to 100, which is already way more than
anyone will ever need.

MAX_DAYS is now configurable from the webinterface

For issue #28
  • Loading branch information
jeroenrnl committed Dec 8, 2012
1 parent 9c8dda5 commit c875412
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion php/breadcrumbs.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
// action or a safe action ("edit", "delete", etc would be unsafe)
$page=array_reverse(explode("/",$_SERVER['PHP_SELF']));
$page=$page[0];
if (!isset($skipcrumb) && isset($title) && count($user->crumbs) < MAX_CRUMBS &&
if (!isset($skipcrumb) && isset($title) && count($user->crumbs) < 100 &&
(empty($_action) || ($_action == "display" ||
$_action == "search" || $_action == translate("search") ||
$_action == "notify" || $_action == "compose" ||
Expand Down
8 changes: 8 additions & 0 deletions php/classes/conf.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ private static function getDefault() {
$int_user_cli->setDefault(0);
$interface[]=$int_user_cli;

$int_max_days = new confItemString();
$int_max_days->setName("interface.max.days");
$int_max_days->setLabel("Maximum days");
$int_max_days->setDesc("The maximum days Zoph displays in a dropdown box for 'photos changed / made in the past ... days' on the search screen");
$int_max_days->setDefault("30");
$int_max_days->setRegex("^[1-9][0-9]{0,3}$");
$interface[]=$int_max_days;


/************************** SSL **************************/
$ssl = self::addGroup("ssl", "SSL");
Expand Down
6 changes: 4 additions & 2 deletions php/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,12 @@
// Deprecated: Modify through admin -> config in web interface.
//define('ALLOW_RATINGS', 1);

define('MAX_CRUMBS', 100);
// Deprecated: now hardcoded to 100
//define('MAX_CRUMBS', 100);

// max days for photos taken/modified X days ago pulldown
define('MAX_DAYS_PAST', 30);
// Deprecated: Modify through admin -> config in web interface.
//define('MAX_DAYS_PAST', 30);

// the maximum number of characters of a description to display
// under a thumbnail (see also desc_thumbnail pref). Set this
Expand Down
4 changes: 2 additions & 2 deletions php/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<?php echo create_inequality_operator_pulldown("_date_op[$i]", $_date_op[$i]) ?>
</td>
<td colspan="2">
<?php echo create_pulldown("date[$i]", $date[$i], get_date_select_array($today, MAX_DAYS_PAST)) ?>
<?php echo create_pulldown("date[$i]", $date[$i], get_date_select_array($today, conf::get("interface.max.days"))) ?>
<?php echo translate("days ago") ?>
</td>
</tr>
Expand Down Expand Up @@ -210,7 +210,7 @@
<?php echo create_inequality_operator_pulldown("_timestamp_op[$i]", $_timestamp_op[$i]) ?>
</td>
<td colspan="2">
<?php echo create_pulldown("timestamp[$i]", $timestamp[$i], get_date_select_array($today, MAX_DAYS_PAST)) ?>
<?php echo create_pulldown("timestamp[$i]", $timestamp[$i], get_date_select_array($today, conf::get("interface.max.days"))) ?>
<?php echo translate("days ago") ?>
</td>
</tr>
Expand Down

0 comments on commit c875412

Please sign in to comment.