@@ -14,27 +14,27 @@ |
||
| 14 | 14 | $config = array( |
| 15 | 15 | "mode" => 'image', |
| 16 | 16 | "name" => 'xoopscaptcha', |
| 17 | - "skipmember" => true, // Skip CAPTCHA check for members |
|
| 18 | - "maxattempt" => 100, // Maximum attempts for each session |
|
| 17 | + "skipmember" => true, // Skip CAPTCHA check for members |
|
| 18 | + "maxattempt" => 100, // Maximum attempts for each session |
|
| 19 | 19 | |
| 20 | - "num_chars" => 4, // Maximum characters |
|
| 20 | + "num_chars" => 4, // Maximum characters |
|
| 21 | 21 | |
| 22 | 22 | // For image mode, based on DuGris' SecurityImage |
| 23 | - "rootpath" => dirname(__FILE__), // __Absolute__ Path to the root of fonts and backgrounds |
|
| 24 | - "imagepath" => "uploads/captcha", // Path to temporary image files, __relative__ to XOOPS_ROOT_PATH |
|
| 25 | - "imageurl" => "modules/smartobject/include/captcha/scripts/img.php", // Path to the script for creating image, __relative__ to XOOPS_ROOT_PATH |
|
| 26 | - "casesensitive" => false, // Characters in image mode is case-sensitive |
|
| 27 | - "fontsize_min" => 12, // Minimum font-size |
|
| 28 | - "fontsize_max" => 12, // Maximum font-size |
|
| 29 | - "background_type" => 0, // Background type in image mode: 0 - bar; 1 - circle; 2 - line; 3 - rectangle; 4 - ellipse; 5 - polygon; 100 - generated from files |
|
| 30 | - "background_num" => 50, // Number of background images to generate |
|
| 23 | + "rootpath" => dirname(__FILE__), // __Absolute__ Path to the root of fonts and backgrounds |
|
| 24 | + "imagepath" => "uploads/captcha", // Path to temporary image files, __relative__ to XOOPS_ROOT_PATH |
|
| 25 | + "imageurl" => "modules/smartobject/include/captcha/scripts/img.php", // Path to the script for creating image, __relative__ to XOOPS_ROOT_PATH |
|
| 26 | + "casesensitive" => false, // Characters in image mode is case-sensitive |
|
| 27 | + "fontsize_min" => 12, // Minimum font-size |
|
| 28 | + "fontsize_max" => 12, // Maximum font-size |
|
| 29 | + "background_type" => 0, // Background type in image mode: 0 - bar; 1 - circle; 2 - line; 3 - rectangle; 4 - ellipse; 5 - polygon; 100 - generated from files |
|
| 30 | + "background_num" => 50, // Number of background images to generate |
|
| 31 | 31 | "polygon_point" => 3, |
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | 34 | $language = preg_replace("/[^a-z0-9_\-]/i", "", $GLOBALS["xoopsConfig"]["language"]); |
| 35 | 35 | |
| 36 | -if(! @include_once dirname(__FILE__)."/language/{$language}.php") { |
|
| 37 | - require_once dirname(__FILE__)."/language/english.php"; |
|
| 36 | +if (!@include_once dirname(__FILE__) . "/language/{$language}.php") { |
|
| 37 | + require_once dirname(__FILE__) . "/language/english.php"; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | return $config; |
@@ -8,12 +8,12 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | include_once("header.php"); |
| 11 | -require_once SMARTOBJECT_ROOT_PATH.'class/smartloader.php'; |
|
| 12 | -require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectlink.php'; |
|
| 13 | -require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 11 | +require_once SMARTOBJECT_ROOT_PATH . 'class/smartloader.php'; |
|
| 12 | +require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectlink.php'; |
|
| 13 | +require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 14 | 14 | |
| 15 | 15 | $xoopsTpl = new XoopsTpl(); |
| 16 | -$myts =& MyTextSanitizer::getInstance(); |
|
| 16 | +$myts = & MyTextSanitizer::getInstance(); |
|
| 17 | 17 | $xoopsConfig['sitename'] = $myts->displayTarea($xoopsConfig['sitename']); |
| 18 | 18 | |
| 19 | 19 | xoops_header(false); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | switch ($op) { |
| 29 | 29 | case 'sendlink' : |
| 30 | 30 | |
| 31 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
| 31 | + include_once XOOPS_ROOT_PATH . "/modules/smartobject/class/smartobjectcontroller.php"; |
|
| 32 | 32 | $controller = new SmartObjectController($smartobject_link_handler); |
| 33 | 33 | |
| 34 | 34 | $linkObj = $controller->storeSmartObject(); |
@@ -38,15 +38,15 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - $xoopsMailer =& getMailer(); |
|
| 41 | + $xoopsMailer = & getMailer(); |
|
| 42 | 42 | $xoopsMailer->useMail(); |
| 43 | - $xoopsMailer->setTemplateDir('language/'.$xoopsConfig['language'].'/mail_template'); |
|
| 43 | + $xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template'); |
|
| 44 | 44 | |
| 45 | 45 | $xoopsMailer->setTemplate('sendlink.tpl'); |
| 46 | 46 | $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']); |
| 47 | 47 | $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name')); |
| 48 | 48 | $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name')); |
| 49 | - $xoopsMailer->assign('SITEURL', XOOPS_URL."/"); |
|
| 49 | + $xoopsMailer->assign('SITEURL', XOOPS_URL . "/"); |
|
| 50 | 50 | $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
| 51 | 51 | $xoopsMailer->assign('MESSAGE', $_POST['body']); |
| 52 | 52 | $xoopsMailer->setToEmails($linkObj->getVar('to_email')); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $linkObj->setVar('date', time()); |
| 97 | 97 | $linkObj->hideFieldFromForm(array('from_uid', 'to_uid', 'link', 'mid', 'mid_name')); |
| 98 | 98 | |
| 99 | - $form = $linkObj->getForm(_CO_SOBJECT_SEND_LINK_FORM, 'sendlink', false, _SEND,'javascript:window.close();'); |
|
| 99 | + $form = $linkObj->getForm(_CO_SOBJECT_SEND_LINK_FORM, 'sendlink', false, _SEND, 'javascript:window.close();'); |
|
| 100 | 100 | |
| 101 | 101 | $form->assign($xoopsTpl); |
| 102 | 102 | |
@@ -176,7 +176,7 @@ |
||
| 176 | 176 | define('_CO_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION2', "Vertical with icons"); |
| 177 | 177 | define('_CO_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION3', "Vertical no icon"); |
| 178 | 178 | define('_CO_SOBJECT_CURRENT_FILE', "Current file: "); |
| 179 | -define('_CO_SOBJECT_URL_FILE_DSC', "Alternatively, you can use an URL. If you select a file via 'Browse' button, URL will be ignored. You can use the tag {XOOPS_URL} to print ".XOOPS_URL); |
|
| 179 | +define('_CO_SOBJECT_URL_FILE_DSC', "Alternatively, you can use an URL. If you select a file via 'Browse' button, URL will be ignored. You can use the tag {XOOPS_URL} to print " . XOOPS_URL); |
|
| 180 | 180 | define('_CO_SOBJECT_URL_FILE', "URL: "); |
| 181 | 181 | define('_CO_SOBJECT_UPLOAD', "Select a file to upload: "); |
| 182 | 182 | |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | include_once "../../mainfile.php"; |
| 11 | -include_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'; |
|
| 11 | +include_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'; |
|
| 12 | 12 | |
| 13 | 13 | smart_loadCommonLanguageFile(); |
| 14 | 14 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | var $_sortable; |
| 33 | 33 | var $_customCaption; |
| 34 | 34 | |
| 35 | - function SmartObjectColumn($keyname, $align='left', $width=false, $customMethodForValue=false, $param = false, $customCaption = false, $sortable = true) { |
|
| 35 | + function SmartObjectColumn($keyname, $align = 'left', $width = false, $customMethodForValue = false, $param = false, $customCaption = false, $sortable = true) { |
|
| 36 | 36 | $this->_keyname = $keyname; |
| 37 | 37 | $this->_align = $align; |
| 38 | 38 | $this->_width = $width; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | var $_columns; |
| 86 | 86 | var $_criteria; |
| 87 | 87 | var $_actions; |
| 88 | - var $_objects=false; |
|
| 88 | + var $_objects = false; |
|
| 89 | 89 | var $_aObjects; |
| 90 | 90 | var $_custom_actions; |
| 91 | 91 | var $_sortsel; |
@@ -100,14 +100,14 @@ discard block |
||
| 100 | 100 | var $_tempObject; |
| 101 | 101 | var $_tpl; |
| 102 | 102 | var $_introButtons; |
| 103 | - var $_quickSearch=false; |
|
| 104 | - var $_actionButtons=false; |
|
| 105 | - var $_head_css_class='bg3'; |
|
| 106 | - var $_hasActions=false; |
|
| 107 | - var $_userSide=false; |
|
| 108 | - var $_printerFriendlyPage=false; |
|
| 109 | - var $_tableHeader=false; |
|
| 110 | - var $_tableFooter=false; |
|
| 103 | + var $_quickSearch = false; |
|
| 104 | + var $_actionButtons = false; |
|
| 105 | + var $_head_css_class = 'bg3'; |
|
| 106 | + var $_hasActions = false; |
|
| 107 | + var $_userSide = false; |
|
| 108 | + var $_printerFriendlyPage = false; |
|
| 109 | + var $_tableHeader = false; |
|
| 110 | + var $_tableFooter = false; |
|
| 111 | 111 | var $_showActionsColumnTitle = true; |
| 112 | 112 | var $_isTree = false; |
| 113 | 113 | var $_showFilterAndLimit = true; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * |
| 126 | 126 | * @return array |
| 127 | 127 | */ |
| 128 | - function SmartObjectTable(&$objectHandler, $criteria=false, $actions=array('edit', 'delete'), $userSide=false) |
|
| 128 | + function SmartObjectTable(&$objectHandler, $criteria = false, $actions = array('edit', 'delete'), $userSide = false) |
|
| 129 | 129 | { |
| 130 | 130 | $this->_id = $objectHandler->className; |
| 131 | 131 | $this->_objectHandler = $objectHandler; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - function addActionButton($op, $caption=false, $text=false) { |
|
| 145 | + function addActionButton($op, $caption = false, $text = false) { |
|
| 146 | 146 | $action = array( |
| 147 | 147 | 'op' => $op, |
| 148 | 148 | 'caption' => $caption, |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $this->_printerFriendlyPage = $current_url . '&print'; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - function addQuickSearch($fields, $caption=_CO_SOBJECT_QUICK_SEARCH) { |
|
| 173 | + function addQuickSearch($fields, $caption = _CO_SOBJECT_QUICK_SEARCH) { |
|
| 174 | 174 | $this->_quickSearch = array('fields' => $fields, 'caption' => $caption); |
| 175 | 175 | } |
| 176 | 176 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | return smart_getCookieVar($_SERVER['PHP_SELF'] . '_' . $this->_id . '_ordersel', 'ASC'); |
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | - function addWithSelectedActions($actions = array()){ |
|
| 216 | + function addWithSelectedActions($actions = array()) { |
|
| 217 | 217 | $this->addColumn(new SmartObjectColumn('checked', 'center', 20, false, false, ' ')); |
| 218 | 218 | $this->_withSelectedActions = $actions; |
| 219 | 219 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | * @param string $key key to the field that will be used for sorting |
| 225 | 225 | * @param string $method method of the handler that will be called to populate the options when this filter is selected |
| 226 | 226 | */ |
| 227 | - function addFilter($key, $method, $default=false) { |
|
| 227 | + function addFilter($key, $method, $default = false) { |
|
| 228 | 228 | $this->_filterseloptions[$key] = $method; |
| 229 | 229 | $this->_filtersel2optionsDefault = $default; |
| 230 | 230 | } |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | $aObject = array(); |
| 280 | 280 | |
| 281 | - $i=0; |
|
| 281 | + $i = 0; |
|
| 282 | 282 | |
| 283 | 283 | $aColumns = array(); |
| 284 | 284 | |
@@ -286,23 +286,23 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | $aColumn = array(); |
| 288 | 288 | |
| 289 | - if ($i==0) { |
|
| 289 | + if ($i == 0) { |
|
| 290 | 290 | $class = "head"; |
| 291 | 291 | } elseif ($i % 2 == 0) { |
| 292 | 292 | $class = "even"; |
| 293 | 293 | } else { |
| 294 | 294 | $class = "odd"; |
| 295 | 295 | } |
| 296 | - if(method_exists($object, 'initiateCustomFields')){ |
|
| 296 | + if (method_exists($object, 'initiateCustomFields')) { |
|
| 297 | 297 | //$object->initiateCustomFields(); |
| 298 | 298 | } |
| 299 | - if($column->_keyname == 'checked'){ |
|
| 300 | - $value = '<input type ="checkbox" name="selected_smartobjects[]" value="'.$object->id().'" />'; |
|
| 299 | + if ($column->_keyname == 'checked') { |
|
| 300 | + $value = '<input type ="checkbox" name="selected_smartobjects[]" value="' . $object->id() . '" />'; |
|
| 301 | 301 | }elseif ($column->_customMethodForValue && method_exists($object, $column->_customMethodForValue)) { |
| 302 | 302 | $method = $column->_customMethodForValue; |
| 303 | - if($column->_param){ |
|
| 303 | + if ($column->_param) { |
|
| 304 | 304 | $value = $object->$method($column->_param); |
| 305 | - }else{ |
|
| 305 | + } else { |
|
| 306 | 306 | $value = $object->$method(); |
| 307 | 307 | } |
| 308 | 308 | } else { |
@@ -366,8 +366,8 @@ discard block |
||
| 366 | 366 | $this->_hasActions = $doWeHaveActions; |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - function fetchObjects($debug=false) { |
|
| 370 | - return $this->_objectHandler->getObjects($this->_criteria, true,true, false, $debug); |
|
| 369 | + function fetchObjects($debug = false) { |
|
| 370 | + return $this->_objectHandler->getObjects($this->_criteria, true, true, false, $debug); |
|
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | function getDefaultFilter() { |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | unset($field); |
| 388 | 388 | |
| 389 | 389 | if ($this->_filterseloptions) { |
| 390 | - foreach($this->_filterseloptions as $key=>$value) { |
|
| 390 | + foreach ($this->_filterseloptions as $key=>$value) { |
|
| 391 | 391 | $field = array(); |
| 392 | 392 | if (is_array($value)) { |
| 393 | 393 | $field['caption'] = $key; |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | function getFilters2Array() { |
| 421 | 421 | $ret = array(); |
| 422 | 422 | |
| 423 | - foreach($this->_filtersel2options as $key=>$value) { |
|
| 423 | + foreach ($this->_filtersel2options as $key=>$value) { |
|
| 424 | 424 | $field = array(); |
| 425 | 425 | $field['caption'] = $value; |
| 426 | 426 | $field['selected'] = $this->_filtersel2 == $key ? "selected='selected'" : ''; |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | * What was $params_of_the_options_sel doing again ? |
| 440 | 440 | */ |
| 441 | 441 | //$this->_tpl->assign('smartobject_optionssel_action', $_SERVER['PHP_SELF'] . "?" . implode('&', $params_of_the_options_sel)); |
| 442 | - $this->_tpl->assign('smartobject_optionssel_action', $current_url ); |
|
| 442 | + $this->_tpl->assign('smartobject_optionssel_action', $current_url); |
|
| 443 | 443 | $this->_tpl->assign('smartobject_optionssel_limitsArray', $limitsArray); |
| 444 | 444 | } |
| 445 | 445 | |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | - function render($fetchOnly=false, $debug=false) |
|
| 508 | + function render($fetchOnly = false, $debug = false) |
|
| 509 | 509 | { |
| 510 | 510 | include_once XOOPS_ROOT_PATH . '/class/template.php'; |
| 511 | 511 | |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | * Since we may not have a SmartObject to look into now, let's create one for this purpose |
| 517 | 517 | * and we will free it after |
| 518 | 518 | */ |
| 519 | - $this->_tempObject =& $this->_objectHandler->create(); |
|
| 519 | + $this->_tempObject = & $this->_objectHandler->create(); |
|
| 520 | 520 | |
| 521 | 521 | $this->_criteria->setStart(isset($_GET['start' . $this->_objectHandler->keyName]) ? intval($_GET['start' . $this->_objectHandler->keyName]) : 0); |
| 522 | 522 | |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | if (isset($_POST['quicksearch_' . $this->_id]) && $_POST['quicksearch_' . $this->_id] != '') { |
| 574 | 574 | $quicksearch_criteria = new CriteriaCompo(); |
| 575 | 575 | if (is_array($this->_quickSearch['fields'])) { |
| 576 | - foreach($this->_quickSearch['fields'] as $v) { |
|
| 576 | + foreach ($this->_quickSearch['fields'] as $v) { |
|
| 577 | 577 | $quicksearch_criteria->add(new Criteria($v, '%' . $_POST['quicksearch_' . $this->_id] . '%', 'LIKE'), 'OR'); |
| 578 | 578 | } |
| 579 | 579 | } else { |
@@ -626,11 +626,11 @@ discard block |
||
| 626 | 626 | $current_url = $current_urls['full_phpself']; |
| 627 | 627 | $query_string = $current_urls['querystring']; |
| 628 | 628 | if ($query_string) { |
| 629 | - $query_string = str_replace('?', '',$query_string); |
|
| 629 | + $query_string = str_replace('?', '', $query_string); |
|
| 630 | 630 | } |
| 631 | 631 | $query_stringArray = explode('&', $query_string); |
| 632 | 632 | $new_query_stringArray = array(); |
| 633 | - foreach($query_stringArray as $query_string) { |
|
| 633 | + foreach ($query_stringArray as $query_string) { |
|
| 634 | 634 | if (strpos($query_string, 'sortsel') == FALSE && strpos($query_string, 'ordersel') == FALSE) { |
| 635 | 635 | $new_query_stringArray[] = $query_string; |
| 636 | 636 | } |
@@ -651,12 +651,12 @@ discard block |
||
| 651 | 651 | $aColumn['width'] = $column->getWidth(); |
| 652 | 652 | $aColumn['align'] = $column->getAlign(); |
| 653 | 653 | $aColumn['key'] = $column->getKeyName(); |
| 654 | - if($column->_keyname == 'checked'){ |
|
| 654 | + if ($column->_keyname == 'checked') { |
|
| 655 | 655 | $aColumn['caption'] = '<input type ="checkbox" id="checkall_smartobjects" name="checkall_smartobjects"' . |
| 656 | - ' value="checkall_smartobjects" onclick="smartobject_checkall(window.document.form_'.$this->_id.', \'selected_smartobjects\');" />'; |
|
| 657 | - }elseif($column->getCustomCaption()){ |
|
| 656 | + ' value="checkall_smartobjects" onclick="smartobject_checkall(window.document.form_' . $this->_id . ', \'selected_smartobjects\');" />'; |
|
| 657 | + }elseif ($column->getCustomCaption()) { |
|
| 658 | 658 | $aColumn['caption'] = $column->getCustomCaption(); |
| 659 | - }else{ |
|
| 659 | + } else { |
|
| 660 | 660 | $aColumn['caption'] = isset($this->_tempObject->vars[$column->getKeyName()]['form_caption']) ? $this->_tempObject->vars[$column->getKeyName()]['form_caption'] : $column->getKeyName(); |
| 661 | 661 | } |
| 662 | 662 | // Are we doing a GET sort on this column ? |
@@ -664,14 +664,14 @@ discard block |
||
| 664 | 664 | $order = isset($_GET[$this->_objectHandler->_itemname . '_' . 'ordersel']) ? $_GET[$this->_objectHandler->_itemname . '_' . 'ordersel'] : 'DESC'; |
| 665 | 665 | |
| 666 | 666 | if (isset($_REQUEST['quicksearch_' . $this->_id]) && $_REQUEST['quicksearch_' . $this->_id] != '') { |
| 667 | - $qs_param = "&quicksearch_".$this->_id."=".$_REQUEST['quicksearch_' . $this->_id]; |
|
| 667 | + $qs_param = "&quicksearch_" . $this->_id . "=" . $_REQUEST['quicksearch_' . $this->_id]; |
|
| 668 | 668 | } |
| 669 | 669 | if (!$this->_enableColumnsSorting || $column->_keyname == 'checked' || !$column->isSortable()) { |
| 670 | - $aColumn['caption'] = $aColumn['caption']; |
|
| 670 | + $aColumn['caption'] = $aColumn['caption']; |
|
| 671 | 671 | } elseif ($getSort) { |
| 672 | - $aColumn['caption'] = '<a href="' . $current_url . '?' . $this->_objectHandler->_itemname . '_' . 'sortsel=' . $column->getKeyName() . '&' . $this->_objectHandler->_itemname . '_' . 'ordersel=' . $orderArray[$order]['neworder'].$qs_param . '&' . $new_query_string . '">' . $aColumn['caption'] . ' <img src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . $orderArray[$order]['image'] . '" alt="ASC" /></a>'; |
|
| 672 | + $aColumn['caption'] = '<a href="' . $current_url . '?' . $this->_objectHandler->_itemname . '_' . 'sortsel=' . $column->getKeyName() . '&' . $this->_objectHandler->_itemname . '_' . 'ordersel=' . $orderArray[$order]['neworder'] . $qs_param . '&' . $new_query_string . '">' . $aColumn['caption'] . ' <img src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . $orderArray[$order]['image'] . '" alt="ASC" /></a>'; |
|
| 673 | 673 | } else { |
| 674 | - $aColumn['caption'] = '<a href="' . $current_url . '?' . $this->_objectHandler->_itemname . '_' . 'sortsel=' . $column->getKeyName() . '&' . $this->_objectHandler->_itemname . '_' . 'ordersel=ASC'.$qs_param.'&' . $new_query_string . '">' . $aColumn['caption'] . '</a>'; |
|
| 674 | + $aColumn['caption'] = '<a href="' . $current_url . '?' . $this->_objectHandler->_itemname . '_' . 'sortsel=' . $column->getKeyName() . '&' . $this->_objectHandler->_itemname . '_' . 'ordersel=ASC' . $qs_param . '&' . $new_query_string . '">' . $aColumn['caption'] . '</a>'; |
|
| 675 | 675 | } |
| 676 | 676 | $aColumns[] = $aColumn; |
| 677 | 677 | } |
@@ -695,22 +695,22 @@ discard block |
||
| 695 | 695 | $this->_tpl->assign('smartobject_actionButtons', $this->_actionButtons); |
| 696 | 696 | $this->_tpl->assign('smartobject_introButtons', $this->_introButtons); |
| 697 | 697 | $this->_tpl->assign('smartobject_id', $this->_id); |
| 698 | - if(!empty($this->_withSelectedActions)){ |
|
| 698 | + if (!empty($this->_withSelectedActions)) { |
|
| 699 | 699 | $this->_tpl->assign('smartobject_withSelectedActions', $this->_withSelectedActions); |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | $smartobject_table_template = $this->_customTemplate ? $this->_customTemplate : 'smartobject_smarttable_display.html'; |
| 703 | 703 | if ($fetchOnly) { |
| 704 | - return $this->_tpl->fetch( 'db:' . $smartobject_table_template ); |
|
| 704 | + return $this->_tpl->fetch('db:' . $smartobject_table_template); |
|
| 705 | 705 | } else { |
| 706 | - $this->_tpl->display( 'db:' . $smartobject_table_template ); |
|
| 706 | + $this->_tpl->display('db:' . $smartobject_table_template); |
|
| 707 | 707 | } |
| 708 | 708 | } |
| 709 | 709 | |
| 710 | 710 | function disableColumnsSorting() { |
| 711 | 711 | $this->_enableColumnsSorting = false; |
| 712 | 712 | } |
| 713 | - function fetch($debug=false) { |
|
| 713 | + function fetch($debug = false) { |
|
| 714 | 714 | return $this->render(true, $debug); |
| 715 | 715 | } |
| 716 | 716 | } |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | if (!defined("XOOPS_ROOT_PATH")) { |
| 31 | 31 | die("XOOPS root path not defined"); |
| 32 | 32 | } |
| 33 | -include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobject.php"; |
|
| 33 | +include_once XOOPS_ROOT_PATH . "/modules/smartobject/class/smartobject.php"; |
|
| 34 | 34 | class SmartobjectLink extends SmartObject { |
| 35 | 35 | |
| 36 | 36 | function SmartobjectLink() { |
| 37 | 37 | $this->initVar('linkid', XOBJ_DTYPE_INT, '', true); |
| 38 | - $this->initVar('date', XOBJ_DTYPE_INT, 0, false, null,'', false, _CO_SOBJECT_LINK_DATE, '', true, true, false); |
|
| 38 | + $this->initVar('date', XOBJ_DTYPE_INT, 0, false, null, '', false, _CO_SOBJECT_LINK_DATE, '', true, true, false); |
|
| 39 | 39 | $this->initVar('from_uid', XOBJ_DTYPE_INT, '', false, null, '', false, _CO_SOBJECT_LINK_FROM_UID, _CO_SOBJECT_LINK_FROM_UID_DSC); |
| 40 | 40 | $this->initVar('from_email', XOBJ_DTYPE_TXTBOX, '', true, 255, '', false, _CO_SOBJECT_LINK_FROM_EMAIL, _CO_SOBJECT_LINK_FROM_EMAIL_DSC, true); |
| 41 | 41 | $this->initVar('from_name', XOBJ_DTYPE_TXTBOX, '', true, 255, '', false, _CO_SOBJECT_LINK_FROM_NAME, _CO_SOBJECT_LINK_FROM_NAME_DSC, true); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | function getVar($key, $format = 's') { |
| 62 | 62 | if ($format == 's' && in_array($key, array('from_uid', 'to_uid', 'date', 'link'))) { |
| 63 | - return call_user_func(array($this,$key)); |
|
| 63 | + return call_user_func(array($this, $key)); |
|
| 64 | 64 | } |
| 65 | 65 | return parent::getVar($key, $format); |
| 66 | 66 | } |
@@ -70,24 +70,24 @@ discard block |
||
| 70 | 70 | return $ret; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - function to_uid($withContact=false) { |
|
| 73 | + function to_uid($withContact = false) { |
|
| 74 | 74 | $ret = smart_getLinkedUnameFromId($this->getVar('to_uid', 'e'), 1, null, true); |
| 75 | 75 | return $ret; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | function date() { |
| 79 | - $ret = formatTimestamp($this->getVar('date','e')); |
|
| 79 | + $ret = formatTimestamp($this->getVar('date', 'e')); |
|
| 80 | 80 | return $ret; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - function link($full=false) { |
|
| 84 | - $ret = $this->getVar('link','e'); |
|
| 83 | + function link($full = false) { |
|
| 84 | + $ret = $this->getVar('link', 'e'); |
|
| 85 | 85 | if ($full) { |
| 86 | 86 | $myts = MyTextSanitizer::getInstance(); |
| 87 | 87 | $ret = $myts->displayTarea($ret); |
| 88 | 88 | return $ret; |
| 89 | 89 | } else { |
| 90 | - $ret = '<a href="' . $ret . '" alt="' . $this->getVar('link','e') . '" title="' . $this->getVar('link','e') . '">' . _AM_SOBJECT_SENT_LINKS_GOTO . '</a>'; |
|
| 90 | + $ret = '<a href="' . $ret . '" alt="' . $this->getVar('link', 'e') . '" title="' . $this->getVar('link', 'e') . '">' . _AM_SOBJECT_SENT_LINKS_GOTO . '</a>'; |
|
| 91 | 91 | return $ret; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * </code> |
| 63 | 63 | */ |
| 64 | 64 | // public function __construct () |
| 65 | - function SmartHighlighter ($keywords, $singlewords = false, $replace_callback = null ) { |
|
| 65 | + function SmartHighlighter($keywords, $singlewords = false, $replace_callback = null) { |
|
| 66 | 66 | $this->keywords = $keywords; |
| 67 | 67 | $this->singlewords = $singlewords; |
| 68 | 68 | $this->replace_callback = $replace_callback; |
@@ -71,11 +71,11 @@ discard block |
||
| 71 | 71 | /** |
| 72 | 72 | * @access private |
| 73 | 73 | */ |
| 74 | - function replace ($replace_matches) { |
|
| 74 | + function replace($replace_matches) { |
|
| 75 | 75 | |
| 76 | - $patterns = array (); |
|
| 76 | + $patterns = array(); |
|
| 77 | 77 | if ($this->singlewords) { |
| 78 | - $keywords = explode (' ', $this->preg_keywords); |
|
| 78 | + $keywords = explode(' ', $this->preg_keywords); |
|
| 79 | 79 | foreach ($keywords as $keyword) { |
| 80 | 80 | $patterns[] = '/(?' . '>' . $keyword . '+)/si'; |
| 81 | 81 | } |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | $result = $replace_matches[0]; |
| 87 | 87 | |
| 88 | 88 | foreach ($patterns as $pattern) { |
| 89 | - if (!is_null ($this->replace_callback)) { |
|
| 90 | - $result = preg_replace_callback ($pattern, $this->replace_callback, $result); |
|
| 89 | + if (!is_null($this->replace_callback)) { |
|
| 90 | + $result = preg_replace_callback($pattern, $this->replace_callback, $result); |
|
| 91 | 91 | } else { |
| 92 | - $result = preg_replace ($pattern, '<span class="highlightedkey">\\0</span>', $result); |
|
| 92 | + $result = preg_replace($pattern, '<span class="highlightedkey">\\0</span>', $result); |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
@@ -99,11 +99,11 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * @access private |
| 101 | 101 | */ |
| 102 | - function highlight ($buffer) { |
|
| 102 | + function highlight($buffer) { |
|
| 103 | 103 | $buffer = '>' . $buffer . '<'; |
| 104 | - $this->preg_keywords = preg_replace ('/[^\w ]/si', '', $this->keywords); |
|
| 105 | - $buffer = preg_replace_callback ("/(\>(((?" . ">[^><]+)|(?R))*)\<)/is", array (&$this, 'replace'), $buffer); |
|
| 106 | - $buffer = substr ($buffer, 1, -1); |
|
| 104 | + $this->preg_keywords = preg_replace('/[^\w ]/si', '', $this->keywords); |
|
| 105 | + $buffer = preg_replace_callback("/(\>(((?" . ">[^><]+)|(?R))*)\<)/is", array(&$this, 'replace'), $buffer); |
|
| 106 | + $buffer = substr($buffer, 1, -1); |
|
| 107 | 107 | return $buffer; |
| 108 | 108 | } |
| 109 | 109 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | class SmartObjectTreeTable extends SmartObjectTable { |
| 25 | 25 | |
| 26 | - function SmartObjectTreeTable(&$objectHandler, $criteria=false, $actions=array('edit', 'delete'), $userSide=false) |
|
| 26 | + function SmartObjectTreeTable(&$objectHandler, $criteria = false, $actions = array('edit', 'delete'), $userSide = false) |
|
| 27 | 27 | { |
| 28 | 28 | $this->SmartObjectTable($objectHandler, $criteria, $actions, $userSide); |
| 29 | 29 | $this->_isTree = true; |
@@ -34,15 +34,15 @@ discard block |
||
| 34 | 34 | * @var int $parentid id of the parent which children we want to retreive |
| 35 | 35 | * @return array of SmartObject |
| 36 | 36 | */ |
| 37 | - function getChildrenOf($parentid=0) { |
|
| 37 | + function getChildrenOf($parentid = 0) { |
|
| 38 | 38 | return isset($this->_objects[$parentid]) ? $this->_objects[$parentid] : false; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - function createTableRow($object, $level=0) { |
|
| 41 | + function createTableRow($object, $level = 0) { |
|
| 42 | 42 | |
| 43 | 43 | $aObject = array(); |
| 44 | 44 | |
| 45 | - $i=0; |
|
| 45 | + $i = 0; |
|
| 46 | 46 | |
| 47 | 47 | $aColumns = array(); |
| 48 | 48 | $doWeHaveActions = false; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $aColumn = array(); |
| 53 | 53 | |
| 54 | - if ($i==0) { |
|
| 54 | + if ($i == 0) { |
|
| 55 | 55 | $class = "head"; |
| 56 | 56 | } elseif ($i % 2 == 0) { |
| 57 | 57 | $class = "even"; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $space = ''; |
| 77 | - if($column->getKeyName() == $this->_objectHandler->identifierName){ |
|
| 77 | + if ($column->getKeyName() == $this->_objectHandler->identifierName) { |
|
| 78 | 78 | for ($i = 0; $i < $level; $i++) { |
| 79 | 79 | $space = $space . '--'; |
| 80 | 80 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $childrenObjects = $this->getChildrenOf($object->id()); |
| 127 | 127 | |
| 128 | - $this->_hasActions =$this->_hasActions ? true : count($actions) > 0; |
|
| 128 | + $this->_hasActions = $this->_hasActions ? true : count($actions) > 0; |
|
| 129 | 129 | |
| 130 | 130 | if ($childrenObjects) { |
| 131 | 131 | $level++; |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | var $handler; |
| 17 | 17 | function SmartObjectPermissionHandler($handler) { |
| 18 | - $this->handler=$handler; |
|
| 18 | + $this->handler = $handler; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /* |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | static $groups; |
| 31 | 31 | |
| 32 | 32 | if (!isset($groups[$gperm_name]) || ($id != null && !isset($groups[$gperm_name][$id]))) { |
| 33 | - $smartModule =& $this->handler->getModuleInfo(); |
|
| 33 | + $smartModule = & $this->handler->getModuleInfo(); |
|
| 34 | 34 | //Get group permissions handler |
| 35 | - $gperm_handler =& xoops_gethandler('groupperm'); |
|
| 35 | + $gperm_handler = & xoops_gethandler('groupperm'); |
|
| 36 | 36 | |
| 37 | 37 | //Get groups allowed for an item id |
| 38 | 38 | $allowedgroups = $gperm_handler->getGroupIds($gperm_name, $id, $smartModule->getVar('mid')); |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | return isset($groups[$gperm_name][$id]) ? $groups[$gperm_name][$id] : array(); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - function getGrantedGroupsForIds($item_ids_array, $gperm_name=false) { |
|
| 45 | + function getGrantedGroupsForIds($item_ids_array, $gperm_name = false) { |
|
| 46 | 46 | |
| 47 | 47 | static $groups; |
| 48 | 48 | |
| 49 | - if ($gperm_name){ |
|
| 49 | + if ($gperm_name) { |
|
| 50 | 50 | if (isset($groups[$gperm_name])) { |
| 51 | 51 | return $groups[$gperm_name]; |
| 52 | 52 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | return $groups; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - $smartModule =& $this->handler->getModuleInfo(); |
|
| 58 | + $smartModule = & $this->handler->getModuleInfo(); |
|
| 59 | 59 | |
| 60 | 60 | $criteria = new CriteriaCompo(); |
| 61 | 61 | $criteria->add(new Criteria('gperm_modid', $smartModule->getVar('mid'))); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | //Get group permissions handler |
| 68 | - $gperm_handler =& xoops_gethandler('groupperm'); |
|
| 68 | + $gperm_handler = & xoops_gethandler('groupperm'); |
|
| 69 | 69 | |
| 70 | 70 | $permissionsObj = $gperm_handler->getObjects($criteria); |
| 71 | 71 | |
@@ -95,18 +95,18 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | if (!isset($permissions[$gperm_name]) || ($id != null && !isset($permissions[$gperm_name][$id]))) { |
| 97 | 97 | |
| 98 | - $smartModule =& $this->handler->getModuleInfo(); |
|
| 98 | + $smartModule = & $this->handler->getModuleInfo(); |
|
| 99 | 99 | |
| 100 | 100 | if (is_object($smartModule)) { |
| 101 | 101 | |
| 102 | 102 | //Get group permissions handler |
| 103 | - $gperm_handler =& xoops_gethandler('groupperm'); |
|
| 103 | + $gperm_handler = & xoops_gethandler('groupperm'); |
|
| 104 | 104 | |
| 105 | 105 | //Get user's groups |
| 106 | 106 | $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS); |
| 107 | 107 | |
| 108 | 108 | //Get all allowed item ids in this module and for this user's groups |
| 109 | - $userpermissions =& $gperm_handler->getItemIds($gperm_name, $groups, $smartModule->getVar('mid')); |
|
| 109 | + $userpermissions = & $gperm_handler->getItemIds($gperm_name, $groups, $smartModule->getVar('mid')); |
|
| 110 | 110 | $permissions[$gperm_name] = $userpermissions; |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | function saveItem_Permissions($groups, $itemid, $perm_name) |
| 135 | 135 | { |
| 136 | - $smartModule =& $this->handler->getModuleInfo(); |
|
| 136 | + $smartModule = & $this->handler->getModuleInfo(); |
|
| 137 | 137 | |
| 138 | 138 | $result = true; |
| 139 | 139 | $module_id = $smartModule->getVar('mid'); |
| 140 | - $gperm_handler =& xoops_gethandler('groupperm'); |
|
| 140 | + $gperm_handler = & xoops_gethandler('groupperm'); |
|
| 141 | 141 | |
| 142 | 142 | // First, if the permissions are already there, delete them |
| 143 | 143 | $gperm_handler->deleteByModule($module_id, $perm_name, $itemid); |
@@ -165,11 +165,11 @@ discard block |
||
| 165 | 165 | { |
| 166 | 166 | global $xoopsModule; |
| 167 | 167 | |
| 168 | - $smartModule =& smartsection_getModuleInfo(); |
|
| 168 | + $smartModule = & smartsection_getModuleInfo(); |
|
| 169 | 169 | |
| 170 | 170 | $result = true; |
| 171 | - $module_id = $smartModule->getVar('mid') ; |
|
| 172 | - $gperm_handler =& xoops_gethandler('groupperm'); |
|
| 171 | + $module_id = $smartModule->getVar('mid'); |
|
| 172 | + $gperm_handler = & xoops_gethandler('groupperm'); |
|
| 173 | 173 | |
| 174 | 174 | |
| 175 | 175 | $gperm_handler->deleteByModule($module_id, $gperm_name, $itemid); |
@@ -188,11 +188,11 @@ discard block |
||
| 188 | 188 | global $xoopsUser; |
| 189 | 189 | |
| 190 | 190 | $gperm_groupid = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS); |
| 191 | - $smartModule =& $this->handler->getModuleInfo(); |
|
| 192 | - $gperm_modid = $smartModule->getVar('mid') ; |
|
| 191 | + $smartModule = & $this->handler->getModuleInfo(); |
|
| 192 | + $gperm_modid = $smartModule->getVar('mid'); |
|
| 193 | 193 | |
| 194 | 194 | //Get group permissions handler |
| 195 | - $gperm_handler =& xoops_gethandler('groupperm'); |
|
| 195 | + $gperm_handler = & xoops_gethandler('groupperm'); |
|
| 196 | 196 | |
| 197 | 197 | return $gperm_handler->checkRight($gperm_name, $gperm_itemid, $gperm_groupid, $gperm_modid); |
| 198 | 198 | } |