Use short form array syntax everywhere
- Add short form array syntax to po2php.php generation
This commit is contained in:
parent
77dfbaa0bf
commit
e36f2bb1fb
212 changed files with 5160 additions and 5160 deletions
|
@ -45,7 +45,7 @@ function theme_admin_post(App $a) {
|
|||
|
||||
/// @TODO $a is no longer used
|
||||
function clean_form(App $a, &$colorset, $user) {
|
||||
$colorset = array(
|
||||
$colorset = [
|
||||
'default' =>t('default'),
|
||||
'greenzero' =>t('greenzero'),
|
||||
'purplezero' =>t('purplezero'),
|
||||
|
@ -53,7 +53,7 @@ function clean_form(App $a, &$colorset, $user) {
|
|||
'darkzero' =>t('darkzero'),
|
||||
'comix' =>t('comix'),
|
||||
'slackr' =>t('slackr'),
|
||||
);
|
||||
];
|
||||
|
||||
if ($user) {
|
||||
$color = PConfig::get(local_user(), 'duepuntozero', 'colorset');
|
||||
|
@ -63,12 +63,12 @@ function clean_form(App $a, &$colorset, $user) {
|
|||
|
||||
$t = get_markup_template("theme_settings.tpl" );
|
||||
/// @TODO No need for adding string here, $o is not defined
|
||||
$o .= replace_macros($t, array(
|
||||
$o .= replace_macros($t, [
|
||||
'$submit' => t('Submit'),
|
||||
'$baseurl' => System::baseUrl(),
|
||||
'$title' => t("Theme settings"),
|
||||
'$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset),
|
||||
));
|
||||
'$colorset' => ['duepuntozero_colorset', t('Variations'), $color, '', $colorset],
|
||||
]);
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ function theme_content(App $a) {
|
|||
if (!local_user()) {
|
||||
return;
|
||||
}
|
||||
$arr = array();
|
||||
$arr = [];
|
||||
|
||||
$arr["schema"] = PConfig::get(local_user(), 'frio', 'schema');
|
||||
$arr["nav_bg"] = PConfig::get(local_user(), 'frio', 'nav_bg');
|
||||
|
@ -66,7 +66,7 @@ function theme_admin(App $a) {
|
|||
if (!local_user()) {
|
||||
return;
|
||||
}
|
||||
$arr = array();
|
||||
$arr = [];
|
||||
|
||||
$arr["schema"] = Config::get('frio', 'schema');
|
||||
$arr["nav_bg"] = Config::get('frio', 'nav_bg');
|
||||
|
@ -87,10 +87,10 @@ function frio_form($arr) {
|
|||
$scheme_info = get_schema_info($arr["schema"]);
|
||||
$disable = $scheme_info["overwrites"];
|
||||
if (!is_array($disable)) {
|
||||
$disable = array();
|
||||
$disable = [];
|
||||
}
|
||||
|
||||
$scheme_choices = array();
|
||||
$scheme_choices = [];
|
||||
$scheme_choices["---"] = t("Default");
|
||||
$files = glob('view/theme/frio/schema/*.php');
|
||||
if ($files) {
|
||||
|
@ -106,22 +106,22 @@ function frio_form($arr) {
|
|||
$background_image_help = "<strong>" . t("Note"). ": </strong>".t("Check image permissions if all users are allowed to visit the image");
|
||||
|
||||
$t = get_markup_template('theme_settings.tpl');
|
||||
$ctx = array(
|
||||
$ctx = [
|
||||
'$submit' => t('Submit'),
|
||||
'$baseurl' => System::baseUrl(),
|
||||
'$title' => t("Theme settings"),
|
||||
'$schema' => array('frio_schema', t("Select scheme"), $arr["schema"], '', $scheme_choices),
|
||||
'$nav_bg' => array_key_exists("nav_bg", $disable) ? "" : array('frio_nav_bg', t('Navigation bar background color'), $arr['nav_bg']),
|
||||
'$nav_icon_color' => array_key_exists("nav_icon_color", $disable) ? "" : array('frio_nav_icon_color', t('Navigation bar icon color '), $arr['nav_icon_color']),
|
||||
'$link_color' => array_key_exists("link_color", $disable) ? "" : array('frio_link_color', t('Link color'), $arr['link_color'], '', $link_colors),
|
||||
'$bgcolor' => array_key_exists("bgcolor", $disable) ? "" : array('frio_background_color', t('Set the background color'), $arr['bgcolor']),
|
||||
'$contentbg_transp' => array_key_exists("contentbg_transp", $disable) ? "" : array('frio_contentbg_transp', t("Content background transparency"), ((isset($arr["contentbg_transp"]) && $arr["contentbg_transp"] != "") ? $arr["contentbg_transp"] : 100)),
|
||||
'$background_image' => array_key_exists("background_image", $disable ) ? "" : array('frio_background_image', t('Set the background image'), $arr['background_image'], $background_image_help),
|
||||
'$schema' => ['frio_schema', t("Select scheme"), $arr["schema"], '', $scheme_choices],
|
||||
'$nav_bg' => array_key_exists("nav_bg", $disable) ? "" : ['frio_nav_bg', t('Navigation bar background color'), $arr['nav_bg']],
|
||||
'$nav_icon_color' => array_key_exists("nav_icon_color", $disable) ? "" : ['frio_nav_icon_color', t('Navigation bar icon color '), $arr['nav_icon_color']],
|
||||
'$link_color' => array_key_exists("link_color", $disable) ? "" : ['frio_link_color', t('Link color'), $arr['link_color'], '', $link_colors],
|
||||
'$bgcolor' => array_key_exists("bgcolor", $disable) ? "" : ['frio_background_color', t('Set the background color'), $arr['bgcolor']],
|
||||
'$contentbg_transp' => array_key_exists("contentbg_transp", $disable) ? "" : ['frio_contentbg_transp', t("Content background transparency"), ((isset($arr["contentbg_transp"]) && $arr["contentbg_transp"] != "") ? $arr["contentbg_transp"] : 100)],
|
||||
'$background_image' => array_key_exists("background_image", $disable ) ? "" : ['frio_background_image', t('Set the background image'), $arr['background_image'], $background_image_help],
|
||||
'$bg_image_options' => Image::get_options($arr),
|
||||
);
|
||||
];
|
||||
|
||||
if ( array_key_exists("login_bg_image", $arr ) && !array_key_exists("login_bg_image", $disable ) ) {
|
||||
$ctx['$login_bg_image'] = array('frio_login_bg_image', t('Login page background image'), $arr['login_bg_image'], $background_image_help);
|
||||
if ( array_key_exists("login_bg_image", $arr ) && !array_key_exists("login_bg_image", $disable ) ) {
|
||||
$ctx['$login_bg_image'] = ['frio_login_bg_image', t('Login page background image'), $arr['login_bg_image'], $background_image_help];
|
||||
}
|
||||
|
||||
$o .= replace_macros($t, $ctx);
|
||||
|
|
|
@ -12,22 +12,22 @@ class Image {
|
|||
|
||||
/**
|
||||
* @brief Give all available options for the background image
|
||||
*
|
||||
*
|
||||
* @param array $arr Array with the present user settings
|
||||
*
|
||||
*
|
||||
* @return array Array with the immage options
|
||||
*/
|
||||
public static function get_options($arr) {
|
||||
$bg_image_options = array(
|
||||
'repeat' => array(
|
||||
'frio_bg_image_option', t("Repeat the image"), "repeat", t("Will repeat your image to fill the background."), ($arr["bg_image_option"] == "repeat")),
|
||||
'stretch' => array(
|
||||
'frio_bg_image_option', t("Stretch"), "stretch", t("Will stretch to width/height of the image."), ($arr["bg_image_option"] == "stretch")),
|
||||
'cover' => array(
|
||||
'frio_bg_image_option', t("Resize fill and-clip"), "cover", t("Resize to fill and retain aspect ratio."), ($arr["bg_image_option"] == "cover")),
|
||||
'contain' => array(
|
||||
'frio_bg_image_option', t("Resize best fit"), "contain", t("Resize to best fit and retain aspect ratio."), ($arr["bg_image_option"] == "contain")),
|
||||
);
|
||||
$bg_image_options = [
|
||||
'repeat' => [
|
||||
'frio_bg_image_option', t("Repeat the image"), "repeat", t("Will repeat your image to fill the background."), ($arr["bg_image_option"] == "repeat")],
|
||||
'stretch' => [
|
||||
'frio_bg_image_option', t("Stretch"), "stretch", t("Will stretch to width/height of the image."), ($arr["bg_image_option"] == "stretch")],
|
||||
'cover' => [
|
||||
'frio_bg_image_option', t("Resize fill and-clip"), "cover", t("Resize to fill and retain aspect ratio."), ($arr["bg_image_option"] == "cover")],
|
||||
'contain' => [
|
||||
'frio_bg_image_option', t("Resize best fit"), "contain", t("Resize to best fit and retain aspect ratio."), ($arr["bg_image_option"] == "contain")],
|
||||
];
|
||||
|
||||
return $bg_image_options;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ class Color {
|
|||
$G = hexdec($color[2].$color[3]);
|
||||
$B = hexdec($color[4].$color[5]);
|
||||
|
||||
$HSL = array();
|
||||
$HSL = [];
|
||||
|
||||
$var_R = ($R / 255);
|
||||
$var_G = ($G / 255);
|
||||
|
@ -110,13 +110,13 @@ class Color {
|
|||
* @return string HEX string
|
||||
* @throws Exception "Bad HSL Array"
|
||||
*/
|
||||
public static function hslToHex( $hsl = array() ){
|
||||
public static function hslToHex( $hsl = [] ){
|
||||
// Make sure it's HSL
|
||||
if(empty($hsl) || !isset($hsl["H"]) || !isset($hsl["S"]) || !isset($hsl["L"]) ) {
|
||||
throw new Exception("Param was not an HSL array");
|
||||
}
|
||||
|
||||
list($H,$S,$L) = array( $hsl['H']/360,$hsl['S'],$hsl['L'] );
|
||||
list($H,$S,$L) = [ $hsl['H']/360,$hsl['S'],$hsl['L'] ];
|
||||
|
||||
if( $S == 0 ) {
|
||||
$r = $L * 255;
|
||||
|
@ -181,7 +181,7 @@ class Color {
|
|||
* @return string RGB string
|
||||
* @throws Exception "Bad RGB Array"
|
||||
*/
|
||||
public static function rgbToHex( $rgb = array() ){
|
||||
public static function rgbToHex( $rgb = [] ){
|
||||
// Make sure it's RGB
|
||||
if(empty($rgb) || !isset($rgb["R"]) || !isset($rgb["G"]) || !isset($rgb["B"]) ) {
|
||||
throw new Exception("Param was not an RGB array");
|
||||
|
@ -253,7 +253,7 @@ class Color {
|
|||
}
|
||||
|
||||
// Return our gradient array
|
||||
return array( "light" => $lightColor, "dark" => $darkColor );
|
||||
return [ "light" => $lightColor, "dark" => $darkColor ];
|
||||
}
|
||||
|
||||
|
||||
|
@ -308,7 +308,7 @@ class Color {
|
|||
// Return the new value in HEX
|
||||
return self::hslToHex($hsl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns your color's HSL array
|
||||
*/
|
||||
|
@ -327,7 +327,7 @@ class Color {
|
|||
public function getRgb() {
|
||||
return $this->_rgb;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the cross browser CSS3 gradient
|
||||
* @param int $amount Optional: percentage amount to light/darken the gradient
|
||||
|
@ -435,7 +435,7 @@ class Color {
|
|||
$gmix = (($rgb1['G'] * $r1) + ($rgb2['G'] * $r2)) / 2;
|
||||
$bmix = (($rgb1['B'] * $r1) + ($rgb2['B'] * $r2)) / 2;
|
||||
|
||||
return array('R' => $rmix, 'G' => $gmix, 'B' => $bmix);
|
||||
return ['R' => $rmix, 'G' => $gmix, 'B' => $bmix];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -63,12 +63,12 @@ function is_modal() {
|
|||
*/
|
||||
function get_modalpage_list() {
|
||||
//Arry of pages wich getting bootstrap modal dialogs
|
||||
$modalpages = array('poke/',
|
||||
$modalpages = ['poke/',
|
||||
'message/new',
|
||||
'settings/oauth/add',
|
||||
'events/new',
|
||||
// 'fbrowser/image/'
|
||||
);
|
||||
];
|
||||
|
||||
return $modalpages;
|
||||
}
|
||||
|
@ -83,9 +83,9 @@ function get_modalpage_list() {
|
|||
*/
|
||||
function get_standard_page_list() {
|
||||
//Arry of pages wich getting the standard page template
|
||||
$standardpages = array(//'profile',
|
||||
$standardpages = [//'profile',
|
||||
// 'fbrowser/image/'
|
||||
);
|
||||
];
|
||||
|
||||
return $standardpages;
|
||||
}
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
|
||||
/**
|
||||
* @brief: Get info header of the shema
|
||||
*
|
||||
*
|
||||
* This function parses the header of the shemename.php file for inormations like
|
||||
* Author, Description and Overwrites. Most of the code comes from the get_plugin_info()
|
||||
* function. We use this to get the variables which get overwritten through the shema.
|
||||
* All color variables which get overwritten through the theme have to be
|
||||
* listed (comma seperated) in the shema header under Overwrites:
|
||||
* This seemst not to be the best solution. We need to investigate further.
|
||||
*
|
||||
*
|
||||
* @param string $schema Name of the shema
|
||||
* @return array With theme information
|
||||
* 'author' => Author Name
|
||||
|
@ -27,13 +27,13 @@ function get_schema_info($schema){
|
|||
$themepath = "view/theme/" . $theme . "/";
|
||||
$schema = PConfig::get(local_user(),'frio', 'schema');
|
||||
|
||||
$info=Array(
|
||||
$info=[
|
||||
'name' => $schema,
|
||||
'description' => "",
|
||||
'author' => array(),
|
||||
'author' => [],
|
||||
'version' => "",
|
||||
'overwrites' => ""
|
||||
);
|
||||
];
|
||||
|
||||
if (!is_file($themepath . "schema/" . $schema . ".php")) return $info;
|
||||
|
||||
|
@ -51,9 +51,9 @@ function get_schema_info($schema){
|
|||
if ($k=="author"){
|
||||
$r=preg_match("|([^<]+)<([^>]+)>|", $v, $m);
|
||||
if ($r) {
|
||||
$info['author'][] = array('name'=>$m[1], 'link'=>$m[2]);
|
||||
$info['author'][] = ['name'=>$m[1], 'link'=>$m[2]];
|
||||
} else {
|
||||
$info['author'][] = array('name'=>$v);
|
||||
$info['author'][] = ['name'=>$v];
|
||||
}
|
||||
} elseif ($k == "overwrites") {
|
||||
$theme_settings = explode(',',str_replace(' ','', $v));
|
||||
|
|
|
@ -167,7 +167,7 @@ switch ($bg_image_option) {
|
|||
// Convert transparency level from percentage to opacity value.
|
||||
$contentbg_transp = $contentbg_transp / 100;
|
||||
|
||||
$options = array (
|
||||
$options = [
|
||||
'$nav_bg' => $nav_bg,
|
||||
'$nav_icon_color' => $nav_icon_color,
|
||||
'$nav_icon_hover_color' => $nav_icon_hover_color,
|
||||
|
@ -181,7 +181,7 @@ $options = array (
|
|||
'$background_image' => $background_image,
|
||||
'$background_size_img' => $background_size_img,
|
||||
'$login_bg_image' => $login_bg_image,
|
||||
);
|
||||
];
|
||||
|
||||
$css_tpl = file_get_contents('view/theme/frio/css/style.css');
|
||||
|
||||
|
@ -211,7 +211,7 @@ header('Last-Modified: '.$modified);
|
|||
// Only send the CSS file if it was changed.
|
||||
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
|
||||
$cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']));
|
||||
$cached_etag = str_replace(array('"', "-gzip"), array('', ''),
|
||||
$cached_etag = str_replace(['"', "-gzip"], ['', ''],
|
||||
stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
|
||||
|
||||
if (($cached_modified == $modified) && ($cached_etag == $etag)) {
|
||||
|
|
|
@ -94,7 +94,7 @@ function frio_item_photo_links(App $a, &$body_info)
|
|||
|
||||
while ($p !== false && ($occurence++ < 500)) {
|
||||
$link = substr($body_info['html'], $p['start'], $p['end'] - $p['start']);
|
||||
$matches = array();
|
||||
$matches = [];
|
||||
|
||||
preg_match("/\/photos\/[\w]+\/image\/([\w]+)/", $link, $matches);
|
||||
if ($matches) {
|
||||
|
@ -244,28 +244,28 @@ function frio_remote_nav($a, &$nav)
|
|||
}
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
$nav['userinfo'] = array(
|
||||
$nav['userinfo'] = [
|
||||
'icon' => (DBM::is_result($r) ? $r[0]['photo'] : "images/person-48.jpg"),
|
||||
'name' => $r[0]['name'],
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
if (!local_user() && !empty($server_url)) {
|
||||
$nav['logout'] = Array($server_url . '/logout', t('Logout'), "", t('End this session'));
|
||||
$nav['logout'] = [$server_url . '/logout', t('Logout'), "", t('End this session')];
|
||||
|
||||
// user menu
|
||||
$nav['usermenu'][] = Array($server_url . '/profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations'));
|
||||
$nav['usermenu'][] = Array($server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), "", t('Your profile page'));
|
||||
$nav['usermenu'][] = Array($server_url . '/photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos'));
|
||||
$nav['usermenu'][] = Array($server_url . '/videos/' . $a->user['nickname'], t('Videos'), "", t('Your videos'));
|
||||
$nav['usermenu'][] = Array($server_url . '/events/', t('Events'), "", t('Your events'));
|
||||
$nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations')];
|
||||
$nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), "", t('Your profile page')];
|
||||
$nav['usermenu'][] = [$server_url . '/photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')];
|
||||
$nav['usermenu'][] = [$server_url . '/videos/' . $a->user['nickname'], t('Videos'), "", t('Your videos')];
|
||||
$nav['usermenu'][] = [$server_url . '/events/', t('Events'), "", t('Your events')];
|
||||
|
||||
// navbar links
|
||||
$nav['network'] = array($server_url . '/network', t('Network'), "", t('Conversations from your friends'));
|
||||
$nav['events'] = Array($server_url . '/events', t('Events'), "", t('Events and Calendar'));
|
||||
$nav['messages'] = array($server_url . '/message', t('Messages'), "", t('Private mail'));
|
||||
$nav['settings'] = array($server_url . '/settings', t('Settings'), "", t('Account settings'));
|
||||
$nav['contacts'] = array($server_url . '/contacts', t('Contacts'), "", t('Manage/edit friends and contacts'));
|
||||
$nav['network'] = [$server_url . '/network', t('Network'), "", t('Conversations from your friends')];
|
||||
$nav['events'] = [$server_url . '/events', t('Events'), "", t('Events and Calendar')];
|
||||
$nav['messages'] = [$server_url . '/message', t('Messages'), "", t('Private mail')];
|
||||
$nav['settings'] = [$server_url . '/settings', t('Settings'), "", t('Account settings')];
|
||||
$nav['contacts'] = [$server_url . '/contacts', t('Contacts'), "", t('Manage/edit friends and contacts')];
|
||||
$nav['sitename'] = $a->config['sitename'];
|
||||
}
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ function frio_acl_lookup(App $a, &$results)
|
|||
intval($_SESSION['uid'])
|
||||
);
|
||||
|
||||
$contacts = array();
|
||||
$contacts = [];
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
foreach ($r as $rr) {
|
||||
|
@ -346,14 +346,14 @@ function frio_acl_lookup(App $a, &$results)
|
|||
function frio_display_item(App $a, &$arr)
|
||||
{
|
||||
// Add subthread to the item menu
|
||||
$subthread = array();
|
||||
$subthread = [];
|
||||
if (local_user() == $arr['item']['uid'] && $arr['item']['parent'] == $arr['item']['id'] && !$arr['item']['self']) {
|
||||
$subthread = array(
|
||||
$subthread = [
|
||||
'menu' => 'follow_thread',
|
||||
'title' => t('Follow Thread'),
|
||||
'action' => 'dosubthread(' . $arr['item']['id'] . '); return false;',
|
||||
'href' => '#'
|
||||
);
|
||||
];
|
||||
}
|
||||
$arr['output']['subthread'] = $subthread;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ function frost_item_photo_links(App $a, &$body_info)
|
|||
while($p !== false && ($occurence++ < 500)) {
|
||||
$link = substr($body_info['html'], $p['start'], $p['end'] - $p['start']);
|
||||
|
||||
$matches = array();
|
||||
$matches = [];
|
||||
preg_match("/\/photos\/[\w]+\/image\/([\w]+)/", $link, $matches);
|
||||
if($matches) {
|
||||
|
||||
|
|
|
@ -55,11 +55,11 @@ function theme_admin_post(App $a) {
|
|||
|
||||
/// @TODO $a is no longer used here
|
||||
function quattro_form(App $a, $align, $color, $tfs, $pfs) {
|
||||
$colors = array(
|
||||
$colors = [
|
||||
"dark" => "Quattro",
|
||||
"lilac" => "Lilac",
|
||||
"green" => "Green",
|
||||
);
|
||||
];
|
||||
|
||||
if ($tfs === false) {
|
||||
$tfs = "20";
|
||||
|
@ -69,14 +69,14 @@ function quattro_form(App $a, $align, $color, $tfs, $pfs) {
|
|||
}
|
||||
|
||||
$t = get_markup_template("theme_settings.tpl" );
|
||||
$o .= replace_macros($t, array(
|
||||
$o .= replace_macros($t, [
|
||||
'$submit' => t('Submit'),
|
||||
'$baseurl' => System::baseUrl(),
|
||||
'$title' => t("Theme settings"),
|
||||
'$align' => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))),
|
||||
'$color' => array('quattro_color', t('Color scheme'), $color, '', $colors),
|
||||
'$pfs' => array('quattro_pfs', t('Posts font size'), $pfs),
|
||||
'$tfs' => array('quattro_tfs', t('Textareas font size'), $tfs),
|
||||
));
|
||||
'$align' => ['quattro_align', t('Alignment'), $align, '', ['left'=>t('Left'), 'center'=>t('Center')]],
|
||||
'$color' => ['quattro_color', t('Color scheme'), $color, '', $colors],
|
||||
'$pfs' => ['quattro_pfs', t('Posts font size'), $pfs],
|
||||
'$tfs' => ['quattro_tfs', t('Textareas font size'), $tfs],
|
||||
]);
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -69,9 +69,9 @@ function theme_admin(App $a) {
|
|||
$helperlist = "https://forum.friendi.ca/profile/helpers";
|
||||
|
||||
$t = get_markup_template("theme_admin_settings.tpl");
|
||||
$o .= replace_macros($t, array(
|
||||
'$helperlist' => array('vier_helperlist', t('Comma separated list of helper forums'), $helperlist, '', ''),
|
||||
));
|
||||
$o .= replace_macros($t, [
|
||||
'$helperlist' => ['vier_helperlist', t('Comma separated list of helper forums'), $helperlist, '', ''],
|
||||
]);
|
||||
|
||||
$show_pages = get_vier_config('show_pages', true, true);
|
||||
$show_profiles = get_vier_config('show_profiles', true, true);
|
||||
|
@ -100,7 +100,7 @@ function theme_admin_post(App $a) {
|
|||
|
||||
/// @TODO $a is no longer used
|
||||
function vier_form(App $a, $style, $show_pages, $show_profiles, $show_helpers, $show_services, $show_friends, $show_lastusers) {
|
||||
$styles = array(
|
||||
$styles = [
|
||||
"breathe"=>"Breathe",
|
||||
"netcolour"=>"Coloured Networks",
|
||||
"dark"=>"Dark",
|
||||
|
@ -108,22 +108,22 @@ function vier_form(App $a, $style, $show_pages, $show_profiles, $show_helpers, $
|
|||
"plus"=>"Plus",
|
||||
"plusminus"=>"Plus Minus",
|
||||
"shadow"=>"Shadow"
|
||||
);
|
||||
];
|
||||
|
||||
$show_or_not = array('0'=>t("don't show"), '1'=>t("show"),);
|
||||
$show_or_not = ['0'=>t("don't show"), '1'=>t("show"),];
|
||||
|
||||
$t = get_markup_template("theme_settings.tpl");
|
||||
$o .= replace_macros($t, array(
|
||||
$o .= replace_macros($t, [
|
||||
'$submit' => t('Submit'),
|
||||
'$baseurl' => System::baseUrl(),
|
||||
'$title' => t("Theme settings"),
|
||||
'$style' => array('vier_style',t ('Set style'),$style,'',$styles),
|
||||
'$show_pages' => array('vier_show_pages', t('Community Pages'), $show_pages, '', $show_or_not),
|
||||
'$show_profiles' => array('vier_show_profiles', t('Community Profiles'), $show_profiles, '', $show_or_not),
|
||||
'$show_helpers' => array('vier_show_helpers', t('Help or @NewHere ?'), $show_helpers, '', $show_or_not),
|
||||
'$show_services' => array('vier_show_services', t('Connect Services'), $show_services, '', $show_or_not),
|
||||
'$show_friends' => array('vier_show_friends', t('Find Friends'), $show_friends, '', $show_or_not),
|
||||
'$show_lastusers' => array('vier_show_lastusers', t('Last users'), $show_lastusers, '', $show_or_not)
|
||||
));
|
||||
'$style' => ['vier_style',t ('Set style'),$style,'',$styles],
|
||||
'$show_pages' => ['vier_show_pages', t('Community Pages'), $show_pages, '', $show_or_not],
|
||||
'$show_profiles' => ['vier_show_profiles', t('Community Profiles'), $show_profiles, '', $show_or_not],
|
||||
'$show_helpers' => ['vier_show_helpers', t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
|
||||
'$show_services' => ['vier_show_services', t('Connect Services'), $show_services, '', $show_or_not],
|
||||
'$show_friends' => ['vier_show_friends', t('Find Friends'), $show_friends, '', $show_or_not],
|
||||
'$show_lastusers' => ['vier_show_lastusers', t('Last users'), $show_lastusers, '', $show_or_not]
|
||||
]);
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ header('Last-Modified: '.$modified);
|
|||
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
|
||||
|
||||
$cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']));
|
||||
$cached_etag = str_replace(array('"', "-gzip"), array('', ''),
|
||||
$cached_etag = str_replace(['"', "-gzip"], ['', ''],
|
||||
stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
|
||||
|
||||
if (($cached_modified == $modified) && ($cached_etag == $etag)) {
|
||||
|
|
|
@ -102,8 +102,8 @@ EOT;
|
|||
|
||||
// Hide the left menu bar
|
||||
/// @TODO maybe move this static array out where it should belong?
|
||||
if (($a->page['aside'] == "") && in_array($a->argv[0], array("community", "events", "help", "manage", "notifications",
|
||||
"probe", "webfinger", "login", "invite", "credits"))) {
|
||||
if (($a->page['aside'] == "") && in_array($a->argv[0], ["community", "events", "help", "manage", "notifications",
|
||||
"probe", "webfinger", "login", "invite", "credits"])) {
|
||||
$a->page['htmlhead'] .= "<link rel='stylesheet' href='view/theme/vier/hide.css' />";
|
||||
}
|
||||
}
|
||||
|
@ -146,16 +146,16 @@ function vier_community_info() {
|
|||
if (DBM::is_result($r)) {
|
||||
|
||||
$aside['$comunity_profiles_title'] = t('Community Profiles');
|
||||
$aside['$comunity_profiles_items'] = array();
|
||||
$aside['$comunity_profiles_items'] = [];
|
||||
|
||||
foreach ($r as $rr) {
|
||||
$entry = replace_macros($tpl,array(
|
||||
$entry = replace_macros($tpl,[
|
||||
'$id' => $rr['id'],
|
||||
//'$profile_link' => Profile::zrl($rr['url']),
|
||||
'$profile_link' => 'follow/?url='.urlencode($rr['url']),
|
||||
'$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO),
|
||||
'$alt_text' => $rr['name'],
|
||||
));
|
||||
]);
|
||||
$aside['$comunity_profiles_items'][] = $entry;
|
||||
}
|
||||
}
|
||||
|
@ -176,15 +176,15 @@ function vier_community_info() {
|
|||
if (DBM::is_result($r)) {
|
||||
|
||||
$aside['$lastusers_title'] = t('Last users');
|
||||
$aside['$lastusers_items'] = array();
|
||||
$aside['$lastusers_items'] = [];
|
||||
|
||||
foreach ($r as $rr) {
|
||||
$profile_link = 'profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
|
||||
$entry = replace_macros($tpl,array(
|
||||
$entry = replace_macros($tpl,[
|
||||
'$id' => $rr['id'],
|
||||
'$profile_link' => $profile_link,
|
||||
'$photo' => $a->remove_baseurl($rr['thumb']),
|
||||
'$alt_text' => $rr['name']));
|
||||
'$alt_text' => $rr['name']]);
|
||||
$aside['$lastusers_items'][] = $entry;
|
||||
}
|
||||
}
|
||||
|
@ -192,13 +192,13 @@ function vier_community_info() {
|
|||
|
||||
//right_aside FIND FRIENDS
|
||||
if ($show_friends && local_user()) {
|
||||
$nv = array();
|
||||
$nv['title'] = array("", t('Find Friends'), "", "");
|
||||
$nv['directory'] = array('directory', t('Local Directory'), "", "");
|
||||
$nv['global_directory'] = Array(get_server(), t('Global Directory'), "", "");
|
||||
$nv['match'] = array('match', t('Similar Interests'), "", "");
|
||||
$nv['suggest'] = array('suggest', t('Friend Suggestions'), "", "");
|
||||
$nv['invite'] = array('invite', t('Invite Friends'), "", "");
|
||||
$nv = [];
|
||||
$nv['title'] = ["", t('Find Friends'), "", ""];
|
||||
$nv['directory'] = ['directory', t('Local Directory'), "", ""];
|
||||
$nv['global_directory'] = [get_server(), t('Global Directory'), "", ""];
|
||||
$nv['match'] = ['match', t('Similar Interests'), "", ""];
|
||||
$nv['suggest'] = ['suggest', t('Friend Suggestions'), "", ""];
|
||||
$nv['invite'] = ['invite', t('Invite Friends'), "", ""];
|
||||
|
||||
$nv['search'] = '<form name="simple_bar" method="get" action="dirfind">
|
||||
<span class="sbox_l"></span>
|
||||
|
@ -229,7 +229,7 @@ function vier_community_info() {
|
|||
foreach ($contacts as $contact) {
|
||||
$selected = (($cid == $contact['id']) ? ' forum-selected' : '');
|
||||
|
||||
$entry = array(
|
||||
$entry = [
|
||||
'url' => 'network?f=&cid=' . $contact['id'],
|
||||
'external_url' => 'redir/' . $contact['id'],
|
||||
'name' => $contact['name'],
|
||||
|
@ -237,7 +237,7 @@ function vier_community_info() {
|
|||
'selected' => $selected,
|
||||
'micro' => System::removedBaseUrl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
|
||||
'id' => ++$id,
|
||||
);
|
||||
];
|
||||
$entries[] = $entry;
|
||||
}
|
||||
|
||||
|
@ -246,13 +246,13 @@ function vier_community_info() {
|
|||
|
||||
$page .= replace_macros(
|
||||
$tpl,
|
||||
array(
|
||||
[
|
||||
'$title' => t('Forums'),
|
||||
'$forums' => $entries,
|
||||
'$link_desc' => t('External link to forum'),
|
||||
'$total' => $total,
|
||||
'$visible_forums' => $visible_forums,
|
||||
'$showmore' => t('show more'))
|
||||
'$showmore' => t('show more')]
|
||||
);
|
||||
|
||||
$aside['$page'] = $page;
|
||||
|
@ -262,7 +262,7 @@ function vier_community_info() {
|
|||
|
||||
// helpers
|
||||
if ($show_helpers) {
|
||||
$r = array();
|
||||
$r = [];
|
||||
|
||||
$helperlist = Config::get("vier", "helperlist");
|
||||
|
||||
|
@ -283,22 +283,22 @@ function vier_community_info() {
|
|||
foreach ($r AS $index => $helper)
|
||||
$r[$index]["url"] = Profile::zrl($helper["url"]);
|
||||
|
||||
$r[] = array("url" => "help/Quick-Start-guide", "name" => t("Quick Start"));
|
||||
$r[] = ["url" => "help/Quick-Start-guide", "name" => t("Quick Start")];
|
||||
|
||||
$tpl = get_markup_template('ch_helpers.tpl');
|
||||
|
||||
if ($r) {
|
||||
|
||||
$helpers = array();
|
||||
$helpers['title'] = array("", t('Help'), "", "");
|
||||
$helpers = [];
|
||||
$helpers['title'] = ["", t('Help'), "", ""];
|
||||
|
||||
$aside['$helpers_items'] = array();
|
||||
$aside['$helpers_items'] = [];
|
||||
|
||||
foreach ($r as $rr) {
|
||||
$entry = replace_macros($tpl,array(
|
||||
$entry = replace_macros($tpl,[
|
||||
'$url' => $rr['url'],
|
||||
'$title' => $rr['name'],
|
||||
));
|
||||
]);
|
||||
$aside['$helpers_items'][] = $entry;
|
||||
}
|
||||
|
||||
|
@ -311,38 +311,38 @@ function vier_community_info() {
|
|||
if ($show_services) {
|
||||
|
||||
/// @TODO This whole thing is hard-coded, better rewrite to Intercepting Filter Pattern (future-todo)
|
||||
$r = array();
|
||||
$r = [];
|
||||
|
||||
if (plugin_enabled("appnet")) {
|
||||
$r[] = array("photo" => "images/appnet.png", "name" => "App.net");
|
||||
$r[] = ["photo" => "images/appnet.png", "name" => "App.net"];
|
||||
}
|
||||
|
||||
if (plugin_enabled("buffer")) {
|
||||
$r[] = array("photo" => "images/buffer.png", "name" => "Buffer");
|
||||
$r[] = ["photo" => "images/buffer.png", "name" => "Buffer"];
|
||||
}
|
||||
|
||||
if (plugin_enabled("blogger")) {
|
||||
$r[] = array("photo" => "images/blogger.png", "name" => "Blogger");
|
||||
$r[] = ["photo" => "images/blogger.png", "name" => "Blogger"];
|
||||
}
|
||||
|
||||
if (plugin_enabled("dwpost")) {
|
||||
$r[] = array("photo" => "images/dreamwidth.png", "name" => "Dreamwidth");
|
||||
$r[] = ["photo" => "images/dreamwidth.png", "name" => "Dreamwidth"];
|
||||
}
|
||||
|
||||
if (plugin_enabled("fbpost")) {
|
||||
$r[] = array("photo" => "images/facebook.png", "name" => "Facebook");
|
||||
$r[] = ["photo" => "images/facebook.png", "name" => "Facebook"];
|
||||
}
|
||||
|
||||
if (plugin_enabled("ifttt")) {
|
||||
$r[] = array("photo" => "addon/ifttt/ifttt.png", "name" => "IFTTT");
|
||||
$r[] = ["photo" => "addon/ifttt/ifttt.png", "name" => "IFTTT"];
|
||||
}
|
||||
|
||||
if (plugin_enabled("statusnet")) {
|
||||
$r[] = array("photo" => "images/gnusocial.png", "name" => "GNU Social");
|
||||
$r[] = ["photo" => "images/gnusocial.png", "name" => "GNU Social"];
|
||||
}
|
||||
|
||||
if (plugin_enabled("gpluspost")) {
|
||||
$r[] = array("photo" => "images/googleplus.png", "name" => "Google+");
|
||||
$r[] = ["photo" => "images/googleplus.png", "name" => "Google+"];
|
||||
}
|
||||
|
||||
/// @TODO old-lost code (and below)?
|
||||
|
@ -351,7 +351,7 @@ function vier_community_info() {
|
|||
//}
|
||||
|
||||
if (plugin_enabled("libertree")) {
|
||||
$r[] = array("photo" => "images/libertree.png", "name" => "Libertree");
|
||||
$r[] = ["photo" => "images/libertree.png", "name" => "Libertree"];
|
||||
}
|
||||
|
||||
//if (plugin_enabled("ljpost")) {
|
||||
|
@ -359,39 +359,39 @@ function vier_community_info() {
|
|||
//}
|
||||
|
||||
if (plugin_enabled("pumpio")) {
|
||||
$r[] = array("photo" => "images/pumpio.png", "name" => "pump.io");
|
||||
$r[] = ["photo" => "images/pumpio.png", "name" => "pump.io"];
|
||||
}
|
||||
|
||||
if (plugin_enabled("tumblr")) {
|
||||
$r[] = array("photo" => "images/tumblr.png", "name" => "Tumblr");
|
||||
$r[] = ["photo" => "images/tumblr.png", "name" => "Tumblr"];
|
||||
}
|
||||
|
||||
if (plugin_enabled("twitter")) {
|
||||
$r[] = array("photo" => "images/twitter.png", "name" => "Twitter");
|
||||
$r[] = ["photo" => "images/twitter.png", "name" => "Twitter"];
|
||||
}
|
||||
|
||||
if (plugin_enabled("wppost")) {
|
||||
$r[] = array("photo" => "images/wordpress.png", "name" => "Wordpress");
|
||||
$r[] = ["photo" => "images/wordpress.png", "name" => "Wordpress"];
|
||||
}
|
||||
|
||||
if (function_exists("imap_open") && !Config::get("system","imap_disabled") && !Config::get("system","dfrn_only")) {
|
||||
$r[] = array("photo" => "images/mail.png", "name" => "E-Mail");
|
||||
$r[] = ["photo" => "images/mail.png", "name" => "E-Mail"];
|
||||
}
|
||||
|
||||
$tpl = get_markup_template('ch_connectors.tpl');
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
|
||||
$con_services = array();
|
||||
$con_services['title'] = array("", t('Connect Services'), "", "");
|
||||
$con_services = [];
|
||||
$con_services['title'] = ["", t('Connect Services'), "", ""];
|
||||
$aside['$con_services'] = $con_services;
|
||||
|
||||
foreach ($r as $rr) {
|
||||
$entry = replace_macros($tpl,array(
|
||||
$entry = replace_macros($tpl,[
|
||||
'$url' => $url,
|
||||
'$photo' => $rr['photo'],
|
||||
'$alt_text' => $rr['name'],
|
||||
));
|
||||
]);
|
||||
$aside['$connector_items'][] = $entry;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue