\ No newline at end of file
diff --git a/library/Shineisp/Commons/Contents.php b/library/Shineisp/Commons/Contents.php
index ba84ad9b..9e873660 100644
--- a/library/Shineisp/Commons/Contents.php
+++ b/library/Shineisp/Commons/Contents.php
@@ -17,7 +17,7 @@ class Shineisp_Commons_Contents {
* @param string $text
* @return array
*/
- public function getAllBlocks($text) {
+ public static function getAllBlocks($text) {
preg_match_all( '(.*{block(.+)}.*)Ui', $text, $matches );
return $matches;
}
@@ -27,7 +27,7 @@ public function getAllBlocks($text) {
* get all the modules within a long text
* @param string $text
*/
- public function getAllModules($text) {
+ public static function getAllModules($text) {
preg_match_all( '(.*{module(.+)}.*)Ui', $text, $matches );
return $matches;
}
@@ -42,7 +42,7 @@ public function getAllModules($text) {
* @param string $text
* @return string
*/
- public function chkModule($text, $locale="en_US") {
+ public static function chkModule($text, $locale="en_US") {
// Get all the blocks in the whole text
$modules = self::getAllModules($text);
@@ -109,7 +109,7 @@ public function chkModule($text, $locale="en_US") {
* @param string $text
* @return string
*/
- public function chkCMSBlocks($text, $locale="en_US") {
+ public static function chkCMSBlocks($text, $locale="en_US") {
$languageID = Languages::get_language_id($locale);
// Get all the blocks in the whole text
diff --git a/library/Shineisp/Commons/Layout.php b/library/Shineisp/Commons/Layout.php
index 85bdd98a..d500812e 100644
--- a/library/Shineisp/Commons/Layout.php
+++ b/library/Shineisp/Commons/Layout.php
@@ -66,7 +66,7 @@ public static function getData($module, $skin) {
* @param string $controller
* @param string $skin [base]
*/
- private function setData($xmlobject, $module, $controller, $skin = "base") {
+ private static function setData($xmlobject, $module, $controller, $skin = "base") {
// Get the default project resources
if (count ( $xmlobject )) {
diff --git a/library/Shineisp/Commons/Utilities.php b/library/Shineisp/Commons/Utilities.php
index 22a36601..1070d80a 100644
--- a/library/Shineisp/Commons/Utilities.php
+++ b/library/Shineisp/Commons/Utilities.php
@@ -28,7 +28,7 @@ public static function getQuarterByMonth($monthNumber) {
* @param string $database
* @return boolean or string
*/
- static public function chkdatabase($username,$password,$hostname,$database){
+ public static function chkdatabase($username,$password,$hostname,$database){
try{
$dsn = "mysql://$username:$password@$hostname/$database";
$conn = Doctrine_Manager::connection($dsn, 'shineisp test connection');
@@ -54,7 +54,7 @@ static public function chkdatabase($username,$password,$hostname,$database){
* @param string $filename
* @param string $destination
*/
- static public function unZip($filename, $destination){
+ public static function unZip($filename, $destination){
$zip = new ZipArchive;
$res = $zip->open($filename);
if ($res === TRUE) {
@@ -121,7 +121,7 @@ public static function log($message, $filename = "errors.log") {
* Check if the browser is an Apple client
* @return boolean
*/
- static public function isAppleClient(){
+ public static function isAppleClient(){
if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod') || strstr($_SERVER['HTTP_USER_AGENT'],'iPad')) {
return true;
}
@@ -132,7 +132,7 @@ static public function isAppleClient(){
* Get the google latitude longitude
* @param string $address
*/
- static public function getCoordinates($address){
+ public static function getCoordinates($address){
$address = urlencode($address);
$uri = "http://maps.googleapis.com/maps/api/geocode/json?address=$address&sensor=true";
$json = @file_get_contents ( $uri );
@@ -150,7 +150,7 @@ static public function getCoordinates($address){
* Check if the domain is valid
* @param unknown_type $domain_name
*/
- static public function is_valid_domain_name($url) {
+ public static function is_valid_domain_name($url) {
if (preg_match ( "/^[a-z0-9][a-z0-9\-]+[a-z0-9](\.[a-z]{2,4})+$/i", $url )) {
return true;
} else {
@@ -162,7 +162,7 @@ static public function is_valid_domain_name($url) {
* Create a little table using a multidimensional array
* @param array $data
*/
- static public function array2table(array $data){
+ public static function array2table(array $data){
$cell_address = "[A1,A2,D3,H3]";
$ar_columns = array_keys($data[0]);
@@ -199,7 +199,7 @@ static public function array2table(array $data){
* @param string $directory
*
*/
- static public function dirlist($dir) {
+ public static function dirlist($dir) {
$dirs = array ();
$next = 0;
@@ -222,7 +222,7 @@ static public function dirlist($dir) {
* This function simply returns an array containing a list of a directory's contents.
* @param unknown_type $directory
*/
- static public function getDirectoryList ($directory)
+ public static function getDirectoryList ($directory)
{
// create an array to hold directory list
@@ -254,7 +254,7 @@ static public function getDirectoryList ($directory)
* Check if the string is a date
* @param unknown_type $str
*/
- static public function isDate($str) {
+ public static function isDate($str) {
if (! empty ( $str )) {
$str = str_replace ( "/", "-", $str );
$stamp = strtotime ( $str );
@@ -274,7 +274,7 @@ static public function isDate($str) {
return FALSE;
}
- static public function isAjax() {
+ public static function isAjax() {
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'));
}
@@ -292,7 +292,7 @@ static public function isAjax() {
* @param string $format Format of the date. Any combination of mm, dd, yyyy
* with single character separator between.
*/
- static public function is_valid_date($value, $format = 'dd.mm.yyyy'){
+ public static function is_valid_date($value, $format = 'dd.mm.yyyy'){
if(strlen($value) >= 6 && strlen($format) == 10){
// find separator. Remove all other characters from $format
@@ -324,7 +324,7 @@ static public function is_valid_date($value, $format = 'dd.mm.yyyy'){
* formatSearchvalue
* format the search posted values before use them in the sql query
*/
- static public function formatSearchvalue($value) {
+ public static function formatSearchvalue($value) {
// If is a numeric
if (is_numeric ( $value )) {
@@ -344,7 +344,7 @@ static public function formatSearchvalue($value) {
/*
* Clean the tmp folder
*/
- static public function cleantmp() {
+ public static function cleantmp() {
$seconds_old = 1800; // 30 minutes old
$directory = PUBLIC_PATH . "/tmp";
@@ -363,7 +363,7 @@ static public function cleantmp() {
/*
* Remove empty directories
*/
- static public function removeEmptySubFolders($path){
+ public static function removeEmptySubFolders($path){
$empty=true;
foreach (glob($path.DIRECTORY_SEPARATOR."*") as $file){
@@ -374,7 +374,7 @@ static public function removeEmptySubFolders($path){
}
// Check if the string is an email
- static public function isEmail($email) {
+ public static function isEmail($email) {
return preg_match ( '|^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]{2,})+$|i', $email );
}
@@ -384,7 +384,7 @@ static public function isEmail($email) {
* @param string $strText, $intLength, $strTrail
* @return string $CropSentence
*/
- static public function CropSentence($strText, $intLength, $strTrail) {
+ public static function CropSentence($strText, $intLength, $strTrail) {
$wsCount = 0;
$intTempSize = 0;
$intTotalLen = 0;
@@ -437,7 +437,7 @@ static public function CropSentence($strText, $intLength, $strTrail) {
* @param string $childrenKey index for children, in case $flattenChildren was set to false. Defaults to "@children"
* @return array the resulting array.
*/
- static public function simpleXMLToArray($xml, $flattenValues = true, $flattenAttributes = true, $flattenChildren = true, $valueKey = '@value', $attributesKey = '@attributes', $childrenKey = '@children') {
+ public static function simpleXMLToArray($xml, $flattenValues = true, $flattenAttributes = true, $flattenChildren = true, $valueKey = '@value', $attributesKey = '@attributes', $childrenKey = '@children') {
$return = array ();
@@ -510,7 +510,7 @@ static public function simpleXMLToArray($xml, $flattenValues = true, $flattenAtt
* @param boolean $considerHtml If true, HTML tags would be handled correctly
* @return string Trimmed string.
*/
- static public function truncate($text, $length = 100, $ending = '...', $exact = true, $considerHtml = false) {
+ public static function truncate($text, $length = 100, $ending = '...', $exact = true, $considerHtml = false) {
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (strlen ( preg_replace ( '/<.*?>/', '', $text ) ) <= $length) {
@@ -605,7 +605,7 @@ static public function truncate($text, $length = 100, $ending = '...', $exact =
* Delete the directory selected and all its subfolders
* @param string $dir
*/
- static public function delTree($dir) {
+ public static function delTree($dir) {
$files = glob ( $dir . '*', GLOB_MARK );
if (is_array ( $files )) {
foreach ( $files as $file ) {
@@ -635,7 +635,7 @@ static public function delTree($dir) {
* @param string/array $attachments
* @return boolean|multitype:unknown NULL
*/
- static public function SendEmail($from, $to, $bcc = NULL, $subject, $body, $html = false, $inreplyto = NULL, $attachments = NULL, $replyto = NULL) {
+ public static function SendEmail($from, $to, $bcc = NULL, $subject, $body, $html = false, $inreplyto = NULL, $attachments = NULL, $replyto = NULL) {
$transport = null;
$config = array ();
@@ -734,7 +734,7 @@ static public function SendEmail($from, $to, $bcc = NULL, $subject, $body, $html
* getEmailTemplate
* Get the email template from the filesystem
*/
- static public function getEmailTemplate($template) {
+ public static function getEmailTemplate($template) {
$email = false;
$subject = "";
$locale = Zend_Registry::get ( 'Zend_Locale' );
@@ -780,7 +780,7 @@ static public function getEmailTemplate($template) {
return $email;
}
- static public function cvsExport($recordset) {
+ public static function cvsExport($recordset) {
$cvs = "";
@unlink ( "documents/export.csv" );
if (! empty ( $recordset ) && is_array ( $recordset )) {
@@ -797,7 +797,7 @@ static public function cvsExport($recordset) {
return $cvs;
}
- static public function whoisInfo($domain) {
+ public static function whoisInfo($domain) {
$uri = "http://www.webservicex.net/whois.asmx/GetWhoIS?HostName=$domain";
$client = new Zend_Http_Client ( $uri );
try {
@@ -807,7 +807,7 @@ static public function whoisInfo($domain) {
}
}
- function in_arrayi($needle, $haystack) {
+ public static function in_arrayi($needle, $haystack) {
return in_array ( strtolower ( $needle ), array_map ( 'strtolower', $haystack ) );
}
@@ -818,7 +818,7 @@ function in_arrayi($needle, $haystack) {
* @param $format Zend_date format
* @return date formatted by the locale setting
*/
- static public function formatDateOut($dbindata, $format=Zend_Date::DATE_MEDIUM) {
+ public static function formatDateOut($dbindata, $format=Zend_Date::DATE_MEDIUM) {
if (empty ( $dbindata ))
return false;
@@ -834,7 +834,7 @@ static public function formatDateOut($dbindata, $format=Zend_Date::DATE_MEDIUM)
* @param string $dboutdata
* @return string Y-m-d H:i:s
*/
- static public function formatDateIn($dboutdata) {
+ public static function formatDateIn($dboutdata) {
if (empty ( $dboutdata ))
return null;
@@ -852,7 +852,7 @@ static public function formatDateIn($dboutdata) {
* @param integer $yr
* @return boolean|Zend_Date
*/
- function add_date($givendate, $day = 0, $mth = 0, $yr = 0) {
+ public static function add_date($givendate, $day = 0, $mth = 0, $yr = 0) {
if (empty ( $givendate ))
return false;
@@ -883,7 +883,7 @@ function add_date($givendate, $day = 0, $mth = 0, $yr = 0) {
* Create a flat array starting from a multidimensional array
* @return array
*/
- function array_flatten($a, $f = array()) {
+ public static function array_flatten($a, $f = array()) {
if (! $a || ! is_array ( $a ))
return $f;
foreach ( $a as $k => $v ) {
@@ -900,7 +900,7 @@ function array_flatten($a, $f = array()) {
* Get the value of a specific key in a multidimensional array
* @var string
*/
- function search($keys, $search, &$results) {
+ public static function search($keys, $search, &$results) {
foreach ( $search as $k => $v ) {
if (is_array ( $v )) {
self::search ( $keys, $v, $results );
diff --git a/library/Shineisp/Commons/Uuid.php b/library/Shineisp/Commons/Uuid.php
new file mode 100644
index 00000000..bde58dc5
--- /dev/null
+++ b/library/Shineisp/Commons/Uuid.php
@@ -0,0 +1,12 @@
+');
}
});
+
+ /* Show active item on reload page */
+ $('#sidebar_menu LI.showall').each(function(){
+ $(this).parent().show();
+ $(this).parent().parent().addClass('expanded');
+ })
$('#sidebar_menu a').live('click', function() {
var el = $(this);
@@ -133,13 +139,22 @@ var SLAB = (function($, window, undefined) {
if (ul.length) {
if (ul.is(':hidden')) {
+ /* JAY - 20130328 - GUEST
+ * Close all submenu opened */
+ $('#sidebar_menu LI.item UL').hide();
+ $('#sidebar_menu LI.item').each(function(){
+ $(this).removeClass('expanded')
+ });
+ //END
+
li.addClass('expanded');
-
+ /* JAY - 20130328 - GUEST
+ * Show always other items not selected
li.siblings('li').each(function() {
if ($(this).attr('id') !== 'sidebar_menu_home') {
$(this).hide();
}
- });
+ });*/
ul.show();
}