@@ -81,51 +81,51 @@ |
||
| 81 | 81 | */ |
| 82 | 82 | class SmartUploader extends \XoopsMediaUploader |
| 83 | 83 | { |
| 84 | - public $ext; |
|
| 85 | - public $dimension; |
|
| 84 | + public $ext; |
|
| 85 | + public $dimension; |
|
| 86 | 86 | |
| 87 | - /** |
|
| 88 | - * No admin check for uploads |
|
| 89 | - */ |
|
| 90 | - public $noAdminSizeCheck; |
|
| 87 | + /** |
|
| 88 | + * No admin check for uploads |
|
| 89 | + */ |
|
| 90 | + public $noAdminSizeCheck; |
|
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * Constructor |
|
| 94 | - * |
|
| 95 | - * @param string $uploadDir |
|
| 96 | - * @param array|int $allowedMimeTypes |
|
| 97 | - * @param int $maxFileSize |
|
| 98 | - * @param int $maxWidth |
|
| 99 | - * @param int $maxHeight |
|
| 100 | - * @internal param int $cmodvalue |
|
| 101 | - */ |
|
| 102 | - public function __construct($uploadDir, $allowedMimeTypes = 0, $maxFileSize, $maxWidth = 0, $maxHeight = 0) |
|
| 103 | - { |
|
| 104 | - parent::__construct($uploadDir, $allowedMimeTypes, $maxFileSize, $maxWidth, $maxHeight); |
|
| 105 | - } |
|
| 92 | + /** |
|
| 93 | + * Constructor |
|
| 94 | + * |
|
| 95 | + * @param string $uploadDir |
|
| 96 | + * @param array|int $allowedMimeTypes |
|
| 97 | + * @param int $maxFileSize |
|
| 98 | + * @param int $maxWidth |
|
| 99 | + * @param int $maxHeight |
|
| 100 | + * @internal param int $cmodvalue |
|
| 101 | + */ |
|
| 102 | + public function __construct($uploadDir, $allowedMimeTypes = 0, $maxFileSize, $maxWidth = 0, $maxHeight = 0) |
|
| 103 | + { |
|
| 104 | + parent::__construct($uploadDir, $allowedMimeTypes, $maxFileSize, $maxWidth, $maxHeight); |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * @param $value |
|
| 109 | - */ |
|
| 110 | - public function noAdminSizeCheck($value) |
|
| 111 | - { |
|
| 112 | - $this->noAdminSizeCheck = $value; |
|
| 113 | - } |
|
| 107 | + /** |
|
| 108 | + * @param $value |
|
| 109 | + */ |
|
| 110 | + public function noAdminSizeCheck($value) |
|
| 111 | + { |
|
| 112 | + $this->noAdminSizeCheck = $value; |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | - /** |
|
| 116 | - * Is the file the right size? |
|
| 117 | - * |
|
| 118 | - * @return bool |
|
| 119 | - */ |
|
| 120 | - public function checkMaxFileSize() |
|
| 121 | - { |
|
| 122 | - if ($this->noAdminSizeCheck) { |
|
| 123 | - return true; |
|
| 124 | - } |
|
| 125 | - if ($this->mediaSize > $this->maxFileSize) { |
|
| 126 | - return false; |
|
| 127 | - } |
|
| 115 | + /** |
|
| 116 | + * Is the file the right size? |
|
| 117 | + * |
|
| 118 | + * @return bool |
|
| 119 | + */ |
|
| 120 | + public function checkMaxFileSize() |
|
| 121 | + { |
|
| 122 | + if ($this->noAdminSizeCheck) { |
|
| 123 | + return true; |
|
| 124 | + } |
|
| 125 | + if ($this->mediaSize > $this->maxFileSize) { |
|
| 126 | + return false; |
|
| 127 | + } |
|
| 128 | 128 | |
| 129 | - return true; |
|
| 130 | - } |
|
| 129 | + return true; |
|
| 130 | + } |
|
| 131 | 131 | } |
@@ -26,80 +26,80 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | class SmartMlObject extends Smartobject\BaseSmartObject |
| 28 | 28 | { |
| 29 | - /** |
|
| 30 | - * SmartMlObject constructor. |
|
| 31 | - */ |
|
| 32 | - public function __construct() |
|
| 33 | - { |
|
| 34 | - $this->initVar('language', XOBJ_DTYPE_TXTBOX, 'english', false, null, '', true, _CO_SOBJECT_LANGUAGE_CAPTION, _CO_SOBJECT_LANGUAGE_DSC, true, true); |
|
| 35 | - $this->setControl('language', 'language'); |
|
| 36 | - } |
|
| 29 | + /** |
|
| 30 | + * SmartMlObject constructor. |
|
| 31 | + */ |
|
| 32 | + public function __construct() |
|
| 33 | + { |
|
| 34 | + $this->initVar('language', XOBJ_DTYPE_TXTBOX, 'english', false, null, '', true, _CO_SOBJECT_LANGUAGE_CAPTION, _CO_SOBJECT_LANGUAGE_DSC, true, true); |
|
| 35 | + $this->setControl('language', 'language'); |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * If object is not new, change the control of the not-multilanguage fields |
|
| 40 | - * |
|
| 41 | - * We need to intercept this function from SmartObject because if the object is not new... |
|
| 42 | - */ |
|
| 43 | - // function getForm() { |
|
| 38 | + /** |
|
| 39 | + * If object is not new, change the control of the not-multilanguage fields |
|
| 40 | + * |
|
| 41 | + * We need to intercept this function from SmartObject because if the object is not new... |
|
| 42 | + */ |
|
| 43 | + // function getForm() { |
|
| 44 | 44 | |
| 45 | - //} |
|
| 45 | + //} |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Strip Multilanguage Fields |
|
| 49 | - * |
|
| 50 | - * Get rid of all the multilanguage fields to have an object with only global fields. |
|
| 51 | - * This will be usefull when creating the ML object for the first time. Then we will be able |
|
| 52 | - * to create translations. |
|
| 53 | - */ |
|
| 54 | - public function stripMultilanguageFields() |
|
| 55 | - { |
|
| 56 | - $objectVars =& $this->getVars(); |
|
| 57 | - $newObjectVars = []; |
|
| 58 | - foreach ($objectVars as $key => $var) { |
|
| 59 | - if (!$var['multilingual']) { |
|
| 60 | - $newObjectVars[$key] = $var; |
|
| 61 | - } |
|
| 62 | - } |
|
| 63 | - $this->vars = $newObjectVars; |
|
| 64 | - } |
|
| 47 | + /** |
|
| 48 | + * Strip Multilanguage Fields |
|
| 49 | + * |
|
| 50 | + * Get rid of all the multilanguage fields to have an object with only global fields. |
|
| 51 | + * This will be usefull when creating the ML object for the first time. Then we will be able |
|
| 52 | + * to create translations. |
|
| 53 | + */ |
|
| 54 | + public function stripMultilanguageFields() |
|
| 55 | + { |
|
| 56 | + $objectVars =& $this->getVars(); |
|
| 57 | + $newObjectVars = []; |
|
| 58 | + foreach ($objectVars as $key => $var) { |
|
| 59 | + if (!$var['multilingual']) { |
|
| 60 | + $newObjectVars[$key] = $var; |
|
| 61 | + } |
|
| 62 | + } |
|
| 63 | + $this->vars = $newObjectVars; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - public function stripNonMultilanguageFields() |
|
| 67 | - { |
|
| 68 | - $objectVars =& $this->getVars(); |
|
| 69 | - $newObjectVars = []; |
|
| 70 | - foreach ($objectVars as $key => $var) { |
|
| 71 | - if ($var['multilingual'] || $key == $this->handler->keyName) { |
|
| 72 | - $newObjectVars[$key] = $var; |
|
| 73 | - } |
|
| 74 | - } |
|
| 75 | - $this->vars = $newObjectVars; |
|
| 76 | - } |
|
| 66 | + public function stripNonMultilanguageFields() |
|
| 67 | + { |
|
| 68 | + $objectVars =& $this->getVars(); |
|
| 69 | + $newObjectVars = []; |
|
| 70 | + foreach ($objectVars as $key => $var) { |
|
| 71 | + if ($var['multilingual'] || $key == $this->handler->keyName) { |
|
| 72 | + $newObjectVars[$key] = $var; |
|
| 73 | + } |
|
| 74 | + } |
|
| 75 | + $this->vars = $newObjectVars; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - /** |
|
| 79 | - * Make non multilanguage fields read only |
|
| 80 | - * |
|
| 81 | - * This is used when we are creating/editing a translation. |
|
| 82 | - * We only want to edit the multilanguag fields, not the global one. |
|
| 83 | - */ |
|
| 84 | - public function makeNonMLFieldReadOnly() |
|
| 85 | - { |
|
| 86 | - foreach ($this->getVars() as $key => $var) { |
|
| 87 | - //if (($key == 'language') || (!$var['multilingual'] && $key <> $this->handler->keyName)) { |
|
| 88 | - if (!$var['multilingual'] && $key != $this->handler->keyName) { |
|
| 89 | - $this->setControl($key, 'label'); |
|
| 90 | - } |
|
| 91 | - } |
|
| 92 | - } |
|
| 78 | + /** |
|
| 79 | + * Make non multilanguage fields read only |
|
| 80 | + * |
|
| 81 | + * This is used when we are creating/editing a translation. |
|
| 82 | + * We only want to edit the multilanguag fields, not the global one. |
|
| 83 | + */ |
|
| 84 | + public function makeNonMLFieldReadOnly() |
|
| 85 | + { |
|
| 86 | + foreach ($this->getVars() as $key => $var) { |
|
| 87 | + //if (($key == 'language') || (!$var['multilingual'] && $key <> $this->handler->keyName)) { |
|
| 88 | + if (!$var['multilingual'] && $key != $this->handler->keyName) { |
|
| 89 | + $this->setControl($key, 'label'); |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - /** |
|
| 95 | - * @param bool $onlyUrl |
|
| 96 | - * @param bool $withimage |
|
| 97 | - * @return string |
|
| 98 | - */ |
|
| 99 | - public function getEditLanguageLink($onlyUrl = false, $withimage = true) |
|
| 100 | - { |
|
| 101 | - $controller = new SmartObjectController($this->handler); |
|
| 94 | + /** |
|
| 95 | + * @param bool $onlyUrl |
|
| 96 | + * @param bool $withimage |
|
| 97 | + * @return string |
|
| 98 | + */ |
|
| 99 | + public function getEditLanguageLink($onlyUrl = false, $withimage = true) |
|
| 100 | + { |
|
| 101 | + $controller = new SmartObjectController($this->handler); |
|
| 102 | 102 | |
| 103 | - return $controller->getEditLanguageLink($this, $onlyUrl, $withimage); |
|
| 104 | - } |
|
| 103 | + return $controller->getEditLanguageLink($this, $onlyUrl, $withimage); |
|
| 104 | + } |
|
| 105 | 105 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function stripMultilanguageFields() |
| 55 | 55 | { |
| 56 | - $objectVars =& $this->getVars(); |
|
| 56 | + $objectVars = & $this->getVars(); |
|
| 57 | 57 | $newObjectVars = []; |
| 58 | 58 | foreach ($objectVars as $key => $var) { |
| 59 | 59 | if (!$var['multilingual']) { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | public function stripNonMultilanguageFields() |
| 67 | 67 | { |
| 68 | - $objectVars =& $this->getVars(); |
|
| 68 | + $objectVars = & $this->getVars(); |
|
| 69 | 69 | $newObjectVars = []; |
| 70 | 70 | foreach ($objectVars as $key => $var) { |
| 71 | 71 | if ($var['multilingual'] || $key == $this->handler->keyName) { |
@@ -25,54 +25,54 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | class Helper extends \Xmf\Module\Helper |
| 27 | 27 | { |
| 28 | - public $debug; |
|
| 28 | + public $debug; |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @internal param $debug |
|
| 32 | - * @param bool $debug |
|
| 33 | - */ |
|
| 34 | - protected function __construct($debug = false) |
|
| 35 | - { |
|
| 36 | - $this->debug = $debug; |
|
| 37 | - parent::__construct(basename(dirname(__DIR__))); |
|
| 38 | - } |
|
| 30 | + /** |
|
| 31 | + * @internal param $debug |
|
| 32 | + * @param bool $debug |
|
| 33 | + */ |
|
| 34 | + protected function __construct($debug = false) |
|
| 35 | + { |
|
| 36 | + $this->debug = $debug; |
|
| 37 | + parent::__construct(basename(dirname(__DIR__))); |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @param bool $debug |
|
| 42 | - * |
|
| 43 | - * @return \Xmf\Module\Helper |
|
| 44 | - */ |
|
| 45 | - public static function getInstance($debug = false) |
|
| 46 | - { |
|
| 47 | - static $instance; |
|
| 48 | - if (null === $instance) { |
|
| 49 | - $instance = new static($debug); |
|
| 50 | - } |
|
| 40 | + /** |
|
| 41 | + * @param bool $debug |
|
| 42 | + * |
|
| 43 | + * @return \Xmf\Module\Helper |
|
| 44 | + */ |
|
| 45 | + public static function getInstance($debug = false) |
|
| 46 | + { |
|
| 47 | + static $instance; |
|
| 48 | + if (null === $instance) { |
|
| 49 | + $instance = new static($debug); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - return $instance; |
|
| 53 | - } |
|
| 52 | + return $instance; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * @return string |
|
| 57 | - */ |
|
| 58 | - public function getDirname() |
|
| 59 | - { |
|
| 60 | - return $this->dirname; |
|
| 61 | - } |
|
| 55 | + /** |
|
| 56 | + * @return string |
|
| 57 | + */ |
|
| 58 | + public function getDirname() |
|
| 59 | + { |
|
| 60 | + return $this->dirname; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * Get an Object Handler |
|
| 65 | - * |
|
| 66 | - * @param string $name name of handler to load |
|
| 67 | - * |
|
| 68 | - * @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler |
|
| 69 | - */ |
|
| 70 | - public function getHandler($name) |
|
| 71 | - { |
|
| 72 | - $ret = false; |
|
| 73 | - $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
|
| 74 | - $class = '\\XoopsModules\\' . ucfirst(strtolower(basename(dirname(__DIR__)))) . '\\' . $name . 'Handler'; |
|
| 75 | - $ret = new $class($db); |
|
| 76 | - return $ret; |
|
| 77 | - } |
|
| 63 | + /** |
|
| 64 | + * Get an Object Handler |
|
| 65 | + * |
|
| 66 | + * @param string $name name of handler to load |
|
| 67 | + * |
|
| 68 | + * @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler |
|
| 69 | + */ |
|
| 70 | + public function getHandler($name) |
|
| 71 | + { |
|
| 72 | + $ret = false; |
|
| 73 | + $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
|
| 74 | + $class = '\\XoopsModules\\' . ucfirst(strtolower(basename(dirname(__DIR__)))) . '\\' . $name . 'Handler'; |
|
| 75 | + $ret = new $class($db); |
|
| 76 | + return $ret; |
|
| 77 | + } |
|
| 78 | 78 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | protected function __construct($debug = false) |
| 35 | 35 | { |
| 36 | - $this->debug = $debug; |
|
| 36 | + $this->debug = $debug; |
|
| 37 | 37 | parent::__construct(basename(dirname(__DIR__))); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $ret = false; |
| 73 | 73 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
| 74 | - $class = '\\XoopsModules\\' . ucfirst(strtolower(basename(dirname(__DIR__)))) . '\\' . $name . 'Handler'; |
|
| 74 | + $class = '\\XoopsModules\\'.ucfirst(strtolower(basename(dirname(__DIR__)))).'\\'.$name.'Handler'; |
|
| 75 | 75 | $ret = new $class($db); |
| 76 | 76 | return $ret; |
| 77 | 77 | } |
@@ -17,45 +17,45 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class SmartTip |
| 19 | 19 | { |
| 20 | - public $id; |
|
| 21 | - public $caption; |
|
| 22 | - public $message; |
|
| 23 | - public $visible; |
|
| 24 | - public $_tpl; |
|
| 20 | + public $id; |
|
| 21 | + public $caption; |
|
| 22 | + public $message; |
|
| 23 | + public $visible; |
|
| 24 | + public $_tpl; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * SmartTip constructor. |
|
| 28 | - * @param $id |
|
| 29 | - * @param $caption |
|
| 30 | - * @param $message |
|
| 31 | - * @param bool $visible |
|
| 32 | - */ |
|
| 33 | - public function __construct($id, $caption, $message, $visible = false) |
|
| 34 | - { |
|
| 35 | - $this->id = $id; |
|
| 36 | - $this->caption = $caption; |
|
| 37 | - $this->message = $message; |
|
| 38 | - $this->visible = $visible; |
|
| 39 | - $this->_tpl = new \XoopsTpl(); |
|
| 40 | - } |
|
| 26 | + /** |
|
| 27 | + * SmartTip constructor. |
|
| 28 | + * @param $id |
|
| 29 | + * @param $caption |
|
| 30 | + * @param $message |
|
| 31 | + * @param bool $visible |
|
| 32 | + */ |
|
| 33 | + public function __construct($id, $caption, $message, $visible = false) |
|
| 34 | + { |
|
| 35 | + $this->id = $id; |
|
| 36 | + $this->caption = $caption; |
|
| 37 | + $this->message = $message; |
|
| 38 | + $this->visible = $visible; |
|
| 39 | + $this->_tpl = new \XoopsTpl(); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @param bool $outputNow |
|
| 44 | - * @return mixed|string|void |
|
| 45 | - */ |
|
| 46 | - public function render($outputNow = true) |
|
| 47 | - { |
|
| 48 | - $aTip = [ |
|
| 49 | - 'id' => $this->id, |
|
| 50 | - 'caption' => $this->caption, |
|
| 51 | - 'message' => $this->message, |
|
| 52 | - 'visible' => $this->visible ? 'block' : 'none' |
|
| 53 | - ]; |
|
| 54 | - $this->_tpl->assign('tip', $aTip); |
|
| 55 | - if ($outputNow) { |
|
| 56 | - $this->_tpl->display('db:smartobject_tip.tpl'); |
|
| 57 | - } else { |
|
| 58 | - return $this->_tpl->fetch('db:smartobject_tip.tpl'); |
|
| 59 | - } |
|
| 60 | - } |
|
| 42 | + /** |
|
| 43 | + * @param bool $outputNow |
|
| 44 | + * @return mixed|string|void |
|
| 45 | + */ |
|
| 46 | + public function render($outputNow = true) |
|
| 47 | + { |
|
| 48 | + $aTip = [ |
|
| 49 | + 'id' => $this->id, |
|
| 50 | + 'caption' => $this->caption, |
|
| 51 | + 'message' => $this->message, |
|
| 52 | + 'visible' => $this->visible ? 'block' : 'none' |
|
| 53 | + ]; |
|
| 54 | + $this->_tpl->assign('tip', $aTip); |
|
| 55 | + if ($outputNow) { |
|
| 56 | + $this->_tpl->display('db:smartobject_tip.tpl'); |
|
| 57 | + } else { |
|
| 58 | + return $this->_tpl->fetch('db:smartobject_tip.tpl'); |
|
| 59 | + } |
|
| 60 | + } |
|
| 61 | 61 | } |
@@ -29,225 +29,225 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | class SmartobjectCustomtag extends Smartobject\BaseSmartObject |
| 31 | 31 | { |
| 32 | - public $content = false; |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * SmartobjectCustomtag constructor. |
|
| 36 | - */ |
|
| 37 | - public function __construct() |
|
| 38 | - { |
|
| 39 | - $this->quickInitVar('customtagid', XOBJ_DTYPE_INT, true); |
|
| 40 | - $this->quickInitVar('name', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CUSTOMTAG_NAME, _CO_SOBJECT_CUSTOMTAG_NAME_DSC); |
|
| 41 | - $this->quickInitVar('description', XOBJ_DTYPE_TXTAREA, false, _CO_SOBJECT_CUSTOMTAG_DESCRIPTION, _CO_SOBJECT_CUSTOMTAG_DESCRIPTION_DSC); |
|
| 42 | - $this->quickInitVar('content', XOBJ_DTYPE_TXTAREA, true, _CO_SOBJECT_CUSTOMTAG_CONTENT, _CO_SOBJECT_CUSTOMTAG_CONTENT_DSC); |
|
| 43 | - $this->quickInitVar('language', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CUSTOMTAG_LANGUAGE, _CO_SOBJECT_CUSTOMTAG_LANGUAGE_DSC); |
|
| 44 | - |
|
| 45 | - $this->initNonPersistableVar('dohtml', XOBJ_DTYPE_INT, 'class', 'dohtml', '', true); |
|
| 46 | - $this->initNonPersistableVar('doimage', XOBJ_DTYPE_INT, 'class', 'doimage', '', true); |
|
| 47 | - $this->initNonPersistableVar('doxcode', XOBJ_DTYPE_INT, 'class', 'doxcode', '', true); |
|
| 48 | - $this->initNonPersistableVar('dosmiley', XOBJ_DTYPE_INT, 'class', 'dosmiley', '', true); |
|
| 49 | - |
|
| 50 | - $this->setControl('content', [ |
|
| 51 | - 'name' => 'textarea', |
|
| 52 | - 'form_editor' => 'textarea', |
|
| 53 | - 'form_rows' => 25 |
|
| 54 | - ]); |
|
| 55 | - $this->setControl('language', [ |
|
| 56 | - 'name' => 'language', |
|
| 57 | - 'all' => true |
|
| 58 | - ]); |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - /** |
|
| 62 | - * @param string $key |
|
| 63 | - * @param string $format |
|
| 64 | - * @return mixed |
|
| 65 | - */ |
|
| 66 | - public function getVar($key, $format = 's') |
|
| 67 | - { |
|
| 68 | - if ('s' === $format && in_array($key, [])) { |
|
| 69 | - // return call_user_func(array($this, $key)); |
|
| 70 | - return $this->{$key}(); |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - return parent::getVar($key, $format); |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - /** |
|
| 77 | - * @return bool|mixed |
|
| 78 | - */ |
|
| 79 | - public function render() |
|
| 80 | - { |
|
| 81 | - if (!$this->content) { |
|
| 82 | - $ret = $this->getVar('content'); |
|
| 83 | - $this->content = $ret; |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - return $this->content; |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - /** |
|
| 90 | - * @return bool|mixed|string |
|
| 91 | - */ |
|
| 92 | - public function renderWithPhp() |
|
| 93 | - { |
|
| 94 | - if (!$this->content) { |
|
| 95 | - $ret = $this->getVar('content'); |
|
| 96 | - $this->content = $ret; |
|
| 97 | - } else { |
|
| 98 | - $ret = $this->content; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - // check for PHP if we are not on admin side |
|
| 102 | - if (!defined('XOOPS_CPFUNC_LOADED') && !(false === strpos($ret, '[php]'))) { |
|
| 103 | - $ret = str_replace('[php]', '', $ret); |
|
| 104 | - // we have PHP code, let's evaluate |
|
| 105 | - eval($ret); |
|
| 106 | - |
|
| 107 | - return ''; |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - return $this->content; |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * @return string |
|
| 115 | - */ |
|
| 116 | - public function getXoopsCode() |
|
| 117 | - { |
|
| 118 | - $ret = '[customtag]' . $this->getVar('tag', 'n') . '[/customtag]'; |
|
| 119 | - |
|
| 120 | - return $ret; |
|
| 121 | - } |
|
| 122 | - |
|
| 123 | - /** |
|
| 124 | - * @return string |
|
| 125 | - */ |
|
| 126 | - public function getCloneLink() |
|
| 127 | - { |
|
| 128 | - $ret = '<a href="' . SMARTOBJECT_URL . 'admin/customtag.php?op=clone&customtagid=' . $this->id() . '"><img src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . 'editcopy.png" style="vertical-align: middle;" alt="' . _CO_SOBJECT_CUSTOMTAG_CLONE . '" title="' . _CO_SOBJECT_CUSTOMTAG_CLONE . '"></a>'; |
|
| 129 | - |
|
| 130 | - return $ret; |
|
| 131 | - } |
|
| 132 | - |
|
| 133 | - /** |
|
| 134 | - * @param $var |
|
| 135 | - * @return bool |
|
| 136 | - */ |
|
| 137 | - public function emptyString($var) |
|
| 138 | - { |
|
| 139 | - return (strlen($var) > 0); |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - /** |
|
| 143 | - * @return mixed|string |
|
| 144 | - */ |
|
| 145 | - public function generateTag() |
|
| 146 | - { |
|
| 147 | - $title = rawurlencode(strtolower($this->getVar('description', 'e'))); |
|
| 148 | - $title = xoops_substr($title, 0, 10, ''); |
|
| 149 | - // Transformation des ponctuations |
|
| 150 | - $pattern = [ |
|
| 151 | - '/%09/', // Tab |
|
| 152 | - '/%20/', // Space |
|
| 153 | - '/%21/', // ! |
|
| 154 | - '/%22/', // " |
|
| 155 | - '/%23/', // # |
|
| 156 | - '/%25/', // % |
|
| 157 | - '/%26/', // & |
|
| 158 | - '/%27/', // ' |
|
| 159 | - '/%28/', // ( |
|
| 160 | - '/%29/', // ) |
|
| 161 | - '/%2C/', // , |
|
| 162 | - '/%2F/', // / |
|
| 163 | - '/%3A/', // : |
|
| 164 | - '/%3B/', // ; |
|
| 165 | - '/%3C/', // < |
|
| 166 | - '/%3D/', // = |
|
| 167 | - '/%3E/', // > |
|
| 168 | - '/%3F/', // ? |
|
| 169 | - '/%40/', // @ |
|
| 170 | - '/%5B/', // [ |
|
| 171 | - '/%5C/', // \ |
|
| 172 | - '/%5D/', // ] |
|
| 173 | - '/%5E/', // ^ |
|
| 174 | - '/%7B/', // { |
|
| 175 | - '/%7C/', // | |
|
| 176 | - '/%7D/', // } |
|
| 177 | - '/%7E/', // ~ |
|
| 178 | - "/\./" // . |
|
| 179 | - ]; |
|
| 180 | - $rep_pat = [ |
|
| 181 | - '-', |
|
| 182 | - '-', |
|
| 183 | - '-', |
|
| 184 | - '-', |
|
| 185 | - '-', |
|
| 186 | - '-100', |
|
| 187 | - '-', |
|
| 188 | - '-', |
|
| 189 | - '-', |
|
| 190 | - '-', |
|
| 191 | - '-', |
|
| 192 | - '-', |
|
| 193 | - '-', |
|
| 194 | - '-', |
|
| 195 | - '-', |
|
| 196 | - '-', |
|
| 197 | - '-', |
|
| 198 | - '-', |
|
| 199 | - '-at-', |
|
| 200 | - '-', |
|
| 201 | - '-', |
|
| 202 | - '-', |
|
| 203 | - '-', |
|
| 204 | - '-', |
|
| 205 | - '-', |
|
| 206 | - '-', |
|
| 207 | - '-', |
|
| 208 | - '-' |
|
| 209 | - ]; |
|
| 210 | - $title = preg_replace($pattern, $rep_pat, $title); |
|
| 211 | - |
|
| 212 | - // Transformation des caractères accentués |
|
| 213 | - $pattern = [ |
|
| 214 | - '/%B0/', // ° |
|
| 215 | - '/%E8/', // è |
|
| 216 | - '/%E9/', // é |
|
| 217 | - '/%EA/', // ê |
|
| 218 | - '/%EB/', // ë |
|
| 219 | - '/%E7/', // ç |
|
| 220 | - '/%E0/', // à |
|
| 221 | - '/%E2/', // â |
|
| 222 | - '/%E4/', // ä |
|
| 223 | - '/%EE/', // î |
|
| 224 | - '/%EF/', // ï |
|
| 225 | - '/%F9/', // ù |
|
| 226 | - '/%FC/', // ü |
|
| 227 | - '/%FB/', // û |
|
| 228 | - '/%F4/', // ô |
|
| 229 | - '/%F6/', // ö |
|
| 230 | - ]; |
|
| 231 | - $rep_pat = ['-', 'e', 'e', 'e', 'e', 'c', 'a', 'a', 'a', 'i', 'i', 'u', 'u', 'u', 'o', 'o']; |
|
| 232 | - $title = preg_replace($pattern, $rep_pat, $title); |
|
| 233 | - |
|
| 234 | - $tableau = explode('-', $title); // Transforme la chaine de caract�res en tableau |
|
| 235 | - $tableau = array_filter($tableau, [$this, 'emptyString']); // Supprime les chaines vides du tableau |
|
| 236 | - $title = implode('-', $tableau); // Transforme un tableau en chaine de caract�res s�par� par un tiret |
|
| 237 | - |
|
| 238 | - $title .= time(); |
|
| 239 | - $title = md5($title); |
|
| 240 | - |
|
| 241 | - return $title; |
|
| 242 | - } |
|
| 243 | - |
|
| 244 | - /** |
|
| 245 | - * @return mixed |
|
| 246 | - */ |
|
| 247 | - public function getCustomtagName() |
|
| 248 | - { |
|
| 249 | - $ret = $this->getVar('name'); |
|
| 250 | - |
|
| 251 | - return $ret; |
|
| 252 | - } |
|
| 32 | + public $content = false; |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * SmartobjectCustomtag constructor. |
|
| 36 | + */ |
|
| 37 | + public function __construct() |
|
| 38 | + { |
|
| 39 | + $this->quickInitVar('customtagid', XOBJ_DTYPE_INT, true); |
|
| 40 | + $this->quickInitVar('name', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CUSTOMTAG_NAME, _CO_SOBJECT_CUSTOMTAG_NAME_DSC); |
|
| 41 | + $this->quickInitVar('description', XOBJ_DTYPE_TXTAREA, false, _CO_SOBJECT_CUSTOMTAG_DESCRIPTION, _CO_SOBJECT_CUSTOMTAG_DESCRIPTION_DSC); |
|
| 42 | + $this->quickInitVar('content', XOBJ_DTYPE_TXTAREA, true, _CO_SOBJECT_CUSTOMTAG_CONTENT, _CO_SOBJECT_CUSTOMTAG_CONTENT_DSC); |
|
| 43 | + $this->quickInitVar('language', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CUSTOMTAG_LANGUAGE, _CO_SOBJECT_CUSTOMTAG_LANGUAGE_DSC); |
|
| 44 | + |
|
| 45 | + $this->initNonPersistableVar('dohtml', XOBJ_DTYPE_INT, 'class', 'dohtml', '', true); |
|
| 46 | + $this->initNonPersistableVar('doimage', XOBJ_DTYPE_INT, 'class', 'doimage', '', true); |
|
| 47 | + $this->initNonPersistableVar('doxcode', XOBJ_DTYPE_INT, 'class', 'doxcode', '', true); |
|
| 48 | + $this->initNonPersistableVar('dosmiley', XOBJ_DTYPE_INT, 'class', 'dosmiley', '', true); |
|
| 49 | + |
|
| 50 | + $this->setControl('content', [ |
|
| 51 | + 'name' => 'textarea', |
|
| 52 | + 'form_editor' => 'textarea', |
|
| 53 | + 'form_rows' => 25 |
|
| 54 | + ]); |
|
| 55 | + $this->setControl('language', [ |
|
| 56 | + 'name' => 'language', |
|
| 57 | + 'all' => true |
|
| 58 | + ]); |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + /** |
|
| 62 | + * @param string $key |
|
| 63 | + * @param string $format |
|
| 64 | + * @return mixed |
|
| 65 | + */ |
|
| 66 | + public function getVar($key, $format = 's') |
|
| 67 | + { |
|
| 68 | + if ('s' === $format && in_array($key, [])) { |
|
| 69 | + // return call_user_func(array($this, $key)); |
|
| 70 | + return $this->{$key}(); |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + return parent::getVar($key, $format); |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + /** |
|
| 77 | + * @return bool|mixed |
|
| 78 | + */ |
|
| 79 | + public function render() |
|
| 80 | + { |
|
| 81 | + if (!$this->content) { |
|
| 82 | + $ret = $this->getVar('content'); |
|
| 83 | + $this->content = $ret; |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + return $this->content; |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * @return bool|mixed|string |
|
| 91 | + */ |
|
| 92 | + public function renderWithPhp() |
|
| 93 | + { |
|
| 94 | + if (!$this->content) { |
|
| 95 | + $ret = $this->getVar('content'); |
|
| 96 | + $this->content = $ret; |
|
| 97 | + } else { |
|
| 98 | + $ret = $this->content; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + // check for PHP if we are not on admin side |
|
| 102 | + if (!defined('XOOPS_CPFUNC_LOADED') && !(false === strpos($ret, '[php]'))) { |
|
| 103 | + $ret = str_replace('[php]', '', $ret); |
|
| 104 | + // we have PHP code, let's evaluate |
|
| 105 | + eval($ret); |
|
| 106 | + |
|
| 107 | + return ''; |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + return $this->content; |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * @return string |
|
| 115 | + */ |
|
| 116 | + public function getXoopsCode() |
|
| 117 | + { |
|
| 118 | + $ret = '[customtag]' . $this->getVar('tag', 'n') . '[/customtag]'; |
|
| 119 | + |
|
| 120 | + return $ret; |
|
| 121 | + } |
|
| 122 | + |
|
| 123 | + /** |
|
| 124 | + * @return string |
|
| 125 | + */ |
|
| 126 | + public function getCloneLink() |
|
| 127 | + { |
|
| 128 | + $ret = '<a href="' . SMARTOBJECT_URL . 'admin/customtag.php?op=clone&customtagid=' . $this->id() . '"><img src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . 'editcopy.png" style="vertical-align: middle;" alt="' . _CO_SOBJECT_CUSTOMTAG_CLONE . '" title="' . _CO_SOBJECT_CUSTOMTAG_CLONE . '"></a>'; |
|
| 129 | + |
|
| 130 | + return $ret; |
|
| 131 | + } |
|
| 132 | + |
|
| 133 | + /** |
|
| 134 | + * @param $var |
|
| 135 | + * @return bool |
|
| 136 | + */ |
|
| 137 | + public function emptyString($var) |
|
| 138 | + { |
|
| 139 | + return (strlen($var) > 0); |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + /** |
|
| 143 | + * @return mixed|string |
|
| 144 | + */ |
|
| 145 | + public function generateTag() |
|
| 146 | + { |
|
| 147 | + $title = rawurlencode(strtolower($this->getVar('description', 'e'))); |
|
| 148 | + $title = xoops_substr($title, 0, 10, ''); |
|
| 149 | + // Transformation des ponctuations |
|
| 150 | + $pattern = [ |
|
| 151 | + '/%09/', // Tab |
|
| 152 | + '/%20/', // Space |
|
| 153 | + '/%21/', // ! |
|
| 154 | + '/%22/', // " |
|
| 155 | + '/%23/', // # |
|
| 156 | + '/%25/', // % |
|
| 157 | + '/%26/', // & |
|
| 158 | + '/%27/', // ' |
|
| 159 | + '/%28/', // ( |
|
| 160 | + '/%29/', // ) |
|
| 161 | + '/%2C/', // , |
|
| 162 | + '/%2F/', // / |
|
| 163 | + '/%3A/', // : |
|
| 164 | + '/%3B/', // ; |
|
| 165 | + '/%3C/', // < |
|
| 166 | + '/%3D/', // = |
|
| 167 | + '/%3E/', // > |
|
| 168 | + '/%3F/', // ? |
|
| 169 | + '/%40/', // @ |
|
| 170 | + '/%5B/', // [ |
|
| 171 | + '/%5C/', // \ |
|
| 172 | + '/%5D/', // ] |
|
| 173 | + '/%5E/', // ^ |
|
| 174 | + '/%7B/', // { |
|
| 175 | + '/%7C/', // | |
|
| 176 | + '/%7D/', // } |
|
| 177 | + '/%7E/', // ~ |
|
| 178 | + "/\./" // . |
|
| 179 | + ]; |
|
| 180 | + $rep_pat = [ |
|
| 181 | + '-', |
|
| 182 | + '-', |
|
| 183 | + '-', |
|
| 184 | + '-', |
|
| 185 | + '-', |
|
| 186 | + '-100', |
|
| 187 | + '-', |
|
| 188 | + '-', |
|
| 189 | + '-', |
|
| 190 | + '-', |
|
| 191 | + '-', |
|
| 192 | + '-', |
|
| 193 | + '-', |
|
| 194 | + '-', |
|
| 195 | + '-', |
|
| 196 | + '-', |
|
| 197 | + '-', |
|
| 198 | + '-', |
|
| 199 | + '-at-', |
|
| 200 | + '-', |
|
| 201 | + '-', |
|
| 202 | + '-', |
|
| 203 | + '-', |
|
| 204 | + '-', |
|
| 205 | + '-', |
|
| 206 | + '-', |
|
| 207 | + '-', |
|
| 208 | + '-' |
|
| 209 | + ]; |
|
| 210 | + $title = preg_replace($pattern, $rep_pat, $title); |
|
| 211 | + |
|
| 212 | + // Transformation des caractères accentués |
|
| 213 | + $pattern = [ |
|
| 214 | + '/%B0/', // ° |
|
| 215 | + '/%E8/', // è |
|
| 216 | + '/%E9/', // é |
|
| 217 | + '/%EA/', // ê |
|
| 218 | + '/%EB/', // ë |
|
| 219 | + '/%E7/', // ç |
|
| 220 | + '/%E0/', // à |
|
| 221 | + '/%E2/', // â |
|
| 222 | + '/%E4/', // ä |
|
| 223 | + '/%EE/', // î |
|
| 224 | + '/%EF/', // ï |
|
| 225 | + '/%F9/', // ù |
|
| 226 | + '/%FC/', // ü |
|
| 227 | + '/%FB/', // û |
|
| 228 | + '/%F4/', // ô |
|
| 229 | + '/%F6/', // ö |
|
| 230 | + ]; |
|
| 231 | + $rep_pat = ['-', 'e', 'e', 'e', 'e', 'c', 'a', 'a', 'a', 'i', 'i', 'u', 'u', 'u', 'o', 'o']; |
|
| 232 | + $title = preg_replace($pattern, $rep_pat, $title); |
|
| 233 | + |
|
| 234 | + $tableau = explode('-', $title); // Transforme la chaine de caract�res en tableau |
|
| 235 | + $tableau = array_filter($tableau, [$this, 'emptyString']); // Supprime les chaines vides du tableau |
|
| 236 | + $title = implode('-', $tableau); // Transforme un tableau en chaine de caract�res s�par� par un tiret |
|
| 237 | + |
|
| 238 | + $title .= time(); |
|
| 239 | + $title = md5($title); |
|
| 240 | + |
|
| 241 | + return $title; |
|
| 242 | + } |
|
| 243 | + |
|
| 244 | + /** |
|
| 245 | + * @return mixed |
|
| 246 | + */ |
|
| 247 | + public function getCustomtagName() |
|
| 248 | + { |
|
| 249 | + $ret = $this->getVar('name'); |
|
| 250 | + |
|
| 251 | + return $ret; |
|
| 252 | + } |
|
| 253 | 253 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function getXoopsCode() |
| 117 | 117 | { |
| 118 | - $ret = '[customtag]' . $this->getVar('tag', 'n') . '[/customtag]'; |
|
| 118 | + $ret = '[customtag]'.$this->getVar('tag', 'n').'[/customtag]'; |
|
| 119 | 119 | |
| 120 | 120 | return $ret; |
| 121 | 121 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function getCloneLink() |
| 127 | 127 | { |
| 128 | - $ret = '<a href="' . SMARTOBJECT_URL . 'admin/customtag.php?op=clone&customtagid=' . $this->id() . '"><img src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . 'editcopy.png" style="vertical-align: middle;" alt="' . _CO_SOBJECT_CUSTOMTAG_CLONE . '" title="' . _CO_SOBJECT_CUSTOMTAG_CLONE . '"></a>'; |
|
| 128 | + $ret = '<a href="'.SMARTOBJECT_URL.'admin/customtag.php?op=clone&customtagid='.$this->id().'"><img src="'.SMARTOBJECT_IMAGES_ACTIONS_URL.'editcopy.png" style="vertical-align: middle;" alt="'._CO_SOBJECT_CUSTOMTAG_CLONE.'" title="'._CO_SOBJECT_CUSTOMTAG_CLONE.'"></a>'; |
|
| 129 | 129 | |
| 130 | 130 | return $ret; |
| 131 | 131 | } |
@@ -31,12 +31,12 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | class SmartobjectFileHandler extends Smartobject\SmartPersistableObjectHandler |
| 33 | 33 | { |
| 34 | - /** |
|
| 35 | - * SmartobjectFileHandler constructor. |
|
| 36 | - * @param \XoopsDatabase $db |
|
| 37 | - */ |
|
| 38 | - public function __construct(\XoopsDatabase $db) |
|
| 39 | - { |
|
| 40 | - parent::__construct($db, 'file', 'fileid', 'caption', 'desc', 'smartobject'); |
|
| 41 | - } |
|
| 34 | + /** |
|
| 35 | + * SmartobjectFileHandler constructor. |
|
| 36 | + * @param \XoopsDatabase $db |
|
| 37 | + */ |
|
| 38 | + public function __construct(\XoopsDatabase $db) |
|
| 39 | + { |
|
| 40 | + parent::__construct($db, 'file', 'fileid', 'caption', 'desc', 'smartobject'); |
|
| 41 | + } |
|
| 42 | 42 | } |
@@ -22,163 +22,163 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | class SmartobjectAbout |
| 24 | 24 | { |
| 25 | - public $_lang_aboutTitle; |
|
| 26 | - public $_lang_author_info; |
|
| 27 | - public $_lang_developer_lead; |
|
| 28 | - public $_lang_developer_contributor; |
|
| 29 | - public $_lang_developer_website; |
|
| 30 | - public $_lang_developer_email; |
|
| 31 | - public $_lang_developer_credits; |
|
| 32 | - public $_lang_module_info; |
|
| 33 | - public $_lang_module_status; |
|
| 34 | - public $_lang_module_release_date; |
|
| 35 | - public $_lang_module_demo; |
|
| 36 | - public $_lang_module_support; |
|
| 37 | - public $_lang_module_bug; |
|
| 38 | - public $_lang_module_submit_bug; |
|
| 39 | - public $_lang_module_feature; |
|
| 40 | - public $_lang_module_submit_feature; |
|
| 41 | - public $_lang_module_disclaimer; |
|
| 42 | - public $_lang_author_word; |
|
| 43 | - public $_lang_version_history; |
|
| 44 | - public $_lang_by; |
|
| 45 | - public $_tpl; |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * SmartobjectAbout constructor. |
|
| 49 | - * @param string $aboutTitle |
|
| 50 | - */ |
|
| 51 | - public function __construct($aboutTitle = 'About') |
|
| 52 | - { |
|
| 53 | - global $xoopsModule, $xoopsConfig; |
|
| 54 | - |
|
| 55 | - /** @var Smartobject\Helper $helper */ |
|
| 56 | - $helper = Smartobject\Helper::getInstance(); |
|
| 57 | - $helper->loadLanguage('modinfo'); |
|
| 25 | + public $_lang_aboutTitle; |
|
| 26 | + public $_lang_author_info; |
|
| 27 | + public $_lang_developer_lead; |
|
| 28 | + public $_lang_developer_contributor; |
|
| 29 | + public $_lang_developer_website; |
|
| 30 | + public $_lang_developer_email; |
|
| 31 | + public $_lang_developer_credits; |
|
| 32 | + public $_lang_module_info; |
|
| 33 | + public $_lang_module_status; |
|
| 34 | + public $_lang_module_release_date; |
|
| 35 | + public $_lang_module_demo; |
|
| 36 | + public $_lang_module_support; |
|
| 37 | + public $_lang_module_bug; |
|
| 38 | + public $_lang_module_submit_bug; |
|
| 39 | + public $_lang_module_feature; |
|
| 40 | + public $_lang_module_submit_feature; |
|
| 41 | + public $_lang_module_disclaimer; |
|
| 42 | + public $_lang_author_word; |
|
| 43 | + public $_lang_version_history; |
|
| 44 | + public $_lang_by; |
|
| 45 | + public $_tpl; |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * SmartobjectAbout constructor. |
|
| 49 | + * @param string $aboutTitle |
|
| 50 | + */ |
|
| 51 | + public function __construct($aboutTitle = 'About') |
|
| 52 | + { |
|
| 53 | + global $xoopsModule, $xoopsConfig; |
|
| 54 | + |
|
| 55 | + /** @var Smartobject\Helper $helper */ |
|
| 56 | + $helper = Smartobject\Helper::getInstance(); |
|
| 57 | + $helper->loadLanguage('modinfo'); |
|
| 58 | 58 | |
| 59 | - $this->_aboutTitle = $aboutTitle; |
|
| 60 | - |
|
| 61 | - $this->_lang_developer_contributor = _CO_SOBJECT_DEVELOPER_CONTRIBUTOR; |
|
| 62 | - $this->_lang_developer_website = _CO_SOBJECT_DEVELOPER_WEBSITE; |
|
| 63 | - $this->_lang_developer_email = _CO_SOBJECT_DEVELOPER_EMAIL; |
|
| 64 | - $this->_lang_developer_credits = _CO_SOBJECT_DEVELOPER_CREDITS; |
|
| 65 | - $this->_lang_module_info = _CO_SOBJECT_MODULE_INFO; |
|
| 66 | - $this->_lang_module_status = _CO_SOBJECT_MODULE_STATUS; |
|
| 67 | - $this->_lang_module_release_date = _CO_SOBJECT_MODULE_RELEASE_DATE; |
|
| 68 | - $this->_lang_module_demo = _CO_SOBJECT_MODULE_DEMO; |
|
| 69 | - $this->_lang_module_support = _CO_SOBJECT_MODULE_SUPPORT; |
|
| 70 | - $this->_lang_module_bug = _CO_SOBJECT_MODULE_BUG; |
|
| 71 | - $this->_lang_module_submit_bug = _CO_SOBJECT_MODULE_SUBMIT_BUG; |
|
| 72 | - $this->_lang_module_feature = _CO_SOBJECT_MODULE_FEATURE; |
|
| 73 | - $this->_lang_module_submit_feature = _CO_SOBJECT_MODULE_SUBMIT_FEATURE; |
|
| 74 | - $this->_lang_module_disclaimer = _CO_SOBJECT_MODULE_DISCLAIMER; |
|
| 75 | - $this->_lang_author_word = _CO_SOBJECT_AUTHOR_WORD; |
|
| 76 | - $this->_lang_version_history = _CO_SOBJECT_VERSION_HISTORY; |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - /** |
|
| 80 | - * @param $value |
|
| 81 | - * @return mixed |
|
| 82 | - */ |
|
| 83 | - public function sanitize($value) |
|
| 84 | - { |
|
| 85 | - $myts = \MyTextSanitizer::getInstance(); |
|
| 86 | - |
|
| 87 | - return $myts->displayTarea($value, 1); |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - public function render() |
|
| 91 | - { |
|
| 92 | - /** |
|
| 93 | - * @todo move the output to a template |
|
| 94 | - * @todo make the output XHTML compliant |
|
| 95 | - */ |
|
| 96 | - |
|
| 97 | - $myts = \MyTextSanitizer::getInstance(); |
|
| 98 | - |
|
| 99 | - global $xoopsModule; |
|
| 100 | - |
|
| 101 | - smart_xoops_cp_header(); |
|
| 102 | - |
|
| 103 | - /** @var XoopsModuleHandler $moduleHandler */ |
|
| 104 | - $moduleHandler = xoops_getHandler('module'); |
|
| 105 | - $versioninfo = $moduleHandler->get($xoopsModule->getVar('mid')); |
|
| 106 | - |
|
| 107 | - //smart_adminMenu(-1, $this->_aboutTitle . " " . $versioninfo->getInfo('name')); |
|
| 108 | - |
|
| 109 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 110 | - |
|
| 111 | - // --- |
|
| 112 | - // 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated. |
|
| 113 | - // $this->_tpl = new \XoopsTpl(); |
|
| 114 | - $this->_tpl = new \XoopsTpl(); |
|
| 115 | - // --- |
|
| 116 | - |
|
| 117 | - $this->_tpl->assign('module_url', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/'); |
|
| 118 | - $this->_tpl->assign('module_image', $versioninfo->getInfo('image')); |
|
| 119 | - $this->_tpl->assign('module_name', $versioninfo->getInfo('name')); |
|
| 120 | - $this->_tpl->assign('module_version', $versioninfo->getInfo('version')); |
|
| 121 | - $this->_tpl->assign('module_status_version', $versioninfo->getInfo('status_version')); |
|
| 122 | - |
|
| 123 | - // Left headings... |
|
| 124 | - if ('' !== $versioninfo->getInfo('author_realname')) { |
|
| 125 | - $author_name = $versioninfo->getInfo('author') . ' (' . $versioninfo->getInfo('author_realname') . ')'; |
|
| 126 | - } else { |
|
| 127 | - $author_name = $versioninfo->getInfo('author'); |
|
| 128 | - } |
|
| 129 | - $this->_tpl->assign('module_author_name', $author_name); |
|
| 130 | - |
|
| 131 | - $this->_tpl->assign('module_license', $versioninfo->getInfo('license')); |
|
| 132 | - |
|
| 133 | - $this->_tpl->assign('module_credits', $versioninfo->getInfo('credits')); |
|
| 134 | - |
|
| 135 | - // Developers Information |
|
| 136 | - $this->_tpl->assign('module_developer_lead', $versioninfo->getInfo('developer_lead')); |
|
| 137 | - $this->_tpl->assign('module_developer_contributor', $versioninfo->getInfo('developer_contributor')); |
|
| 138 | - $this->_tpl->assign('module_developer_website_url', $versioninfo->getInfo('developer_website_url')); |
|
| 139 | - $this->_tpl->assign('module_developer_website_name', $versioninfo->getInfo('developer_website_name')); |
|
| 140 | - $this->_tpl->assign('module_developer_email', $versioninfo->getInfo('developer_email')); |
|
| 141 | - |
|
| 142 | - $people = $versioninfo->getInfo('people'); |
|
| 143 | - if ($people) { |
|
| 144 | - $this->_tpl->assign('module_people_developers', isset($people['developers']) ? array_map([$this, 'sanitize'], $people['developers']) : false); |
|
| 145 | - $this->_tpl->assign('module_people_testers', isset($people['testers']) ? array_map([$this, 'sanitize'], $people['testers']) : false); |
|
| 146 | - $this->_tpl->assign('module_people_translators', isset($people['translators']) ? array_map([$this, 'sanitize'], $people['translators']) : false); |
|
| 147 | - $this->_tpl->assign('module_people_documenters', isset($people['documenters']) ? array_map([$this, 'sanitize'], $people['documenters']) : false); |
|
| 148 | - $this->_tpl->assign('module_people_other', isset($people['other']) ? array_map([$this, 'sanitize'], $people['other']) : false); |
|
| 149 | - } |
|
| 150 | - //$this->_tpl->assign('module_developers', $versioninfo->getInfo('developer_email')); |
|
| 151 | - |
|
| 152 | - // Module Development information |
|
| 153 | - $this->_tpl->assign('module_date', $versioninfo->getInfo('date')); |
|
| 154 | - $this->_tpl->assign('module_status', $versioninfo->getInfo('status')); |
|
| 155 | - $this->_tpl->assign('module_demo_site_url', $versioninfo->getInfo('demo_site_url')); |
|
| 156 | - $this->_tpl->assign('module_demo_site_name', $versioninfo->getInfo('demo_site_name')); |
|
| 157 | - $this->_tpl->assign('module_support_site_url', $versioninfo->getInfo('support_site_url')); |
|
| 158 | - $this->_tpl->assign('module_support_site_name', $versioninfo->getInfo('support_site_name')); |
|
| 159 | - $this->_tpl->assign('module_submit_bug', $versioninfo->getInfo('submit_bug')); |
|
| 160 | - $this->_tpl->assign('module_submit_feature', $versioninfo->getInfo('submit_feature')); |
|
| 161 | - |
|
| 162 | - // Warning |
|
| 163 | - $this->_tpl->assign('module_warning', $this->sanitize($versioninfo->getInfo('warning'))); |
|
| 164 | - |
|
| 165 | - // Author's note |
|
| 166 | - $this->_tpl->assign('module_author_word', $versioninfo->getInfo('author_word')); |
|
| 167 | - |
|
| 168 | - // For changelog thanks to 3Dev |
|
| 169 | - global $xoopsModule; |
|
| 170 | - $filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt'; |
|
| 171 | - if (is_file($filename)) { |
|
| 172 | - $filesize = filesize($filename); |
|
| 173 | - $handle = fopen($filename, 'r'); |
|
| 174 | - $this->_tpl->assign('module_version_history', $myts->displayTarea(fread($handle, $filesize), true)); |
|
| 175 | - fclose($handle); |
|
| 176 | - } |
|
| 177 | - |
|
| 178 | - $this->_tpl->display('db:smartobject_about.tpl'); |
|
| 179 | - |
|
| 180 | - smart_modFooter(); |
|
| 181 | - |
|
| 182 | - xoops_cp_footer(); |
|
| 183 | - } |
|
| 59 | + $this->_aboutTitle = $aboutTitle; |
|
| 60 | + |
|
| 61 | + $this->_lang_developer_contributor = _CO_SOBJECT_DEVELOPER_CONTRIBUTOR; |
|
| 62 | + $this->_lang_developer_website = _CO_SOBJECT_DEVELOPER_WEBSITE; |
|
| 63 | + $this->_lang_developer_email = _CO_SOBJECT_DEVELOPER_EMAIL; |
|
| 64 | + $this->_lang_developer_credits = _CO_SOBJECT_DEVELOPER_CREDITS; |
|
| 65 | + $this->_lang_module_info = _CO_SOBJECT_MODULE_INFO; |
|
| 66 | + $this->_lang_module_status = _CO_SOBJECT_MODULE_STATUS; |
|
| 67 | + $this->_lang_module_release_date = _CO_SOBJECT_MODULE_RELEASE_DATE; |
|
| 68 | + $this->_lang_module_demo = _CO_SOBJECT_MODULE_DEMO; |
|
| 69 | + $this->_lang_module_support = _CO_SOBJECT_MODULE_SUPPORT; |
|
| 70 | + $this->_lang_module_bug = _CO_SOBJECT_MODULE_BUG; |
|
| 71 | + $this->_lang_module_submit_bug = _CO_SOBJECT_MODULE_SUBMIT_BUG; |
|
| 72 | + $this->_lang_module_feature = _CO_SOBJECT_MODULE_FEATURE; |
|
| 73 | + $this->_lang_module_submit_feature = _CO_SOBJECT_MODULE_SUBMIT_FEATURE; |
|
| 74 | + $this->_lang_module_disclaimer = _CO_SOBJECT_MODULE_DISCLAIMER; |
|
| 75 | + $this->_lang_author_word = _CO_SOBJECT_AUTHOR_WORD; |
|
| 76 | + $this->_lang_version_history = _CO_SOBJECT_VERSION_HISTORY; |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * @param $value |
|
| 81 | + * @return mixed |
|
| 82 | + */ |
|
| 83 | + public function sanitize($value) |
|
| 84 | + { |
|
| 85 | + $myts = \MyTextSanitizer::getInstance(); |
|
| 86 | + |
|
| 87 | + return $myts->displayTarea($value, 1); |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + public function render() |
|
| 91 | + { |
|
| 92 | + /** |
|
| 93 | + * @todo move the output to a template |
|
| 94 | + * @todo make the output XHTML compliant |
|
| 95 | + */ |
|
| 96 | + |
|
| 97 | + $myts = \MyTextSanitizer::getInstance(); |
|
| 98 | + |
|
| 99 | + global $xoopsModule; |
|
| 100 | + |
|
| 101 | + smart_xoops_cp_header(); |
|
| 102 | + |
|
| 103 | + /** @var XoopsModuleHandler $moduleHandler */ |
|
| 104 | + $moduleHandler = xoops_getHandler('module'); |
|
| 105 | + $versioninfo = $moduleHandler->get($xoopsModule->getVar('mid')); |
|
| 106 | + |
|
| 107 | + //smart_adminMenu(-1, $this->_aboutTitle . " " . $versioninfo->getInfo('name')); |
|
| 108 | + |
|
| 109 | + require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 110 | + |
|
| 111 | + // --- |
|
| 112 | + // 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated. |
|
| 113 | + // $this->_tpl = new \XoopsTpl(); |
|
| 114 | + $this->_tpl = new \XoopsTpl(); |
|
| 115 | + // --- |
|
| 116 | + |
|
| 117 | + $this->_tpl->assign('module_url', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/'); |
|
| 118 | + $this->_tpl->assign('module_image', $versioninfo->getInfo('image')); |
|
| 119 | + $this->_tpl->assign('module_name', $versioninfo->getInfo('name')); |
|
| 120 | + $this->_tpl->assign('module_version', $versioninfo->getInfo('version')); |
|
| 121 | + $this->_tpl->assign('module_status_version', $versioninfo->getInfo('status_version')); |
|
| 122 | + |
|
| 123 | + // Left headings... |
|
| 124 | + if ('' !== $versioninfo->getInfo('author_realname')) { |
|
| 125 | + $author_name = $versioninfo->getInfo('author') . ' (' . $versioninfo->getInfo('author_realname') . ')'; |
|
| 126 | + } else { |
|
| 127 | + $author_name = $versioninfo->getInfo('author'); |
|
| 128 | + } |
|
| 129 | + $this->_tpl->assign('module_author_name', $author_name); |
|
| 130 | + |
|
| 131 | + $this->_tpl->assign('module_license', $versioninfo->getInfo('license')); |
|
| 132 | + |
|
| 133 | + $this->_tpl->assign('module_credits', $versioninfo->getInfo('credits')); |
|
| 134 | + |
|
| 135 | + // Developers Information |
|
| 136 | + $this->_tpl->assign('module_developer_lead', $versioninfo->getInfo('developer_lead')); |
|
| 137 | + $this->_tpl->assign('module_developer_contributor', $versioninfo->getInfo('developer_contributor')); |
|
| 138 | + $this->_tpl->assign('module_developer_website_url', $versioninfo->getInfo('developer_website_url')); |
|
| 139 | + $this->_tpl->assign('module_developer_website_name', $versioninfo->getInfo('developer_website_name')); |
|
| 140 | + $this->_tpl->assign('module_developer_email', $versioninfo->getInfo('developer_email')); |
|
| 141 | + |
|
| 142 | + $people = $versioninfo->getInfo('people'); |
|
| 143 | + if ($people) { |
|
| 144 | + $this->_tpl->assign('module_people_developers', isset($people['developers']) ? array_map([$this, 'sanitize'], $people['developers']) : false); |
|
| 145 | + $this->_tpl->assign('module_people_testers', isset($people['testers']) ? array_map([$this, 'sanitize'], $people['testers']) : false); |
|
| 146 | + $this->_tpl->assign('module_people_translators', isset($people['translators']) ? array_map([$this, 'sanitize'], $people['translators']) : false); |
|
| 147 | + $this->_tpl->assign('module_people_documenters', isset($people['documenters']) ? array_map([$this, 'sanitize'], $people['documenters']) : false); |
|
| 148 | + $this->_tpl->assign('module_people_other', isset($people['other']) ? array_map([$this, 'sanitize'], $people['other']) : false); |
|
| 149 | + } |
|
| 150 | + //$this->_tpl->assign('module_developers', $versioninfo->getInfo('developer_email')); |
|
| 151 | + |
|
| 152 | + // Module Development information |
|
| 153 | + $this->_tpl->assign('module_date', $versioninfo->getInfo('date')); |
|
| 154 | + $this->_tpl->assign('module_status', $versioninfo->getInfo('status')); |
|
| 155 | + $this->_tpl->assign('module_demo_site_url', $versioninfo->getInfo('demo_site_url')); |
|
| 156 | + $this->_tpl->assign('module_demo_site_name', $versioninfo->getInfo('demo_site_name')); |
|
| 157 | + $this->_tpl->assign('module_support_site_url', $versioninfo->getInfo('support_site_url')); |
|
| 158 | + $this->_tpl->assign('module_support_site_name', $versioninfo->getInfo('support_site_name')); |
|
| 159 | + $this->_tpl->assign('module_submit_bug', $versioninfo->getInfo('submit_bug')); |
|
| 160 | + $this->_tpl->assign('module_submit_feature', $versioninfo->getInfo('submit_feature')); |
|
| 161 | + |
|
| 162 | + // Warning |
|
| 163 | + $this->_tpl->assign('module_warning', $this->sanitize($versioninfo->getInfo('warning'))); |
|
| 164 | + |
|
| 165 | + // Author's note |
|
| 166 | + $this->_tpl->assign('module_author_word', $versioninfo->getInfo('author_word')); |
|
| 167 | + |
|
| 168 | + // For changelog thanks to 3Dev |
|
| 169 | + global $xoopsModule; |
|
| 170 | + $filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt'; |
|
| 171 | + if (is_file($filename)) { |
|
| 172 | + $filesize = filesize($filename); |
|
| 173 | + $handle = fopen($filename, 'r'); |
|
| 174 | + $this->_tpl->assign('module_version_history', $myts->displayTarea(fread($handle, $filesize), true)); |
|
| 175 | + fclose($handle); |
|
| 176 | + } |
|
| 177 | + |
|
| 178 | + $this->_tpl->display('db:smartobject_about.tpl'); |
|
| 179 | + |
|
| 180 | + smart_modFooter(); |
|
| 181 | + |
|
| 182 | + xoops_cp_footer(); |
|
| 183 | + } |
|
| 184 | 184 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | //smart_adminMenu(-1, $this->_aboutTitle . " " . $versioninfo->getInfo('name')); |
| 108 | 108 | |
| 109 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 109 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 110 | 110 | |
| 111 | 111 | // --- |
| 112 | 112 | // 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated. |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $this->_tpl = new \XoopsTpl(); |
| 115 | 115 | // --- |
| 116 | 116 | |
| 117 | - $this->_tpl->assign('module_url', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/'); |
|
| 117 | + $this->_tpl->assign('module_url', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/'); |
|
| 118 | 118 | $this->_tpl->assign('module_image', $versioninfo->getInfo('image')); |
| 119 | 119 | $this->_tpl->assign('module_name', $versioninfo->getInfo('name')); |
| 120 | 120 | $this->_tpl->assign('module_version', $versioninfo->getInfo('version')); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | // Left headings... |
| 124 | 124 | if ('' !== $versioninfo->getInfo('author_realname')) { |
| 125 | - $author_name = $versioninfo->getInfo('author') . ' (' . $versioninfo->getInfo('author_realname') . ')'; |
|
| 125 | + $author_name = $versioninfo->getInfo('author').' ('.$versioninfo->getInfo('author_realname').')'; |
|
| 126 | 126 | } else { |
| 127 | 127 | $author_name = $versioninfo->getInfo('author'); |
| 128 | 128 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | // For changelog thanks to 3Dev |
| 169 | 169 | global $xoopsModule; |
| 170 | - $filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt'; |
|
| 170 | + $filename = XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/changelog.txt'; |
|
| 171 | 171 | if (is_file($filename)) { |
| 172 | 172 | $filesize = filesize($filename); |
| 173 | 173 | $handle = fopen($filename, 'r'); |
@@ -27,35 +27,35 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | class Configurator |
| 29 | 29 | { |
| 30 | - public $name; |
|
| 31 | - public $paths = []; |
|
| 32 | - public $uploadFolders = []; |
|
| 33 | - public $copyBlankFiles = []; |
|
| 34 | - public $copyTestFolders = []; |
|
| 35 | - public $templateFolders = []; |
|
| 36 | - public $oldFiles = []; |
|
| 37 | - public $oldFolders = []; |
|
| 38 | - public $modCopyright; |
|
| 30 | + public $name; |
|
| 31 | + public $paths = []; |
|
| 32 | + public $uploadFolders = []; |
|
| 33 | + public $copyBlankFiles = []; |
|
| 34 | + public $copyTestFolders = []; |
|
| 35 | + public $templateFolders = []; |
|
| 36 | + public $oldFiles = []; |
|
| 37 | + public $oldFolders = []; |
|
| 38 | + public $modCopyright; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * Configurator constructor. |
|
| 42 | - */ |
|
| 43 | - public function __construct() |
|
| 44 | - { |
|
| 45 | - $moduleDirName = basename(dirname(__DIR__)); |
|
| 46 | - $capsDirName = strtoupper($moduleDirName); |
|
| 40 | + /** |
|
| 41 | + * Configurator constructor. |
|
| 42 | + */ |
|
| 43 | + public function __construct() |
|
| 44 | + { |
|
| 45 | + $moduleDirName = basename(dirname(__DIR__)); |
|
| 46 | + $capsDirName = strtoupper($moduleDirName); |
|
| 47 | 47 | |
| 48 | - require_once __DIR__ . '/../../include/config.php'; |
|
| 49 | - $config = getConfig(); |
|
| 48 | + require_once __DIR__ . '/../../include/config.php'; |
|
| 49 | + $config = getConfig(); |
|
| 50 | 50 | |
| 51 | - $this->name = $config->name; |
|
| 52 | - $this->paths = $config->paths; |
|
| 53 | - $this->uploadFolders = $config->uploadFolders; |
|
| 54 | - $this->copyBlankFiles = $config->copyBlankFiles; |
|
| 55 | - $this->copyTestFolders = $config->copyTestFolders; |
|
| 56 | - $this->templateFolders = $config->templateFolders; |
|
| 57 | - $this->oldFiles = $config->oldFiles; |
|
| 58 | - $this->oldFolders = $config->oldFolders; |
|
| 59 | - $this->modCopyright = $config->modCopyright; |
|
| 60 | - } |
|
| 51 | + $this->name = $config->name; |
|
| 52 | + $this->paths = $config->paths; |
|
| 53 | + $this->uploadFolders = $config->uploadFolders; |
|
| 54 | + $this->copyBlankFiles = $config->copyBlankFiles; |
|
| 55 | + $this->copyTestFolders = $config->copyTestFolders; |
|
| 56 | + $this->templateFolders = $config->templateFolders; |
|
| 57 | + $this->oldFiles = $config->oldFiles; |
|
| 58 | + $this->oldFolders = $config->oldFolders; |
|
| 59 | + $this->modCopyright = $config->modCopyright; |
|
| 60 | + } |
|
| 61 | 61 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | -require_once __DIR__ . '/../../include/common.php'; |
|
| 23 | +require_once __DIR__.'/../../include/common.php'; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Class Configurator |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $moduleDirName = basename(dirname(__DIR__)); |
| 46 | 46 | $capsDirName = strtoupper($moduleDirName); |
| 47 | 47 | |
| 48 | - require_once __DIR__ . '/../../include/config.php'; |
|
| 48 | + require_once __DIR__.'/../../include/config.php'; |
|
| 49 | 49 | $config = getConfig(); |
| 50 | 50 | |
| 51 | 51 | $this->name = $config->name; |
@@ -17,60 +17,60 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | trait ServerStats |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * serverStats() |
|
| 22 | - * |
|
| 23 | - * @return string |
|
| 24 | - */ |
|
| 25 | - public static function getServerStats() |
|
| 26 | - { |
|
| 27 | - //mb $wfdownloads = WfdownloadsWfdownloads::getInstance(); |
|
| 28 | - $moduleDirName = basename(dirname(dirname(__DIR__))); |
|
| 29 | - $moduleDirNameUpper = strtoupper($moduleDirName); |
|
| 30 | - xoops_loadLanguage('common', $moduleDirName); |
|
| 31 | - $html = ''; |
|
| 32 | - // $sql = 'SELECT metavalue'; |
|
| 33 | - // $sql .= ' FROM ' . $GLOBALS['xoopsDB']->prefix('wfdownloads_meta'); |
|
| 34 | - // $sql .= " WHERE metakey='version' LIMIT 1"; |
|
| 35 | - // $query = $GLOBALS['xoopsDB']->query($sql); |
|
| 36 | - // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
|
| 37 | - $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
| 38 | - $html .= "<div style='padding: 8px;'>\n"; |
|
| 39 | - // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
|
| 40 | - // $html .= "<br>\n"; |
|
| 41 | - // $html .= "<br>\n"; |
|
| 42 | - $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
| 43 | - $html .= "<ul>\n"; |
|
| 44 | - // |
|
| 45 | - $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
| 46 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
| 47 | - if (function_exists('gd_info')) { |
|
| 48 | - if (true === ($gdlib = gd_info())) { |
|
| 49 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
| 50 | - } |
|
| 51 | - } |
|
| 52 | - // |
|
| 53 | - // $safemode = ini_get('safe_mode') ? constant('CO_' . $moduleDirNameUpper . '_ON') . constant('CO_' . $moduleDirNameUpper . '_SAFEMODEPROBLEMS : constant('CO_' . $moduleDirNameUpper . '_OFF'); |
|
| 54 | - // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SAFEMODESTATUS . $safemode; |
|
| 55 | - // |
|
| 56 | - // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
|
| 57 | - // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
|
| 58 | - // |
|
| 59 | - $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
| 60 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
| 61 | - // |
|
| 62 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
|
| 63 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
|
| 64 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . ini_get('memory_limit') . "</span></b>\n"; |
|
| 65 | - $html .= "</ul>\n"; |
|
| 66 | - $html .= "<ul>\n"; |
|
| 67 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
| 68 | - $html .= "</ul>\n"; |
|
| 69 | - $html .= "<br>\n"; |
|
| 70 | - $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
| 71 | - $html .= '</div>'; |
|
| 72 | - $html .= '</fieldset><br>'; |
|
| 20 | + /** |
|
| 21 | + * serverStats() |
|
| 22 | + * |
|
| 23 | + * @return string |
|
| 24 | + */ |
|
| 25 | + public static function getServerStats() |
|
| 26 | + { |
|
| 27 | + //mb $wfdownloads = WfdownloadsWfdownloads::getInstance(); |
|
| 28 | + $moduleDirName = basename(dirname(dirname(__DIR__))); |
|
| 29 | + $moduleDirNameUpper = strtoupper($moduleDirName); |
|
| 30 | + xoops_loadLanguage('common', $moduleDirName); |
|
| 31 | + $html = ''; |
|
| 32 | + // $sql = 'SELECT metavalue'; |
|
| 33 | + // $sql .= ' FROM ' . $GLOBALS['xoopsDB']->prefix('wfdownloads_meta'); |
|
| 34 | + // $sql .= " WHERE metakey='version' LIMIT 1"; |
|
| 35 | + // $query = $GLOBALS['xoopsDB']->query($sql); |
|
| 36 | + // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
|
| 37 | + $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
| 38 | + $html .= "<div style='padding: 8px;'>\n"; |
|
| 39 | + // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
|
| 40 | + // $html .= "<br>\n"; |
|
| 41 | + // $html .= "<br>\n"; |
|
| 42 | + $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
| 43 | + $html .= "<ul>\n"; |
|
| 44 | + // |
|
| 45 | + $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
| 46 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
| 47 | + if (function_exists('gd_info')) { |
|
| 48 | + if (true === ($gdlib = gd_info())) { |
|
| 49 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | + // |
|
| 53 | + // $safemode = ini_get('safe_mode') ? constant('CO_' . $moduleDirNameUpper . '_ON') . constant('CO_' . $moduleDirNameUpper . '_SAFEMODEPROBLEMS : constant('CO_' . $moduleDirNameUpper . '_OFF'); |
|
| 54 | + // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SAFEMODESTATUS . $safemode; |
|
| 55 | + // |
|
| 56 | + // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
|
| 57 | + // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
|
| 58 | + // |
|
| 59 | + $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
| 60 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
| 61 | + // |
|
| 62 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
|
| 63 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
|
| 64 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . ini_get('memory_limit') . "</span></b>\n"; |
|
| 65 | + $html .= "</ul>\n"; |
|
| 66 | + $html .= "<ul>\n"; |
|
| 67 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
| 68 | + $html .= "</ul>\n"; |
|
| 69 | + $html .= "<br>\n"; |
|
| 70 | + $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
| 71 | + $html .= '</div>'; |
|
| 72 | + $html .= '</fieldset><br>'; |
|
| 73 | 73 | |
| 74 | - return $html; |
|
| 75 | - } |
|
| 74 | + return $html; |
|
| 75 | + } |
|
| 76 | 76 | } |
@@ -34,19 +34,19 @@ discard block |
||
| 34 | 34 | // $sql .= " WHERE metakey='version' LIMIT 1"; |
| 35 | 35 | // $query = $GLOBALS['xoopsDB']->query($sql); |
| 36 | 36 | // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
| 37 | - $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
| 37 | + $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>".constant('CO_'.$moduleDirNameUpper.'_IMAGEINFO')."</legend>\n"; |
|
| 38 | 38 | $html .= "<div style='padding: 8px;'>\n"; |
| 39 | 39 | // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
| 40 | 40 | // $html .= "<br>\n"; |
| 41 | 41 | // $html .= "<br>\n"; |
| 42 | - $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
| 42 | + $html .= '<div>'.constant('CO_'.$moduleDirNameUpper.'_SPHPINI')."</div>\n"; |
|
| 43 | 43 | $html .= "<ul>\n"; |
| 44 | 44 | // |
| 45 | - $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
| 46 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
| 45 | + $gdlib = function_exists('gd_info') ? '<span style="color: green;">'.constant('CO_'.$moduleDirNameUpper.'_GDON').'</span>' : '<span style="color: red;">'.constant('CO_'.$moduleDirNameUpper.'_GDOFF').'</span>'; |
|
| 46 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS').$gdlib; |
|
| 47 | 47 | if (function_exists('gd_info')) { |
| 48 | 48 | if (true === ($gdlib = gd_info())) { |
| 49 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
| 49 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBVERSION').'<b>'.$gdlib['GD Version'].'</b>'; |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | // |
@@ -56,18 +56,18 @@ discard block |
||
| 56 | 56 | // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
| 57 | 57 | // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
| 58 | 58 | // |
| 59 | - $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
| 60 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
| 59 | + $downloads = ini_get('file_uploads') ? '<span style="color: green;">'.constant('CO_'.$moduleDirNameUpper.'_ON').'</span>' : '<span style="color: red;">'.constant('CO_'.$moduleDirNameUpper.'_OFF').'</span>'; |
|
| 60 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS').$downloads; |
|
| 61 | 61 | // |
| 62 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
|
| 63 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
|
| 64 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . ini_get('memory_limit') . "</span></b>\n"; |
|
| 62 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE').' <b><span style="color: blue;">'.ini_get('upload_max_filesize')."</span></b>\n"; |
|
| 63 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE').' <b><span style="color: blue;">'.ini_get('post_max_size')."</span></b>\n"; |
|
| 64 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT').' <b><span style="color: blue;">'.ini_get('memory_limit')."</span></b>\n"; |
|
| 65 | 65 | $html .= "</ul>\n"; |
| 66 | 66 | $html .= "<ul>\n"; |
| 67 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
| 67 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERPATH').' <b>'.XOOPS_ROOT_PATH."</b>\n"; |
|
| 68 | 68 | $html .= "</ul>\n"; |
| 69 | 69 | $html .= "<br>\n"; |
| 70 | - $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
| 70 | + $html .= constant('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC')."\n"; |
|
| 71 | 71 | $html .= '</div>'; |
| 72 | 72 | $html .= '</fieldset><br>'; |
| 73 | 73 | |