mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10752] More fixes for acp_styles
Fixing return doc blocks, spacing, incorrect sorting function and other minor fixes PHPBB3-10752
This commit is contained in:
parent
e558a3cb05
commit
a46b5480e1
1 changed files with 101 additions and 102 deletions
|
@ -377,7 +377,7 @@ class acp_styles
|
|||
|
||||
// Get all styles
|
||||
$styles = $this->get_styles();
|
||||
usort($styles, 'acp_styles::sort_styles');
|
||||
usort($styles, array($this, 'sort_styles'));
|
||||
|
||||
// Find current style
|
||||
$style = false;
|
||||
|
@ -485,7 +485,7 @@ class acp_styles
|
|||
{
|
||||
// Update styles tree
|
||||
$styles = $this->get_styles();
|
||||
if ($this->update_styles_tree(&$styles, $style))
|
||||
if ($this->update_styles_tree($styles, $style))
|
||||
{
|
||||
// Something was changed in styles tree, purge all cache
|
||||
$this->cache->purge();
|
||||
|
@ -550,7 +550,7 @@ class acp_styles
|
|||
trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
usort($styles, 'acp_styles::sort_styles');
|
||||
usort($styles, array($this, 'sort_styles'));
|
||||
|
||||
// Get users
|
||||
$users = $this->get_users();
|
||||
|
@ -616,7 +616,7 @@ class acp_styles
|
|||
trigger_error($this->user->lang['NO_UNINSTALLED_STYLE'] . adm_back_link($this->u_base_action), E_USER_NOTICE);
|
||||
}
|
||||
|
||||
usort($styles, 'acp_styles::sort_styles');
|
||||
usort($styles, array($this, 'sort_styles'));
|
||||
|
||||
$this->styles_list_cols = 3;
|
||||
$this->template->assign_vars(array(
|
||||
|
@ -653,7 +653,7 @@ class acp_styles
|
|||
{
|
||||
if (empty($style['_shown']))
|
||||
{
|
||||
$this->list_style(&$style, 0);
|
||||
$this->list_style($style, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -672,7 +672,7 @@ class acp_styles
|
|||
* Find styles available for installation
|
||||
*
|
||||
* @param bool $all if true, function will return all installable styles. if false, function will return only styles that can be installed
|
||||
* @returns array list of styles
|
||||
* @return array List of styles
|
||||
*/
|
||||
function find_available($all)
|
||||
{
|
||||
|
@ -799,7 +799,7 @@ class acp_styles
|
|||
*
|
||||
* @param array $styles Styles list, passed as reference
|
||||
* @param array $style Current style, false if root
|
||||
* @returns true if something was updated, false if not
|
||||
* @return bool True if something was updated, false if not
|
||||
*/
|
||||
function update_styles_tree(&$styles, $style = false)
|
||||
{
|
||||
|
@ -837,7 +837,7 @@ class acp_styles
|
|||
* @param int $id id of style
|
||||
* @param int $parent current parent style id
|
||||
* @param int $level current tree level
|
||||
* @returns array of style ids, names and levels
|
||||
* @return array Style ids, names and levels
|
||||
*/
|
||||
function find_possible_parents($styles, $id = -1, $parent = 0, $level = 0)
|
||||
{
|
||||
|
@ -972,8 +972,8 @@ class acp_styles
|
|||
'cannotinstall' => 0
|
||||
);
|
||||
}
|
||||
$this->style_counters[$counter] ++;
|
||||
$this->style_counters['total'] ++;
|
||||
$this->style_counters[$counter]++;
|
||||
$this->style_counters['total']++;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -994,7 +994,7 @@ class acp_styles
|
|||
/**
|
||||
* Find all directories that have styles
|
||||
*
|
||||
* @returns array of directory names
|
||||
* @return array Directory names
|
||||
*/
|
||||
function find_style_dirs()
|
||||
{
|
||||
|
@ -1042,8 +1042,7 @@ class acp_styles
|
|||
* Read style configuration file
|
||||
*
|
||||
* @param string $dir style directory
|
||||
* @returns array of style data
|
||||
* @returns false on error
|
||||
* @return array|bool Style data, false on error
|
||||
*/
|
||||
function read_style_cfg($dir)
|
||||
{
|
||||
|
@ -1076,7 +1075,7 @@ class acp_styles
|
|||
* Install style
|
||||
*
|
||||
* @param $style style data
|
||||
* @returns int style id
|
||||
* @return int Style id
|
||||
*/
|
||||
function install_style($style)
|
||||
{
|
||||
|
@ -1109,7 +1108,7 @@ class acp_styles
|
|||
/**
|
||||
* Lists all styles
|
||||
*
|
||||
* @returns array of rows with styles data
|
||||
* @return array Rows with styles data
|
||||
*/
|
||||
function get_styles()
|
||||
{
|
||||
|
@ -1126,7 +1125,7 @@ class acp_styles
|
|||
/**
|
||||
* Count users for each style
|
||||
*
|
||||
* @returns array of styles in following format: [style_id] = number of users
|
||||
* @return array Styles in following format: [style_id] = number of users
|
||||
*/
|
||||
function get_users()
|
||||
{
|
||||
|
@ -1149,7 +1148,7 @@ class acp_styles
|
|||
* Uninstall style
|
||||
*
|
||||
* @param array $style Style data
|
||||
* @returns true on success, error message on error
|
||||
* @return bool|string True on success, error message on error
|
||||
*/
|
||||
function uninstall_style($style)
|
||||
{
|
||||
|
@ -1159,7 +1158,7 @@ class acp_styles
|
|||
// Check if style has child styles
|
||||
$sql = 'SELECT style_id
|
||||
FROM ' . STYLES_TABLE . '
|
||||
WHERE style_parent_id = ' . $id . " OR style_parent_tree = '" . $this->db->sql_escape($path) . "'";
|
||||
WHERE style_parent_id = ' . (int) $id . " OR style_parent_tree = '" . $this->db->sql_escape($path) . "'";
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
||||
$conflict = $this->db->sql_fetchrow($result);
|
||||
|
@ -1188,7 +1187,7 @@ class acp_styles
|
|||
*
|
||||
* @param string $path Style directory
|
||||
* @param string $dir Directory to remove inside style's directory
|
||||
* @returns true on success, false on error
|
||||
* @return bool True on success, false on error
|
||||
*/
|
||||
function delete_style_files($path, $dir = '')
|
||||
{
|
||||
|
@ -1237,7 +1236,7 @@ class acp_styles
|
|||
* @param string $name Variable name
|
||||
* @param $default Default value for array: string or number
|
||||
* @param bool $error If true, error will be triggered if list is empty
|
||||
* @returns array of items
|
||||
* @return array Items
|
||||
*/
|
||||
function request_vars($name, $default, $error = false)
|
||||
{
|
||||
|
@ -1265,7 +1264,7 @@ class acp_styles
|
|||
/**
|
||||
* Generates hardcoded bitfield
|
||||
*
|
||||
* @returns bitfield string
|
||||
* @return string Bitfield
|
||||
*/
|
||||
function default_bitfield()
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue