1
0
Fork 0

Use short form array syntax everywhere

- Add short form array syntax to po2php.php generation
This commit is contained in:
Hypolite Petovan 2018-01-15 08:05:12 -05:00
commit e36f2bb1fb
212 changed files with 5160 additions and 5160 deletions

View file

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

View file

@ -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];
}
/**

View file

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

View file

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