$a->config[$uid][$family][$k] = $rr['v'];
self::$in_db[$uid][$family][$k] = true;
}
- } else if ($family != 'config') {
+ } elseif ($family != 'config') {
// Negative caching
$a->config[$uid][$family] = "!<unset>!";
}
private function _get_var($name, $retNoKey = false) {
$keys = array_map('trim', explode(".", $name));
- if ($retNoKey && !array_key_exists($keys[0], $this->r))
+ if ($retNoKey && !array_key_exists($keys[0], $this->r)) {
return KEY_NOT_EXISTS;
+ }
$val = $this->r;
foreach ($keys as $k) {
$val = (isset($val[$k]) ? $val[$k] : null);
if (strpos($args[2], "==") > 0) {
list($a, $b) = array_map("trim", explode("==", $args[2]));
$a = $this->_get_var($a);
- if ($b[0] == "$")
+ if ($b[0] == "$") {
$b = $this->_get_var($b);
+ }
$val = ($a == $b);
- } else if (strpos($args[2], "!=") > 0) {
+ } elseif (strpos($args[2], "!=") > 0) {
list($a, $b) = array_map("trim", explode("!=", $args[2]));
$a = $this->_get_var($a);
- if ($b[0] == "$")
+ if ($b[0] == "$") {
$b = $this->_get_var($b);
+ }
$val = ($a != $b);
} else {
$val = $this->_get_var($args[2]);
$newctx = null;
}
- if ($tplfile[0] == "$")
+ if ($tplfile[0] == "$") {
$tplfile = $this->_get_var($tplfile);
+ }
$this->_push_stack();
$r = $this->r;
$notifs = $nm->introNotifs($all, $startrec, $perpage);
// Get the network notifications
- } else if (($a->argc > 1) && ($a->argv[1] == 'network')) {
+ } elseif (($a->argc > 1) && ($a->argv[1] == 'network')) {
$notif_header = t('Network Notifications');
$notifs = $nm->networkNotifs($show, $startrec, $perpage);
// Get the system notifications
- } else if (($a->argc > 1) && ($a->argv[1] == 'system')) {
+ } elseif (($a->argc > 1) && ($a->argv[1] == 'system')) {
$notif_header = t('System Notifications');
$notifs = $nm->systemNotifs($show, $startrec, $perpage);
// Get the personal notifications
- } else if (($a->argc > 1) && ($a->argv[1] == 'personal')) {
+ } elseif (($a->argc > 1) && ($a->argv[1] == 'personal')) {
$notif_header = t('Personal Notifications');
$notifs = $nm->personalNotifs($show, $startrec, $perpage);
// Get the home notifications
- } else if (($a->argc > 1) && ($a->argv[1] == 'home')) {
+ } elseif (($a->argc > 1) && ($a->argv[1] == 'home')) {
$notif_header = t('Home Notifications');
$notifs = $nm->homeNotifs($show, $startrec, $perpage);
// check for valid hub_mode
if ($hub_mode === 'subscribe') {
$subscribe = 1;
- } else if ($hub_mode === 'unsubscribe') {
+ } elseif ($hub_mode === 'unsubscribe') {
$subscribe = 0;
} else {
logger("pubsubhubbub: invalid hub_mode=$hub_mode, ignoring.");
set_template_engine($a, 'smarty3');
- $colorset = get_pconfig( local_user(), 'duepuntozero','colorset');
- if (!$colorset)
- $colorset = get_config('duepuntozero', 'colorset'); // user setting have priority, then node settings
- if ($colorset) {
- if ($colorset == 'greenzero')
- $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
- if ($colorset == 'purplezero')
- $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
- if ($colorset == 'easterbunny')
- $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
- if ($colorset == 'darkzero')
- $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n";
- if ($colorset == 'comix')
- $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
- if ($colorset == 'slackr')
- $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
- }
+$colorset = get_pconfig( local_user(), 'duepuntozero','colorset');
+if (!$colorset) {
+ $colorset = get_config('duepuntozero', 'colorset'); // user setting have priority, then node settings
+}
+if ($colorset) {
+ if ($colorset == 'greenzero') {
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
+ }
+ if ($colorset == 'purplezero') {
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
+ }
+ if ($colorset == 'easterbunny') {
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
+ }
+ if ($colorset == 'darkzero') {
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n";
+ }
+ if ($colorset == 'comix') {
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
+ }
+ if ($colorset == 'slackr') {
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
+ }
+}
$a->page['htmlhead'] .= <<< EOT
<script>
function insertFormatting(BBcode, id) {
/**
* A color utility that helps manipulate HEX colors
+ * @todo convert space -> tab
*/
class Color {
// Make sure it's 6 digits
if ( strlen($color) === 3 ) {
$color = $color[0].$color[0].$color[1].$color[1].$color[2].$color[2];
- } else if ( strlen($color) != 6 ) {
+ } elseif ( strlen($color) != 6 ) {
throw new Exception("HEX color needs to be 6 or 3 digits long");
}
// Make sure it's 6 digits
if ( strlen($color) == 3 ) {
$color = $color[0].$color[0].$color[1].$color[1].$color[2].$color[2];
- } else if ( strlen($color) != 6 ) {
+ } elseif ( strlen($color) != 6 ) {
throw new Exception("HEX color needs to be 6 or 3 digits long");
}