1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-17 20:01:47 +02:00

Userclass fixes. Now clears userclass cache after changes in admin are made.

This commit is contained in:
Cameron
2015-05-12 13:53:47 -07:00
parent 3a238bf622
commit a708211cb3
6 changed files with 170 additions and 17 deletions

View File

@@ -864,7 +864,7 @@ class user_class
* @param integer $id - class number. A negative number indicates 'not a member of...'
* @return string class name
*/
public function uc_get_classname($id)
public function getName($id)
{
$cn = abs($id);
$ucString = 'Class:'.$id; // Debugging aid - this should be overridden
@@ -889,14 +889,17 @@ class user_class
/**
* Return class description for given class ID
* @param integer $id - class number. Must be >= 0
* @return string class description
*/
public function uc_get_classdescription($id)
public function getDescription($id)
{
if (isset($this->class_tree[$id]))
$id = intval($id);
if(isset($this->class_tree[$id]))
{
return $this->class_tree[$id]['userclass_description'];
}
@@ -909,6 +912,33 @@ class user_class
/**
* BC Alias. of getName();
* @deprecated
* @param $id
* @return string
*/
public function uc_get_classname($id)
{
return $this->getName($id);
}
/**
* BC Alias of getDescription
* @deprecated
* @param $id
* @return mixed
*/
public function uc_get_classdescription($id)
{
return $this->getDescription($id);
}
/**
* Return class icon for given class ID
* @param integer $id - class number. Must be >= 0
@@ -1031,6 +1061,16 @@ class user_class
}
return $ret;
}
/**
* Clear user class cache
* @return none
*/
public function clearCache()
{
e107::getCache()->clear_sys(UC_CACHE_TAG);
}
}
@@ -1881,8 +1921,7 @@ class user_class_admin extends user_class
*/
public function clearCache()
{
$e107 = e107::getInstance();
$e107->ecache->clear_sys(UC_CACHE_TAG);
e107::getCache()->clear_sys(UC_CACHE_TAG);
}
}