@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * constructor |
| 42 | 42 | * @return void |
| 43 | 43 | */ |
| 44 | - function __construct($host, $port, $scheme='') |
|
| 44 | + function __construct($host, $port, $scheme = '') |
|
| 45 | 45 | { |
| 46 | 46 | $this->m_host = $host; |
| 47 | 47 | $this->m_port = $port; |
@@ -76,11 +76,11 @@ discard block |
||
| 76 | 76 | $this->addToHeader('Connection', 'close'); |
| 77 | 77 | |
| 78 | 78 | $method = strtoupper($method); |
| 79 | - if(!$allow_methods) |
|
| 79 | + if (!$allow_methods) |
|
| 80 | 80 | { |
| 81 | 81 | $allow_methods = explode(' ', 'GET POST PUT'); |
| 82 | 82 | } |
| 83 | - if(!in_array($method, $allow_methods)) |
|
| 83 | + if (!in_array($method, $allow_methods)) |
|
| 84 | 84 | { |
| 85 | 85 | $method = $allow_methods[0]; |
| 86 | 86 | } |
@@ -89,12 +89,12 @@ discard block |
||
| 89 | 89 | $timout = max((int) $timeout, 0); |
| 90 | 90 | |
| 91 | 91 | // list of post variables |
| 92 | - if(!is_array($post_vars)) |
|
| 92 | + if (!is_array($post_vars)) |
|
| 93 | 93 | { |
| 94 | 94 | $post_vars = array(); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - if(FALSE && is_callable('curl_init')) |
|
| 97 | + if (FALSE && is_callable('curl_init')) |
|
| 98 | 98 | { |
| 99 | 99 | return $this->sendWithCurl($target, $method, $timeout, $post_vars); |
| 100 | 100 | } |
@@ -117,30 +117,30 @@ discard block |
||
| 117 | 117 | static $crlf = "\r\n"; |
| 118 | 118 | |
| 119 | 119 | $scheme = ''; |
| 120 | - if($this->m_scheme=='https') |
|
| 120 | + if ($this->m_scheme == 'https') |
|
| 121 | 121 | { |
| 122 | 122 | $scheme = 'ssl://'; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - $sock = @fsockopen($scheme . $this->m_host, $this->m_port, $errno, $errstr, $timeout); |
|
| 126 | - if(!$sock) |
|
| 125 | + $sock = @fsockopen($scheme.$this->m_host, $this->m_port, $errno, $errstr, $timeout); |
|
| 126 | + if (!$sock) |
|
| 127 | 127 | { |
| 128 | 128 | return new BaseObject(-1, 'socket_connect_failed'); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | $headers = $this->m_headers + array(); |
| 132 | - if(!isset($headers['Accept-Encoding'])) |
|
| 132 | + if (!isset($headers['Accept-Encoding'])) |
|
| 133 | 133 | { |
| 134 | 134 | $headers['Accept-Encoding'] = 'identity'; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // post body |
| 138 | 138 | $post_body = ''; |
| 139 | - if($method == 'POST' && count($post_vars)) |
|
| 139 | + if ($method == 'POST' && count($post_vars)) |
|
| 140 | 140 | { |
| 141 | - foreach($post_vars as $key => $value) |
|
| 141 | + foreach ($post_vars as $key => $value) |
|
| 142 | 142 | { |
| 143 | - $post_body .= urlencode($key) . '=' . urlencode($value) . '&'; |
|
| 143 | + $post_body .= urlencode($key).'='.urlencode($value).'&'; |
|
| 144 | 144 | } |
| 145 | 145 | $post_body = substr($post_body, 0, -1); |
| 146 | 146 | |
@@ -149,35 +149,35 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | $request = "$method $target HTTP/1.1$crlf"; |
| 152 | - foreach($headers as $equiv => $content) |
|
| 152 | + foreach ($headers as $equiv => $content) |
|
| 153 | 153 | { |
| 154 | 154 | $request .= "$equiv: $content$crlf"; |
| 155 | 155 | } |
| 156 | - $request .= $crlf . $post_body; |
|
| 156 | + $request .= $crlf.$post_body; |
|
| 157 | 157 | fwrite($sock, $request); |
| 158 | 158 | |
| 159 | 159 | list($httpver, $code, $status) = preg_split('/ +/', rtrim(fgets($sock)), 3); |
| 160 | 160 | |
| 161 | 161 | // read response headers |
| 162 | 162 | $is_chunked = FALSE; |
| 163 | - while(strlen(trim($line = fgets($sock)))) |
|
| 163 | + while (strlen(trim($line = fgets($sock)))) |
|
| 164 | 164 | { |
| 165 | 165 | list($equiv, $content) = preg_split('/ *: */', rtrim($line), 2); |
| 166 | - if(!strcasecmp($equiv, 'Transfer-Encoding') && $content == 'chunked') |
|
| 166 | + if (!strcasecmp($equiv, 'Transfer-Encoding') && $content == 'chunked') |
|
| 167 | 167 | { |
| 168 | 168 | $is_chunked = TRUE; |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | $body = ''; |
| 173 | - while(!feof($sock)) |
|
| 173 | + while (!feof($sock)) |
|
| 174 | 174 | { |
| 175 | - if($is_chunked) |
|
| 175 | + if ($is_chunked) |
|
| 176 | 176 | { |
| 177 | 177 | $chunk_size = hexdec(fgets($sock)); |
| 178 | - if($chunk_size) |
|
| 178 | + if ($chunk_size) |
|
| 179 | 179 | { |
| 180 | - $body .= fgets($sock, $chunk_size+1); |
|
| 180 | + $body .= fgets($sock, $chunk_size + 1); |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | else |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); |
| 220 | 220 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); |
| 221 | 221 | |
| 222 | - switch($method) |
|
| 222 | + switch ($method) |
|
| 223 | 223 | { |
| 224 | 224 | case 'GET': curl_setopt($ch, CURLOPT_HTTPGET, true); |
| 225 | 225 | break; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | $arr_headers = array(); |
| 235 | - foreach($headers as $key => $value) |
|
| 235 | + foreach ($headers as $key => $value) |
|
| 236 | 236 | { |
| 237 | 237 | $arr_headers[] = "$key: $value"; |
| 238 | 238 | } |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | curl_setopt($ch, CURLOPT_HTTPHEADER, $arr_headers); |
| 241 | 241 | |
| 242 | 242 | $body = curl_exec($ch); |
| 243 | - if(curl_errno($ch)) |
|
| 243 | + if (curl_errno($ch)) |
|
| 244 | 244 | { |
| 245 | 245 | return new BaseObject(-1, 'socket_connect_failed'); |
| 246 | 246 | } |
@@ -18,32 +18,32 @@ discard block |
||
| 18 | 18 | function proc($args) |
| 19 | 19 | { |
| 20 | 20 | // Targets to sort |
| 21 | - if(!in_array($args->order_target, array('list_order','update_order'))) $args->order_target = 'list_order'; |
|
| 21 | + if (!in_array($args->order_target, array('list_order', 'update_order'))) $args->order_target = 'list_order'; |
|
| 22 | 22 | // Sort order |
| 23 | - if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = 'asc'; |
|
| 23 | + if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
| 24 | 24 | // The number of displayed lists |
| 25 | - $args->list_count = (int)$args->list_count; |
|
| 26 | - if(!$args->list_count) $args->list_count = 5; |
|
| 25 | + $args->list_count = (int) $args->list_count; |
|
| 26 | + if (!$args->list_count) $args->list_count = 5; |
|
| 27 | 27 | // Cut the length of the title |
| 28 | - if(!$args->subject_cut_size) $args->subject_cut_size = 0; |
|
| 28 | + if (!$args->subject_cut_size) $args->subject_cut_size = 0; |
|
| 29 | 29 | // Cut the length of contents |
| 30 | - if(!$args->content_cut_size) $args->content_cut_size = 100; |
|
| 30 | + if (!$args->content_cut_size) $args->content_cut_size = 100; |
|
| 31 | 31 | // Viewing options |
| 32 | - $args->option_view_arr = explode(',',$args->option_view); |
|
| 32 | + $args->option_view_arr = explode(',', $args->option_view); |
|
| 33 | 33 | // markup options |
| 34 | - if(!$args->markup_type) $args->markup_type = 'list'; |
|
| 34 | + if (!$args->markup_type) $args->markup_type = 'list'; |
|
| 35 | 35 | // Set variables for internal use |
| 36 | 36 | $oModuleModel = getModel('module'); |
| 37 | 37 | $module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array(); |
| 38 | 38 | $site_module_info = Context::get('site_module_info'); |
| 39 | 39 | // List URLs if a type is RSS |
| 40 | - if($args->content_type == 'rss') |
|
| 40 | + if ($args->content_type == 'rss') |
|
| 41 | 41 | { |
| 42 | 42 | $args->rss_urls = array(); |
| 43 | - $rss_urls = array_unique(array($args->rss_url0,$args->rss_url1,$args->rss_url2,$args->rss_url3,$args->rss_url4)); |
|
| 44 | - for($i=0,$c=count($rss_urls);$i<$c;$i++) |
|
| 43 | + $rss_urls = array_unique(array($args->rss_url0, $args->rss_url1, $args->rss_url2, $args->rss_url3, $args->rss_url4)); |
|
| 44 | + for ($i = 0, $c = count($rss_urls); $i < $c; $i++) |
|
| 45 | 45 | { |
| 46 | - if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
| 46 | + if ($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
| 47 | 47 | } |
| 48 | 48 | // Get module information after listing module_srls if the module is not RSS |
| 49 | 49 | } |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | $obj = new stdClass(); |
| 53 | 53 | // Apply to all modules in the site if a target module is not specified |
| 54 | - if(!$args->module_srls) |
|
| 54 | + if (!$args->module_srls) |
|
| 55 | 55 | { |
| 56 | - $obj->site_srl = (int)$site_module_info->site_srl; |
|
| 56 | + $obj->site_srl = (int) $site_module_info->site_srl; |
|
| 57 | 57 | $output = executeQueryArray('widgets.content.getMids', $obj); |
| 58 | - if($output->data) |
|
| 58 | + if ($output->data) |
|
| 59 | 59 | { |
| 60 | - foreach($output->data as $key => $val) |
|
| 60 | + foreach ($output->data as $key => $val) |
|
| 61 | 61 | { |
| 62 | 62 | $args->modules_info[$val->mid] = $val; |
| 63 | 63 | $args->module_srls_info[$val->module_srl] = $val; |
@@ -73,35 +73,35 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $obj->module_srls = $args->module_srls; |
| 75 | 75 | $output = executeQueryArray('widgets.content.getMids', $obj); |
| 76 | - if($output->data) |
|
| 76 | + if ($output->data) |
|
| 77 | 77 | { |
| 78 | - foreach($output->data as $key => $val) |
|
| 78 | + foreach ($output->data as $key => $val) |
|
| 79 | 79 | { |
| 80 | 80 | $args->modules_info[$val->mid] = $val; |
| 81 | 81 | $args->module_srls_info[$val->module_srl] = $val; |
| 82 | 82 | $module_srls[] = $val->module_srl; |
| 83 | 83 | } |
| 84 | - $idx = explode(',',$args->module_srls); |
|
| 85 | - for($i=0,$c=count($idx);$i<$c;$i++) |
|
| 84 | + $idx = explode(',', $args->module_srls); |
|
| 85 | + for ($i = 0, $c = count($idx); $i < $c; $i++) |
|
| 86 | 86 | { |
| 87 | 87 | $srl = $idx[$i]; |
| 88 | - if(!$args->module_srls_info[$srl]) continue; |
|
| 88 | + if (!$args->module_srls_info[$srl]) continue; |
|
| 89 | 89 | $args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid; |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | // Exit if no module is found |
| 94 | - if(!count($args->modules_info)) return Context::get('msg_not_founded'); |
|
| 95 | - $args->module_srl = implode(',',$module_srls); |
|
| 94 | + if (!count($args->modules_info)) return Context::get('msg_not_founded'); |
|
| 95 | + $args->module_srl = implode(',', $module_srls); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * Method is separately made because content extraction, articles, comments, trackbacks, RSS and other elements exist |
| 100 | 100 | */ |
| 101 | 101 | // tab mode |
| 102 | - if($args->tab_type == 'none' || $args->tab_type == '') |
|
| 102 | + if ($args->tab_type == 'none' || $args->tab_type == '') |
|
| 103 | 103 | { |
| 104 | - switch($args->content_type) |
|
| 104 | + switch ($args->content_type) |
|
| 105 | 105 | { |
| 106 | 106 | case 'comment': |
| 107 | 107 | $content_items = $this->_getCommentItems($args); |
@@ -125,17 +125,17 @@ discard block |
||
| 125 | 125 | { |
| 126 | 126 | $content_items = array(); |
| 127 | 127 | |
| 128 | - switch($args->content_type) |
|
| 128 | + switch ($args->content_type) |
|
| 129 | 129 | { |
| 130 | 130 | case 'comment': |
| 131 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 131 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 132 | 132 | { |
| 133 | 133 | $args->module_srl = $module_srl; |
| 134 | 134 | $content_items[$module_srl] = $this->_getCommentItems($args); |
| 135 | 135 | } |
| 136 | 136 | break; |
| 137 | 137 | case 'image': |
| 138 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 138 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 139 | 139 | { |
| 140 | 140 | $args->module_srl = $module_srl; |
| 141 | 141 | $content_items[$module_srl] = $this->_getImageItems($args); |
@@ -145,13 +145,13 @@ discard block |
||
| 145 | 145 | $content_items = $this->getRssItems($args); |
| 146 | 146 | break; |
| 147 | 147 | case 'trackback': |
| 148 | - foreach($args->mid_lists as $module_srl => $mid){ |
|
| 148 | + foreach ($args->mid_lists as $module_srl => $mid) { |
|
| 149 | 149 | $args->module_srl = $module_srl; |
| 150 | 150 | $content_items[$module_srl] = $this->_getTrackbackItems($args); |
| 151 | 151 | } |
| 152 | 152 | break; |
| 153 | 153 | default: |
| 154 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 154 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 155 | 155 | { |
| 156 | 156 | $args->module_srl = $module_srl; |
| 157 | 157 | $content_items[$module_srl] = $this->_getDocumentItems($args); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $output = $this->_compile($args,$content_items); |
|
| 163 | + $output = $this->_compile($args, $content_items); |
|
| 164 | 164 | return $output; |
| 165 | 165 | } |
| 166 | 166 | |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | $content_items = array(); |
| 182 | 182 | |
| 183 | - if(!count($output)) return; |
|
| 183 | + if (!count($output)) return; |
|
| 184 | 184 | |
| 185 | - foreach($output as $key => $oComment) |
|
| 185 | + foreach ($output as $key => $oComment) |
|
| 186 | 186 | { |
| 187 | 187 | $attribute = $oComment->getObjectVars(); |
| 188 | 188 | $title = $oComment->getSummary($args->content_cut_size); |
| 189 | 189 | $thumbnail = $oComment->getThumbnail(); |
| 190 | - $url = sprintf("%s#comment_%s",getUrl('', 'mid', $args->mid_lists[$attribute->module_srl], 'document_srl',$oComment->get('document_srl')),$oComment->get('comment_srl')); |
|
| 190 | + $url = sprintf("%s#comment_%s", getUrl('', 'mid', $args->mid_lists[$attribute->module_srl], 'document_srl', $oComment->get('document_srl')), $oComment->get('comment_srl')); |
|
| 191 | 191 | |
| 192 | 192 | $attribute->mid = $args->mid_lists[$attribute->module_srl]; |
| 193 | 193 | $browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title; |
@@ -212,10 +212,10 @@ discard block |
||
| 212 | 212 | // Get categories |
| 213 | 213 | $obj = new stdClass(); |
| 214 | 214 | $obj->module_srl = $args->module_srl; |
| 215 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
| 216 | - if($output->toBool() && $output->data) |
|
| 215 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
| 216 | + if ($output->toBool() && $output->data) |
|
| 217 | 217 | { |
| 218 | - foreach($output->data as $key => $val) |
|
| 218 | + foreach ($output->data as $key => $val) |
|
| 219 | 219 | { |
| 220 | 220 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
| 221 | 221 | } |
@@ -223,17 +223,17 @@ discard block |
||
| 223 | 223 | // Get a list of documents |
| 224 | 224 | $obj->module_srl = $args->module_srl; |
| 225 | 225 | $obj->sort_index = $args->order_target; |
| 226 | - $obj->order_type = $args->order_type=="desc"?"asc":"desc"; |
|
| 226 | + $obj->order_type = $args->order_type == "desc" ? "asc" : "desc"; |
|
| 227 | 227 | $obj->list_count = $args->list_count; |
| 228 | 228 | $obj->statusList = array('PUBLIC'); |
| 229 | 229 | $output = executeQueryArray('widgets.content.getNewestDocuments', $obj); |
| 230 | - if(!$output->toBool() || !$output->data) return; |
|
| 230 | + if (!$output->toBool() || !$output->data) return; |
|
| 231 | 231 | // If the result exists, make each document as an object |
| 232 | 232 | $content_items = array(); |
| 233 | 233 | $first_thumbnail_idx = -1; |
| 234 | - if(count($output->data)) |
|
| 234 | + if (count($output->data)) |
|
| 235 | 235 | { |
| 236 | - foreach($output->data as $key => $attribute) |
|
| 236 | + foreach ($output->data as $key => $attribute) |
|
| 237 | 237 | { |
| 238 | 238 | $oDocument = new documentItem(); |
| 239 | 239 | $oDocument->setAttribute($attribute, false); |
@@ -242,23 +242,23 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | $oDocumentModel->setToAllDocumentExtraVars(); |
| 244 | 244 | |
| 245 | - for($i=0,$c=count($document_srls);$i<$c;$i++) |
|
| 245 | + for ($i = 0, $c = count($document_srls); $i < $c; $i++) |
|
| 246 | 246 | { |
| 247 | 247 | $oDocument = $GLOBALS['XE_DOCUMENT_LIST'][$document_srls[$i]]; |
| 248 | 248 | $document_srl = $oDocument->document_srl; |
| 249 | 249 | $module_srl = $oDocument->get('module_srl'); |
| 250 | 250 | $category_srl = $oDocument->get('category_srl'); |
| 251 | 251 | $thumbnail = $oDocument->getThumbnail(); |
| 252 | - $content_item = new mcontentItem( $args->module_srls_info[$module_srl]->browser_title ); |
|
| 252 | + $content_item = new mcontentItem($args->module_srls_info[$module_srl]->browser_title); |
|
| 253 | 253 | $content_item->adds($oDocument->getObjectVars()); |
| 254 | 254 | $content_item->setTitle($oDocument->getTitleText()); |
| 255 | - $content_item->setCategory( $category_lists[$module_srl][$category_srl]->title ); |
|
| 256 | - $content_item->setDomain( $args->module_srls_info[$module_srl]->domain ); |
|
| 255 | + $content_item->setCategory($category_lists[$module_srl][$category_srl]->title); |
|
| 256 | + $content_item->setDomain($args->module_srls_info[$module_srl]->domain); |
|
| 257 | 257 | $content_item->setContent($oDocument->getSummary($args->content_cut_size)); |
| 258 | - $content_item->setLink( getSiteUrl($domain,'', 'mid',$args->mid_lists[$module_srl], 'document_srl',$document_srl) ); |
|
| 258 | + $content_item->setLink(getSiteUrl($domain, '', 'mid', $args->mid_lists[$module_srl], 'document_srl', $document_srl)); |
|
| 259 | 259 | $content_item->setThumbnail($thumbnail); |
| 260 | 260 | $content_item->add('mid', $args->mid_lists[$module_srl]); |
| 261 | - if($first_thumbnail_idx==-1 && $thumbnail) $first_thumbnail_idx = $i; |
|
| 261 | + if ($first_thumbnail_idx == -1 && $thumbnail) $first_thumbnail_idx = $i; |
|
| 262 | 262 | $content_items[] = $content_item; |
| 263 | 263 | } |
| 264 | 264 | |
@@ -276,10 +276,10 @@ discard block |
||
| 276 | 276 | $obj->direct_download = 'Y'; |
| 277 | 277 | $obj->isvalid = 'Y'; |
| 278 | 278 | // Get categories |
| 279 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
| 280 | - if($output->toBool() && $output->data) |
|
| 279 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
| 280 | + if ($output->toBool() && $output->data) |
|
| 281 | 281 | { |
| 282 | - foreach($output->data as $key => $val) |
|
| 282 | + foreach ($output->data as $key => $val) |
|
| 283 | 283 | { |
| 284 | 284 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
| 285 | 285 | } |
@@ -288,24 +288,24 @@ discard block |
||
| 288 | 288 | $obj->list_count = $args->list_count; |
| 289 | 289 | $files_output = executeQueryArray("file.getOneFileInDocument", $obj); |
| 290 | 290 | $files_count = count($files_output->data); |
| 291 | - if(!$files_count) return; |
|
| 291 | + if (!$files_count) return; |
|
| 292 | 292 | |
| 293 | 293 | $content_items = array(); |
| 294 | 294 | |
| 295 | - for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
| 295 | + for ($i = 0; $i < $files_count; $i++) $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
| 296 | 296 | |
| 297 | 297 | $tmp_document_list = $oDocumentModel->getDocuments($document_srl_list); |
| 298 | 298 | |
| 299 | - if(!count($tmp_document_list)) return; |
|
| 299 | + if (!count($tmp_document_list)) return; |
|
| 300 | 300 | |
| 301 | - foreach($tmp_document_list as $oDocument) |
|
| 301 | + foreach ($tmp_document_list as $oDocument) |
|
| 302 | 302 | { |
| 303 | 303 | $attribute = $oDocument->getObjectVars(); |
| 304 | 304 | $browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title; |
| 305 | 305 | $domain = $args->module_srls_info[$attribute->module_srl]->domain; |
| 306 | 306 | $category = $category_lists[$attribute->module_srl]->text; |
| 307 | 307 | $content = $oDocument->getSummary($args->content_cut_size); |
| 308 | - $url = sprintf("%s#%s",$oDocument->getPermanentUrl() ,$oDocument->getCommentCount()); |
|
| 308 | + $url = sprintf("%s#%s", $oDocument->getPermanentUrl(), $oDocument->getCommentCount()); |
|
| 309 | 309 | $thumbnail = $oDocument->getThumbnail(); |
| 310 | 310 | $content_item = new mcontentItem($browser_title); |
| 311 | 311 | $content_item->adds($attribute); |
@@ -327,11 +327,11 @@ discard block |
||
| 327 | 327 | $content_items = array(); |
| 328 | 328 | $args->mid_lists = array(); |
| 329 | 329 | |
| 330 | - foreach($args->rss_urls as $key => $rss) |
|
| 330 | + foreach ($args->rss_urls as $key => $rss) |
|
| 331 | 331 | { |
| 332 | 332 | $args->rss_url = $rss; |
| 333 | 333 | $content_item = $this->_getRssItems($args); |
| 334 | - if(count($content_item) > 0) |
|
| 334 | + if (count($content_item) > 0) |
|
| 335 | 335 | { |
| 336 | 336 | $browser_title = $content_item[0]->getBrowserTitle(); |
| 337 | 337 | $args->mid_lists[] = $browser_title; |
@@ -339,40 +339,40 @@ discard block |
||
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - if($args->tab_type == 'none' || $args->tab_type == '') |
|
| 342 | + if ($args->tab_type == 'none' || $args->tab_type == '') |
|
| 343 | 343 | { |
| 344 | 344 | $items = array(); |
| 345 | - foreach($content_items as $key => $val) |
|
| 345 | + foreach ($content_items as $key => $val) |
|
| 346 | 346 | { |
| 347 | - foreach($val as $k => $v) |
|
| 347 | + foreach ($val as $k => $v) |
|
| 348 | 348 | { |
| 349 | 349 | $date = $v->get('regdate'); |
| 350 | - $i=0; |
|
| 351 | - while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++; |
|
| 352 | - $items[sprintf('%s%02d',$date,$i)] = $v; |
|
| 350 | + $i = 0; |
|
| 351 | + while (array_key_exists(sprintf('%s%02d', $date, $i), $items)) $i++; |
|
| 352 | + $items[sprintf('%s%02d', $date, $i)] = $v; |
|
| 353 | 353 | } |
| 354 | 354 | } |
| 355 | - if($args->order_type =='asc') ksort($items); |
|
| 355 | + if ($args->order_type == 'asc') ksort($items); |
|
| 356 | 356 | else krsort($items); |
| 357 | - $content_items = array_slice(array_values($items),0,$args->list_count); |
|
| 357 | + $content_items = array_slice(array_values($items), 0, $args->list_count); |
|
| 358 | 358 | } return $content_items; |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | function _getRssBody($value) |
| 362 | 362 | { |
| 363 | - if(!$value || is_string($value)) return $value; |
|
| 364 | - if(is_object($value)) $value = get_object_vars($value); |
|
| 363 | + if (!$value || is_string($value)) return $value; |
|
| 364 | + if (is_object($value)) $value = get_object_vars($value); |
|
| 365 | 365 | $body = null; |
| 366 | - if(!count($value)) return; |
|
| 367 | - foreach($value as $key => $val) |
|
| 366 | + if (!count($value)) return; |
|
| 367 | + foreach ($value as $key => $val) |
|
| 368 | 368 | { |
| 369 | - if($key == 'body') |
|
| 369 | + if ($key == 'body') |
|
| 370 | 370 | { |
| 371 | 371 | $body = $val; |
| 372 | 372 | continue; |
| 373 | 373 | } |
| 374 | - if(is_object($val)||is_array($val)) $body = $this->_getRssBody($val); |
|
| 375 | - if($body !== null) return $body; |
|
| 374 | + if (is_object($val) || is_array($val)) $body = $this->_getRssBody($val); |
|
| 375 | + if ($body !== null) return $body; |
|
| 376 | 376 | } |
| 377 | 377 | return $body; |
| 378 | 378 | } |
@@ -383,17 +383,17 @@ discard block |
||
| 383 | 383 | // Replace tags such as </p> , </div> , </li> and others to a whitespace |
| 384 | 384 | $content = str_replace(array('</p>', '</div>', '</li>'), ' ', $content); |
| 385 | 385 | // Remove Tag |
| 386 | - $content = preg_replace('!<([^>]*?)>!is','', $content); |
|
| 386 | + $content = preg_replace('!<([^>]*?)>!is', '', $content); |
|
| 387 | 387 | // Replace tags to < , > , " |
| 388 | - $content = str_replace(array('<','>','"',' '), array('<','>','"',' '), $content); |
|
| 388 | + $content = str_replace(array('<', '>', '"', ' '), array('<', '>', '"', ' '), $content); |
|
| 389 | 389 | // Delete a series of whitespaces |
| 390 | 390 | $content = preg_replace('/ ( +)/is', ' ', $content); |
| 391 | 391 | // Truncate string |
| 392 | 392 | $content = trim(cut_str($content, $str_size, $tail)); |
| 393 | 393 | // Replace back < , > , " to theoriginal tags |
| 394 | - $content = str_replace(array('<','>','"'),array('<','>','"'), $content); |
|
| 394 | + $content = str_replace(array('<', '>', '"'), array('<', '>', '"'), $content); |
|
| 395 | 395 | // Fixed a newline bug on a set of consecutive English letters |
| 396 | - $content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is',"$0-",$content); |
|
| 396 | + $content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is', "$0-", $content); |
|
| 397 | 397 | return $content; |
| 398 | 398 | } |
| 399 | 399 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | */ |
| 405 | 405 | function requestFeedContents($rss_url) |
| 406 | 406 | { |
| 407 | - $rss_url = str_replace('&','&',Context::convertEncodingStr($rss_url)); |
|
| 407 | + $rss_url = str_replace('&', '&', Context::convertEncodingStr($rss_url)); |
|
| 408 | 408 | return FileHandler::getRemoteResource($rss_url, null, 3, 'GET', 'application/xml'); |
| 409 | 409 | } |
| 410 | 410 | |
@@ -416,52 +416,52 @@ discard block |
||
| 416 | 416 | $buff = $this->requestFeedContents($args->rss_url); |
| 417 | 417 | |
| 418 | 418 | $encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches); |
| 419 | - if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff); |
|
| 419 | + if ($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff); |
|
| 420 | 420 | |
| 421 | 421 | $buff = preg_replace("/<\?xml.*\?>/i", "", $buff); |
| 422 | 422 | |
| 423 | 423 | $oXmlParser = new XmlParser(); |
| 424 | 424 | $xml_doc = $oXmlParser->parse($buff); |
| 425 | 425 | $rss = new stdClass(); |
| 426 | - if($xml_doc->rss) |
|
| 426 | + if ($xml_doc->rss) |
|
| 427 | 427 | { |
| 428 | 428 | $rss->title = $xml_doc->rss->channel->title->body; |
| 429 | 429 | $rss->link = $xml_doc->rss->channel->link->body; |
| 430 | 430 | |
| 431 | 431 | $items = $xml_doc->rss->channel->item; |
| 432 | 432 | |
| 433 | - if(!$items) return; |
|
| 434 | - if($items && !is_array($items)) $items = array($items); |
|
| 433 | + if (!$items) return; |
|
| 434 | + if ($items && !is_array($items)) $items = array($items); |
|
| 435 | 435 | |
| 436 | 436 | $content_items = array(); |
| 437 | 437 | |
| 438 | 438 | foreach ($items as $key => $value) |
| 439 | 439 | { |
| 440 | - if($key >= $args->list_count) break; |
|
| 440 | + if ($key >= $args->list_count) break; |
|
| 441 | 441 | unset($item); |
| 442 | 442 | $item = new stdClass(); |
| 443 | 443 | |
| 444 | - foreach($value as $key2 => $value2) |
|
| 444 | + foreach ($value as $key2 => $value2) |
|
| 445 | 445 | { |
| 446 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 446 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
| 447 | 447 | $item->{$key2} = $this->_getRssBody($value2); |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | $content_item = new mcontentItem($rss->title); |
| 451 | 451 | $content_item->setContentsLink($rss->link); |
| 452 | 452 | $content_item->setTitle($item->title); |
| 453 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
| 453 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
| 454 | 454 | //$content_item->setCategory($item->category); |
| 455 | - $item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description); |
|
| 455 | + $item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description); |
|
| 456 | 456 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
| 457 | 457 | $content_item->setLink($item->link); |
| 458 | - $date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'}))); |
|
| 458 | + $date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'}))); |
|
| 459 | 459 | $content_item->setRegdate($date); |
| 460 | 460 | |
| 461 | 461 | $content_items[] = $content_item; |
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | - else if($xml_doc->{'rdf:rdf'}) |
|
| 464 | + else if ($xml_doc->{'rdf:rdf'}) |
|
| 465 | 465 | { |
| 466 | 466 | // rss1.0 supported (XE's XML is case-insensitive because XML parser converts all to small letters) Fixed by misol |
| 467 | 467 | $rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body; |
@@ -469,102 +469,102 @@ discard block |
||
| 469 | 469 | |
| 470 | 470 | $items = $xml_doc->{'rdf:rdf'}->item; |
| 471 | 471 | |
| 472 | - if(!$items) return; |
|
| 473 | - if($items && !is_array($items)) $items = array($items); |
|
| 472 | + if (!$items) return; |
|
| 473 | + if ($items && !is_array($items)) $items = array($items); |
|
| 474 | 474 | |
| 475 | 475 | $content_items = array(); |
| 476 | 476 | |
| 477 | 477 | foreach ($items as $key => $value) |
| 478 | 478 | { |
| 479 | - if($key >= $args->list_count) break; |
|
| 479 | + if ($key >= $args->list_count) break; |
|
| 480 | 480 | unset($item); |
| 481 | 481 | $item = new stdClass(); |
| 482 | 482 | |
| 483 | - foreach($value as $key2 => $value2) |
|
| 483 | + foreach ($value as $key2 => $value2) |
|
| 484 | 484 | { |
| 485 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 485 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
| 486 | 486 | $item->{$key2} = $this->_getRssBody($value2); |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | $content_item = new mcontentItem($rss->title); |
| 490 | 490 | $content_item->setContentsLink($rss->link); |
| 491 | 491 | $content_item->setTitle($item->title); |
| 492 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
| 492 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
| 493 | 493 | //$content_item->setCategory($item->category); |
| 494 | - $item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description); |
|
| 494 | + $item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description); |
|
| 495 | 495 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
| 496 | 496 | $content_item->setLink($item->link); |
| 497 | - $date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'}))); |
|
| 497 | + $date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'}))); |
|
| 498 | 498 | $content_item->setRegdate($date); |
| 499 | 499 | |
| 500 | 500 | $content_items[] = $content_item; |
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | - else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
| 503 | + else if ($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
| 504 | 504 | { |
| 505 | 505 | // Atom 1.0 spec supported by misol |
| 506 | 506 | $rss->title = $xml_doc->feed->title->body; |
| 507 | 507 | $links = $xml_doc->feed->link; |
| 508 | - if(is_array($links)) |
|
| 508 | + if (is_array($links)) |
|
| 509 | 509 | { |
| 510 | 510 | foreach ($links as $value) |
| 511 | 511 | { |
| 512 | - if($value->attrs->rel == 'alternate') |
|
| 512 | + if ($value->attrs->rel == 'alternate') |
|
| 513 | 513 | { |
| 514 | 514 | $rss->link = $value->attrs->href; |
| 515 | 515 | break; |
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | - else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href; |
|
| 519 | + else if ($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href; |
|
| 520 | 520 | |
| 521 | 521 | $items = $xml_doc->feed->entry; |
| 522 | 522 | |
| 523 | - if(!$items) return; |
|
| 524 | - if($items && !is_array($items)) $items = array($items); |
|
| 523 | + if (!$items) return; |
|
| 524 | + if ($items && !is_array($items)) $items = array($items); |
|
| 525 | 525 | |
| 526 | 526 | $content_items = array(); |
| 527 | 527 | |
| 528 | 528 | foreach ($items as $key => $value) |
| 529 | 529 | { |
| 530 | - if($key >= $args->list_count) break; |
|
| 530 | + if ($key >= $args->list_count) break; |
|
| 531 | 531 | unset($item); |
| 532 | 532 | |
| 533 | - foreach($value as $key2 => $value2) |
|
| 533 | + foreach ($value as $key2 => $value2) |
|
| 534 | 534 | { |
| 535 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 535 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
| 536 | 536 | $item->{$key2} = $this->_getRssBody($value2); |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | $content_item = new mcontentItem($rss->title); |
| 540 | 540 | $links = $value->link; |
| 541 | - if(is_array($links)) |
|
| 541 | + if (is_array($links)) |
|
| 542 | 542 | { |
| 543 | 543 | foreach ($links as $val) |
| 544 | 544 | { |
| 545 | - if($val->attrs->rel == 'alternate') |
|
| 545 | + if ($val->attrs->rel == 'alternate') |
|
| 546 | 546 | { |
| 547 | 547 | $item->link = $val->attrs->href; |
| 548 | 548 | break; |
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | } |
| 552 | - else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href; |
|
| 552 | + else if ($links->attrs->rel == 'alternate') $item->link = $links->attrs->href; |
|
| 553 | 553 | |
| 554 | 554 | $content_item->setContentsLink($rss->link); |
| 555 | - if($item->title) |
|
| 555 | + if ($item->title) |
|
| 556 | 556 | { |
| 557 | - if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body; |
|
| 557 | + if (stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body; |
|
| 558 | 558 | } |
| 559 | 559 | $content_item->setTitle($item->title); |
| 560 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
| 560 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
| 561 | 561 | $content_item->setAuthorSite($value->author->uri->body); |
| 562 | 562 | |
| 563 | 563 | //$content_item->setCategory($item->category); |
| 564 | 564 | $item->description = ($item->content) ? $item->content : $item->description = $item->summary; |
| 565 | - $item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description); |
|
| 565 | + $item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description); |
|
| 566 | 566 | |
| 567 | - if(($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE)) |
|
| 567 | + if (($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE)) |
|
| 568 | 568 | { |
| 569 | 569 | $item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 570 | 570 | |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | |
| 573 | 573 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
| 574 | 574 | $content_item->setLink($item->link); |
| 575 | - $date = date('YmdHis', strtotime(max($item->published,$item->updated,$item->{'dc:date'}))); |
|
| 575 | + $date = date('YmdHis', strtotime(max($item->published, $item->updated, $item->{'dc:date'}))); |
|
| 576 | 576 | $content_item->setRegdate($date); |
| 577 | 577 | |
| 578 | 578 | $content_items[] = $content_item; |
@@ -581,12 +581,12 @@ discard block |
||
| 581 | 581 | return $content_items; |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | - function _getTrackbackItems($args){ |
|
| 584 | + function _getTrackbackItems($args) { |
|
| 585 | 585 | // Get categories |
| 586 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
| 587 | - if($output->toBool() && $output->data) |
|
| 586 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
| 587 | + if ($output->toBool() && $output->data) |
|
| 588 | 588 | { |
| 589 | - foreach($output->data as $key => $val) { |
|
| 589 | + foreach ($output->data as $key => $val) { |
|
| 590 | 590 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
| 591 | 591 | } |
| 592 | 592 | } |
@@ -598,14 +598,14 @@ discard block |
||
| 598 | 598 | $oTrackbackModel = getModel('trackback'); |
| 599 | 599 | $output = $oTrackbackModel->getNewestTrackbackList($obj); |
| 600 | 600 | // If an error occurs, just ignore it. |
| 601 | - if(!$output->toBool() || !$output->data) return; |
|
| 601 | + if (!$output->toBool() || !$output->data) return; |
|
| 602 | 602 | // If the result exists, make each document as an object |
| 603 | 603 | $content_items = array(); |
| 604 | - foreach($output->data as $key => $item) |
|
| 604 | + foreach ($output->data as $key => $item) |
|
| 605 | 605 | { |
| 606 | 606 | $domain = $args->module_srls_info[$item->module_srl]->domain; |
| 607 | 607 | $category = $category_lists[$item->module_srl]->text; |
| 608 | - $url = getSiteUrl($domain,'','mid', $args->mid_lists[$item->module_srl],'document_srl',$item->document_srl); |
|
| 608 | + $url = getSiteUrl($domain, '', 'mid', $args->mid_lists[$item->module_srl], 'document_srl', $item->document_srl); |
|
| 609 | 609 | $browser_title = $args->module_srls_info[$item->module_srl]->browser_title; |
| 610 | 610 | |
| 611 | 611 | $content_item = new mcontentItem($browser_title); |
@@ -613,8 +613,8 @@ discard block |
||
| 613 | 613 | $content_item->setTitle($item->title); |
| 614 | 614 | $content_item->setCategory($category); |
| 615 | 615 | $content_item->setNickName($item->blog_name); |
| 616 | - $content_item->setContent($item->excerpt); ///<< |
|
| 617 | - $content_item->setDomain($domain); ///<< |
|
| 616 | + $content_item->setContent($item->excerpt); ///<< |
|
| 617 | + $content_item->setDomain($domain); ///<< |
|
| 618 | 618 | $content_item->setLink($url); |
| 619 | 619 | $content_item->add('mid', $args->mid_lists[$item->module_srl]); |
| 620 | 620 | $content_item->setRegdate($item->regdate); |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | return $content_items; |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | - function _compile($args,$content_items) |
|
| 626 | + function _compile($args, $content_items) |
|
| 627 | 627 | { |
| 628 | 628 | $oTemplate = &TemplateHandler::getInstance(); |
| 629 | 629 | // Set variables for widget |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | var $contents_link = null; |
| 672 | 672 | var $domain = null; |
| 673 | 673 | |
| 674 | - function __construct($browser_title='') |
|
| 674 | + function __construct($browser_title = '') |
|
| 675 | 675 | { |
| 676 | 676 | $this->browser_title = $browser_title; |
| 677 | 677 | } |
@@ -681,58 +681,58 @@ discard block |
||
| 681 | 681 | } |
| 682 | 682 | function setFirstThumbnailIdx($first_thumbnail_idx) |
| 683 | 683 | { |
| 684 | - if(is_null($this->first_thumbnail) && $first_thumbnail_idx>-1) { |
|
| 684 | + if (is_null($this->first_thumbnail) && $first_thumbnail_idx > -1) { |
|
| 685 | 685 | $this->has_first_thumbnail_idx = true; |
| 686 | - $this->first_thumbnail_idx= $first_thumbnail_idx; |
|
| 686 | + $this->first_thumbnail_idx = $first_thumbnail_idx; |
|
| 687 | 687 | } |
| 688 | 688 | } |
| 689 | 689 | function setExtraImages($extra_images) |
| 690 | 690 | { |
| 691 | - $this->add('extra_images',$extra_images); |
|
| 691 | + $this->add('extra_images', $extra_images); |
|
| 692 | 692 | } |
| 693 | 693 | function setDomain($domain) |
| 694 | 694 | { |
| 695 | 695 | static $default_domain = null; |
| 696 | - if(!$domain) |
|
| 696 | + if (!$domain) |
|
| 697 | 697 | { |
| 698 | - if(is_null($default_domain)) $default_domain = Context::getDefaultUrl(); |
|
| 698 | + if (is_null($default_domain)) $default_domain = Context::getDefaultUrl(); |
|
| 699 | 699 | $domain = $default_domain; |
| 700 | 700 | } |
| 701 | 701 | $this->domain = $domain; |
| 702 | 702 | } |
| 703 | 703 | function setLink($url) |
| 704 | 704 | { |
| 705 | - $this->add('url',$url); |
|
| 705 | + $this->add('url', $url); |
|
| 706 | 706 | } |
| 707 | 707 | function setTitle($title) |
| 708 | 708 | { |
| 709 | - $this->add('title',$title); |
|
| 709 | + $this->add('title', $title); |
|
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | function setThumbnail($thumbnail) |
| 713 | 713 | { |
| 714 | - $this->add('thumbnail',$thumbnail); |
|
| 714 | + $this->add('thumbnail', $thumbnail); |
|
| 715 | 715 | } |
| 716 | 716 | function setContent($content) |
| 717 | 717 | { |
| 718 | - $this->add('content',$content); |
|
| 718 | + $this->add('content', $content); |
|
| 719 | 719 | } |
| 720 | 720 | function setRegdate($regdate) |
| 721 | 721 | { |
| 722 | - $this->add('regdate',$regdate); |
|
| 722 | + $this->add('regdate', $regdate); |
|
| 723 | 723 | } |
| 724 | 724 | function setNickName($nick_name) |
| 725 | 725 | { |
| 726 | - $this->add('nick_name',$nick_name); |
|
| 726 | + $this->add('nick_name', $nick_name); |
|
| 727 | 727 | } |
| 728 | 728 | // Save author's homepage url by misol |
| 729 | 729 | function setAuthorSite($site_url) |
| 730 | 730 | { |
| 731 | - $this->add('author_site',$site_url); |
|
| 731 | + $this->add('author_site', $site_url); |
|
| 732 | 732 | } |
| 733 | 733 | function setCategory($category) |
| 734 | 734 | { |
| 735 | - $this->add('category',$category); |
|
| 735 | + $this->add('category', $category); |
|
| 736 | 736 | } |
| 737 | 737 | function getBrowserTitle() |
| 738 | 738 | { |
@@ -760,17 +760,17 @@ discard block |
||
| 760 | 760 | { |
| 761 | 761 | return $this->get('module_srl'); |
| 762 | 762 | } |
| 763 | - function getTitle($cut_size = 0, $tail='...') |
|
| 763 | + function getTitle($cut_size = 0, $tail = '...') |
|
| 764 | 764 | { |
| 765 | 765 | $title = strip_tags($this->get('title')); |
| 766 | 766 | |
| 767 | - if($cut_size) $title = cut_str($title, $cut_size, $tail); |
|
| 767 | + if ($cut_size) $title = cut_str($title, $cut_size, $tail); |
|
| 768 | 768 | |
| 769 | 769 | $attrs = array(); |
| 770 | - if($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold'; |
|
| 771 | - if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color'); |
|
| 770 | + if ($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold'; |
|
| 771 | + if ($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color'); |
|
| 772 | 772 | |
| 773 | - if(count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), htmlspecialchars($title)); |
|
| 773 | + if (count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), htmlspecialchars($title)); |
|
| 774 | 774 | |
| 775 | 775 | return $title; |
| 776 | 776 | } |
@@ -793,12 +793,12 @@ discard block |
||
| 793 | 793 | function getCommentCount() |
| 794 | 794 | { |
| 795 | 795 | $comment_count = $this->get('comment_count'); |
| 796 | - return $comment_count>0 ? $comment_count : ''; |
|
| 796 | + return $comment_count > 0 ? $comment_count : ''; |
|
| 797 | 797 | } |
| 798 | 798 | function getTrackbackCount() |
| 799 | 799 | { |
| 800 | 800 | $trackback_count = $this->get('trackback_count'); |
| 801 | - return $trackback_count>0 ? $trackback_count : ''; |
|
| 801 | + return $trackback_count > 0 ? $trackback_count : ''; |
|
| 802 | 802 | } |
| 803 | 803 | function getRegdate($format = 'Y.m.d H:i:s') |
| 804 | 804 | { |
@@ -18,48 +18,48 @@ discard block |
||
| 18 | 18 | function proc($args) |
| 19 | 19 | { |
| 20 | 20 | // Targets to sort |
| 21 | - if(!in_array($args->order_target, array('regdate','update_order'))) $args->order_target = 'regdate'; |
|
| 21 | + if (!in_array($args->order_target, array('regdate', 'update_order'))) $args->order_target = 'regdate'; |
|
| 22 | 22 | // Sort order |
| 23 | - if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = 'asc'; |
|
| 23 | + if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
| 24 | 24 | // Pages |
| 25 | - $args->page_count = (int)$args->page_count; |
|
| 26 | - if(!$args->page_count) $args->page_count = 1; |
|
| 25 | + $args->page_count = (int) $args->page_count; |
|
| 26 | + if (!$args->page_count) $args->page_count = 1; |
|
| 27 | 27 | // The number of displayed lists |
| 28 | - $args->list_count = (int)$args->list_count; |
|
| 29 | - if(!$args->list_count) $args->list_count = 5; |
|
| 28 | + $args->list_count = (int) $args->list_count; |
|
| 29 | + if (!$args->list_count) $args->list_count = 5; |
|
| 30 | 30 | // The number of thumbnail columns |
| 31 | - $args->cols_list_count = (int)$args->cols_list_count; |
|
| 32 | - if(!$args->cols_list_count) $args->cols_list_count = 5; |
|
| 31 | + $args->cols_list_count = (int) $args->cols_list_count; |
|
| 32 | + if (!$args->cols_list_count) $args->cols_list_count = 5; |
|
| 33 | 33 | // Cut the length of the title |
| 34 | - if(!$args->subject_cut_size) $args->subject_cut_size = 0; |
|
| 34 | + if (!$args->subject_cut_size) $args->subject_cut_size = 0; |
|
| 35 | 35 | // Cut the length of contents |
| 36 | - if(!$args->content_cut_size) $args->content_cut_size = 100; |
|
| 36 | + if (!$args->content_cut_size) $args->content_cut_size = 100; |
|
| 37 | 37 | // Cut the length of nickname |
| 38 | - if(!$args->nickname_cut_size) $args->nickname_cut_size = 0; |
|
| 38 | + if (!$args->nickname_cut_size) $args->nickname_cut_size = 0; |
|
| 39 | 39 | // Display time of the latest post |
| 40 | - if(!$args->duration_new) $args->duration_new = 12; |
|
| 40 | + if (!$args->duration_new) $args->duration_new = 12; |
|
| 41 | 41 | // How to create thumbnails |
| 42 | - if(!$args->thumbnail_type) $args->thumbnail_type = 'crop'; |
|
| 42 | + if (!$args->thumbnail_type) $args->thumbnail_type = 'crop'; |
|
| 43 | 43 | // Horizontal size of thumbnails |
| 44 | - if(!$args->thumbnail_width) $args->thumbnail_width = 100; |
|
| 44 | + if (!$args->thumbnail_width) $args->thumbnail_width = 100; |
|
| 45 | 45 | // Vertical size of thumbnails |
| 46 | - if(!$args->thumbnail_height) $args->thumbnail_height = 75; |
|
| 46 | + if (!$args->thumbnail_height) $args->thumbnail_height = 75; |
|
| 47 | 47 | // Viewing options |
| 48 | - $args->option_view_arr = explode(',',$args->option_view); |
|
| 48 | + $args->option_view_arr = explode(',', $args->option_view); |
|
| 49 | 49 | // markup options |
| 50 | - if(!$args->markup_type) $args->markup_type = 'table'; |
|
| 50 | + if (!$args->markup_type) $args->markup_type = 'table'; |
|
| 51 | 51 | // Set variables used internally |
| 52 | 52 | $oModuleModel = getModel('module'); |
| 53 | 53 | $module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array(); |
| 54 | 54 | $site_module_info = Context::get('site_module_info'); |
| 55 | 55 | // List URLs if a type is RSS |
| 56 | - if($args->content_type == 'rss') |
|
| 56 | + if ($args->content_type == 'rss') |
|
| 57 | 57 | { |
| 58 | 58 | $args->rss_urls = array(); |
| 59 | - $rss_urls = array_unique(array($args->rss_url0,$args->rss_url1,$args->rss_url2,$args->rss_url3,$args->rss_url4)); |
|
| 60 | - for($i=0,$c=count($rss_urls);$i<$c;$i++) |
|
| 59 | + $rss_urls = array_unique(array($args->rss_url0, $args->rss_url1, $args->rss_url2, $args->rss_url3, $args->rss_url4)); |
|
| 60 | + for ($i = 0, $c = count($rss_urls); $i < $c; $i++) |
|
| 61 | 61 | { |
| 62 | - if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
| 62 | + if ($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
| 63 | 63 | } |
| 64 | 64 | // Get module information after listing module_srls if the module is not RSS |
| 65 | 65 | } |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | { |
| 68 | 68 | $obj = new stdClass(); |
| 69 | 69 | // Apply to all modules in the site if a target module is not specified |
| 70 | - if(!$args->module_srls) |
|
| 70 | + if (!$args->module_srls) |
|
| 71 | 71 | { |
| 72 | - $obj->site_srl = (int)$site_module_info->site_srl; |
|
| 72 | + $obj->site_srl = (int) $site_module_info->site_srl; |
|
| 73 | 73 | $output = executeQueryArray('widgets.content.getMids', $obj); |
| 74 | - if($output->data) |
|
| 74 | + if ($output->data) |
|
| 75 | 75 | { |
| 76 | - foreach($output->data as $key => $val) |
|
| 76 | + foreach ($output->data as $key => $val) |
|
| 77 | 77 | { |
| 78 | 78 | $args->modules_info[$val->mid] = $val; |
| 79 | 79 | $args->module_srls_info[$val->module_srl] = $val; |
@@ -89,35 +89,35 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $obj->module_srls = $args->module_srls; |
| 91 | 91 | $output = executeQueryArray('widgets.content.getMids', $obj); |
| 92 | - if($output->data) |
|
| 92 | + if ($output->data) |
|
| 93 | 93 | { |
| 94 | - foreach($output->data as $key => $val) |
|
| 94 | + foreach ($output->data as $key => $val) |
|
| 95 | 95 | { |
| 96 | 96 | $args->modules_info[$val->mid] = $val; |
| 97 | 97 | $args->module_srls_info[$val->module_srl] = $val; |
| 98 | 98 | $module_srls[] = $val->module_srl; |
| 99 | 99 | } |
| 100 | - $idx = explode(',',$args->module_srls); |
|
| 101 | - for($i=0,$c=count($idx);$i<$c;$i++) |
|
| 100 | + $idx = explode(',', $args->module_srls); |
|
| 101 | + for ($i = 0, $c = count($idx); $i < $c; $i++) |
|
| 102 | 102 | { |
| 103 | 103 | $srl = $idx[$i]; |
| 104 | - if(!$args->module_srls_info[$srl]) continue; |
|
| 104 | + if (!$args->module_srls_info[$srl]) continue; |
|
| 105 | 105 | $args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid; |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | // Exit if no module is found |
| 110 | - if(!count($args->modules_info)) return Context::get('msg_not_founded'); |
|
| 111 | - $args->module_srl = implode(',',$module_srls); |
|
| 110 | + if (!count($args->modules_info)) return Context::get('msg_not_founded'); |
|
| 111 | + $args->module_srl = implode(',', $module_srls); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * Method is separately made because content extraction, articles, comments, trackbacks, RSS and other elements exist |
| 116 | 116 | */ |
| 117 | 117 | // tab type |
| 118 | - if($args->tab_type == 'none' || $args->tab_type == '') |
|
| 118 | + if ($args->tab_type == 'none' || $args->tab_type == '') |
|
| 119 | 119 | { |
| 120 | - switch($args->content_type) |
|
| 120 | + switch ($args->content_type) |
|
| 121 | 121 | { |
| 122 | 122 | case 'comment': |
| 123 | 123 | $content_items = $this->_getCommentItems($args); |
@@ -141,17 +141,17 @@ discard block |
||
| 141 | 141 | { |
| 142 | 142 | $content_items = array(); |
| 143 | 143 | |
| 144 | - switch($args->content_type) |
|
| 144 | + switch ($args->content_type) |
|
| 145 | 145 | { |
| 146 | 146 | case 'comment': |
| 147 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 147 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 148 | 148 | { |
| 149 | 149 | $args->module_srl = $module_srl; |
| 150 | 150 | $content_items[$module_srl] = $this->_getCommentItems($args); |
| 151 | 151 | } |
| 152 | 152 | break; |
| 153 | 153 | case 'image': |
| 154 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 154 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 155 | 155 | { |
| 156 | 156 | $args->module_srl = $module_srl; |
| 157 | 157 | $content_items[$module_srl] = $this->_getImageItems($args); |
@@ -161,14 +161,14 @@ discard block |
||
| 161 | 161 | $content_items = $this->getRssItems($args); |
| 162 | 162 | break; |
| 163 | 163 | case 'trackback': |
| 164 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 164 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 165 | 165 | { |
| 166 | 166 | $args->module_srl = $module_srl; |
| 167 | 167 | $content_items[$module_srl] = $this->_getTrackbackItems($args); |
| 168 | 168 | } |
| 169 | 169 | break; |
| 170 | 170 | default: |
| 171 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 171 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 172 | 172 | { |
| 173 | 173 | $args->module_srl = $module_srl; |
| 174 | 174 | $content_items[$module_srl] = $this->_getDocumentItems($args); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $output = $this->_compile($args,$content_items); |
|
| 180 | + $output = $this->_compile($args, $content_items); |
|
| 181 | 181 | return $output; |
| 182 | 182 | } |
| 183 | 183 | |
@@ -197,14 +197,14 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | $content_items = array(); |
| 199 | 199 | |
| 200 | - if(!count($output)) return; |
|
| 200 | + if (!count($output)) return; |
|
| 201 | 201 | |
| 202 | - foreach($output as $key => $oComment) |
|
| 202 | + foreach ($output as $key => $oComment) |
|
| 203 | 203 | { |
| 204 | 204 | $attribute = $oComment->getObjectVars(); |
| 205 | 205 | $title = $oComment->getSummary($args->content_cut_size); |
| 206 | - $thumbnail = $oComment->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type); |
|
| 207 | - $url = sprintf("%s#comment_%s",getUrl('','mid', $args->mid_lists[$attribute->module_srl], 'document_srl',$oComment->get('document_srl')),$oComment->get('comment_srl')); |
|
| 206 | + $thumbnail = $oComment->getThumbnail($args->thumbnail_width, $args->thumbnail_height, $args->thumbnail_type); |
|
| 207 | + $url = sprintf("%s#comment_%s", getUrl('', 'mid', $args->mid_lists[$attribute->module_srl], 'document_srl', $oComment->get('document_srl')), $oComment->get('comment_srl')); |
|
| 208 | 208 | |
| 209 | 209 | $attribute->mid = $args->mid_lists[$attribute->module_srl]; |
| 210 | 210 | $browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title; |
@@ -229,10 +229,10 @@ discard block |
||
| 229 | 229 | // Get categories |
| 230 | 230 | $obj = new stdClass(); |
| 231 | 231 | $obj->module_srl = $args->module_srl; |
| 232 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
| 233 | - if($output->toBool() && $output->data) |
|
| 232 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
| 233 | + if ($output->toBool() && $output->data) |
|
| 234 | 234 | { |
| 235 | - foreach($output->data as $key => $val) |
|
| 235 | + foreach ($output->data as $key => $val) |
|
| 236 | 236 | { |
| 237 | 237 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
| 238 | 238 | } |
@@ -241,24 +241,24 @@ discard block |
||
| 241 | 241 | $obj->module_srl = $args->module_srl; |
| 242 | 242 | $obj->category_srl = $args->category_srl; |
| 243 | 243 | $obj->sort_index = $args->order_target; |
| 244 | - if($args->order_target == 'list_order' || $args->order_target == 'update_order') |
|
| 244 | + if ($args->order_target == 'list_order' || $args->order_target == 'update_order') |
|
| 245 | 245 | { |
| 246 | - $obj->order_type = $args->order_type=="desc"?"asc":"desc"; |
|
| 246 | + $obj->order_type = $args->order_type == "desc" ? "asc" : "desc"; |
|
| 247 | 247 | } |
| 248 | 248 | else |
| 249 | 249 | { |
| 250 | - $obj->order_type = $args->order_type=="desc"?"desc":"asc"; |
|
| 250 | + $obj->order_type = $args->order_type == "desc" ? "desc" : "asc"; |
|
| 251 | 251 | } |
| 252 | 252 | $obj->list_count = $args->list_count * $args->page_count; |
| 253 | 253 | $obj->statusList = array('PUBLIC'); |
| 254 | 254 | $output = executeQueryArray('widgets.content.getNewestDocuments', $obj); |
| 255 | - if(!$output->toBool() || !$output->data) return; |
|
| 255 | + if (!$output->toBool() || !$output->data) return; |
|
| 256 | 256 | // If the result exists, make each document as an object |
| 257 | 257 | $content_items = array(); |
| 258 | 258 | $first_thumbnail_idx = -1; |
| 259 | - if(count($output->data)) |
|
| 259 | + if (count($output->data)) |
|
| 260 | 260 | { |
| 261 | - foreach($output->data as $key => $attribute) |
|
| 261 | + foreach ($output->data as $key => $attribute) |
|
| 262 | 262 | { |
| 263 | 263 | $oDocument = new documentItem(); |
| 264 | 264 | $oDocument->setAttribute($attribute, false); |
@@ -267,26 +267,26 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | $oDocumentModel->setToAllDocumentExtraVars(); |
| 269 | 269 | |
| 270 | - for($i=0,$c=count($document_srls);$i<$c;$i++) |
|
| 270 | + for ($i = 0, $c = count($document_srls); $i < $c; $i++) |
|
| 271 | 271 | { |
| 272 | 272 | $oDocument = $GLOBALS['XE_DOCUMENT_LIST'][$document_srls[$i]]; |
| 273 | 273 | $document_srl = $oDocument->document_srl; |
| 274 | 274 | $module_srl = $oDocument->get('module_srl'); |
| 275 | 275 | $category_srl = $oDocument->get('category_srl'); |
| 276 | - $thumbnail = $oDocument->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type); |
|
| 276 | + $thumbnail = $oDocument->getThumbnail($args->thumbnail_width, $args->thumbnail_height, $args->thumbnail_type); |
|
| 277 | 277 | |
| 278 | - $content_item = new contentItem( $args->module_srls_info[$module_srl]->browser_title ); |
|
| 278 | + $content_item = new contentItem($args->module_srls_info[$module_srl]->browser_title); |
|
| 279 | 279 | $content_item->adds($oDocument->getObjectVars()); |
| 280 | 280 | $content_item->add('original_content', $oDocument->get('content')); |
| 281 | 281 | $content_item->setTitle($oDocument->getTitleText()); |
| 282 | - $content_item->setCategory( $category_lists[$module_srl][$category_srl]->title ); |
|
| 283 | - $content_item->setDomain( $args->module_srls_info[$module_srl]->domain ); |
|
| 282 | + $content_item->setCategory($category_lists[$module_srl][$category_srl]->title); |
|
| 283 | + $content_item->setDomain($args->module_srls_info[$module_srl]->domain); |
|
| 284 | 284 | $content_item->setContent($oDocument->getSummary($args->content_cut_size)); |
| 285 | - $content_item->setLink( getSiteUrl($domain, '', 'mid', $args->mid_lists[$module_srl],'document_srl',$document_srl) ); |
|
| 285 | + $content_item->setLink(getSiteUrl($domain, '', 'mid', $args->mid_lists[$module_srl], 'document_srl', $document_srl)); |
|
| 286 | 286 | $content_item->setThumbnail($thumbnail); |
| 287 | 287 | $content_item->setExtraImages($oDocument->printExtraImages($args->duration_new * 60 * 60)); |
| 288 | 288 | $content_item->add('mid', $args->mid_lists[$module_srl]); |
| 289 | - if($first_thumbnail_idx==-1 && $thumbnail) $first_thumbnail_idx = $i; |
|
| 289 | + if ($first_thumbnail_idx == -1 && $thumbnail) $first_thumbnail_idx = $i; |
|
| 290 | 290 | $content_items[] = $content_item; |
| 291 | 291 | } |
| 292 | 292 | |
@@ -307,10 +307,10 @@ discard block |
||
| 307 | 307 | $obj->direct_download = 'Y'; |
| 308 | 308 | $obj->isvalid = 'Y'; |
| 309 | 309 | // Get categories |
| 310 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
| 311 | - if($output->toBool() && $output->data) |
|
| 310 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
| 311 | + if ($output->toBool() && $output->data) |
|
| 312 | 312 | { |
| 313 | - foreach($output->data as $key => $val) |
|
| 313 | + foreach ($output->data as $key => $val) |
|
| 314 | 314 | { |
| 315 | 315 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
| 316 | 316 | } |
@@ -319,25 +319,25 @@ discard block |
||
| 319 | 319 | $obj->list_count = $args->list_count * $args->page_count; |
| 320 | 320 | $files_output = executeQueryArray("file.getOneFileInDocument", $obj); |
| 321 | 321 | $files_count = count($files_output->data); |
| 322 | - if(!$files_count) return; |
|
| 322 | + if (!$files_count) return; |
|
| 323 | 323 | |
| 324 | 324 | $content_items = array(); |
| 325 | 325 | |
| 326 | - for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
| 326 | + for ($i = 0; $i < $files_count; $i++) $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
| 327 | 327 | |
| 328 | 328 | $tmp_document_list = $oDocumentModel->getDocuments($document_srl_list); |
| 329 | 329 | |
| 330 | - if(!count($tmp_document_list)) return; |
|
| 330 | + if (!count($tmp_document_list)) return; |
|
| 331 | 331 | |
| 332 | - foreach($tmp_document_list as $oDocument) |
|
| 332 | + foreach ($tmp_document_list as $oDocument) |
|
| 333 | 333 | { |
| 334 | 334 | $attribute = $oDocument->getObjectVars(); |
| 335 | 335 | $browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title; |
| 336 | 336 | $domain = $args->module_srls_info[$attribute->module_srl]->domain; |
| 337 | 337 | $category = $category_lists[$attribute->module_srl]->text; |
| 338 | 338 | $content = $oDocument->getSummary($args->content_cut_size); |
| 339 | - $url = sprintf("%s#%s",$oDocument->getPermanentUrl() ,$oDocument->getCommentCount()); |
|
| 340 | - $thumbnail = $oDocument->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type); |
|
| 339 | + $url = sprintf("%s#%s", $oDocument->getPermanentUrl(), $oDocument->getCommentCount()); |
|
| 340 | + $thumbnail = $oDocument->getThumbnail($args->thumbnail_width, $args->thumbnail_height, $args->thumbnail_type); |
|
| 341 | 341 | $extra_images = $oDocument->printExtraImages($args->duration_new); |
| 342 | 342 | |
| 343 | 343 | $content_item = new contentItem($browser_title); |
@@ -360,11 +360,11 @@ discard block |
||
| 360 | 360 | $content_items = array(); |
| 361 | 361 | $args->mid_lists = array(); |
| 362 | 362 | |
| 363 | - foreach($args->rss_urls as $key => $rss) |
|
| 363 | + foreach ($args->rss_urls as $key => $rss) |
|
| 364 | 364 | { |
| 365 | 365 | $args->rss_url = $rss; |
| 366 | 366 | $content_item = $this->_getRssItems($args); |
| 367 | - if(count($content_item) > 0) |
|
| 367 | + if (count($content_item) > 0) |
|
| 368 | 368 | { |
| 369 | 369 | $browser_title = $content_item[0]->getBrowserTitle(); |
| 370 | 370 | $args->mid_lists[] = $browser_title; |
@@ -372,37 +372,37 @@ discard block |
||
| 372 | 372 | } |
| 373 | 373 | } |
| 374 | 374 | // If it is not a tab type |
| 375 | - if($args->tab_type == 'none' || $args->tab_type == '') |
|
| 375 | + if ($args->tab_type == 'none' || $args->tab_type == '') |
|
| 376 | 376 | { |
| 377 | 377 | $items = array(); |
| 378 | - foreach($content_items as $key => $val) |
|
| 378 | + foreach ($content_items as $key => $val) |
|
| 379 | 379 | { |
| 380 | - foreach($val as $k => $v) |
|
| 380 | + foreach ($val as $k => $v) |
|
| 381 | 381 | { |
| 382 | 382 | $date = $v->get('regdate'); |
| 383 | - $i=0; |
|
| 384 | - while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++; |
|
| 385 | - $items[sprintf('%s%02d',$date,$i)] = $v; |
|
| 383 | + $i = 0; |
|
| 384 | + while (array_key_exists(sprintf('%s%02d', $date, $i), $items)) $i++; |
|
| 385 | + $items[sprintf('%s%02d', $date, $i)] = $v; |
|
| 386 | 386 | } |
| 387 | 387 | } |
| 388 | - if($args->order_type =='asc') ksort($items); |
|
| 388 | + if ($args->order_type == 'asc') ksort($items); |
|
| 389 | 389 | else krsort($items); |
| 390 | - $content_items = array_slice(array_values($items),0,$args->list_count*$args->page_count); |
|
| 390 | + $content_items = array_slice(array_values($items), 0, $args->list_count * $args->page_count); |
|
| 391 | 391 | // Tab Type |
| 392 | 392 | } |
| 393 | 393 | else |
| 394 | 394 | { |
| 395 | - foreach($content_items as $key=> $content_item_list) |
|
| 395 | + foreach ($content_items as $key=> $content_item_list) |
|
| 396 | 396 | { |
| 397 | 397 | $items = array(); |
| 398 | - foreach($content_item_list as $k => $content_item) |
|
| 398 | + foreach ($content_item_list as $k => $content_item) |
|
| 399 | 399 | { |
| 400 | 400 | $date = $content_item->get('regdate'); |
| 401 | - $i=0; |
|
| 402 | - while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++; |
|
| 403 | - $items[sprintf('%s%02d',$date,$i)] = $content_item; |
|
| 401 | + $i = 0; |
|
| 402 | + while (array_key_exists(sprintf('%s%02d', $date, $i), $items)) $i++; |
|
| 403 | + $items[sprintf('%s%02d', $date, $i)] = $content_item; |
|
| 404 | 404 | } |
| 405 | - if($args->order_type =='asc') ksort($items); |
|
| 405 | + if ($args->order_type == 'asc') ksort($items); |
|
| 406 | 406 | else krsort($items); |
| 407 | 407 | |
| 408 | 408 | $content_items[$key] = array_values($items); |
@@ -413,19 +413,19 @@ discard block |
||
| 413 | 413 | |
| 414 | 414 | function _getRssBody($value) |
| 415 | 415 | { |
| 416 | - if(!$value || is_string($value)) return $value; |
|
| 417 | - if(is_object($value)) $value = get_object_vars($value); |
|
| 416 | + if (!$value || is_string($value)) return $value; |
|
| 417 | + if (is_object($value)) $value = get_object_vars($value); |
|
| 418 | 418 | $body = null; |
| 419 | - if(!count($value)) return; |
|
| 420 | - foreach($value as $key => $val) |
|
| 419 | + if (!count($value)) return; |
|
| 420 | + foreach ($value as $key => $val) |
|
| 421 | 421 | { |
| 422 | - if($key == 'body') |
|
| 422 | + if ($key == 'body') |
|
| 423 | 423 | { |
| 424 | 424 | $body = $val; |
| 425 | 425 | continue; |
| 426 | 426 | } |
| 427 | - if(is_object($val)||is_array($val)) $body = $this->_getRssBody($val); |
|
| 428 | - if($body !== null) return $body; |
|
| 427 | + if (is_object($val) || is_array($val)) $body = $this->_getRssBody($val); |
|
| 428 | + if ($body !== null) return $body; |
|
| 429 | 429 | } |
| 430 | 430 | return $body; |
| 431 | 431 | } |
@@ -436,17 +436,17 @@ discard block |
||
| 436 | 436 | // Replace tags such as </p> , </div> , </li> and others to a whitespace |
| 437 | 437 | $content = str_replace(array('</p>', '</div>', '</li>'), ' ', $content); |
| 438 | 438 | // Remove Tag |
| 439 | - $content = preg_replace('!<([^>]*?)>!is','', $content); |
|
| 439 | + $content = preg_replace('!<([^>]*?)>!is', '', $content); |
|
| 440 | 440 | // Replace tags to <, >, " and whitespace |
| 441 | - $content = str_replace(array('<','>','"',' '), array('<','>','"',' '), $content); |
|
| 441 | + $content = str_replace(array('<', '>', '"', ' '), array('<', '>', '"', ' '), $content); |
|
| 442 | 442 | // Delete a series of whitespaces |
| 443 | 443 | $content = preg_replace('/ ( +)/is', ' ', $content); |
| 444 | 444 | // Truncate string |
| 445 | 445 | $content = trim(cut_str($content, $str_size, $tail)); |
| 446 | 446 | // Replace back <, >, " to the original tags |
| 447 | - $content = str_replace(array('<','>','"'),array('<','>','"'), $content); |
|
| 447 | + $content = str_replace(array('<', '>', '"'), array('<', '>', '"'), $content); |
|
| 448 | 448 | // Fixed to a newline bug for consecutive sets of English letters |
| 449 | - $content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is',"$0-",$content); |
|
| 449 | + $content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is', "$0-", $content); |
|
| 450 | 450 | return $content; |
| 451 | 451 | } |
| 452 | 452 | |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | function requestFeedContents($rss_url) |
| 458 | 458 | { |
| 459 | - $rss_url = str_replace('&','&',Context::convertEncodingStr($rss_url)); |
|
| 459 | + $rss_url = str_replace('&', '&', Context::convertEncodingStr($rss_url)); |
|
| 460 | 460 | return FileHandler::getRemoteResource($rss_url, null, 3, 'GET', 'application/xml'); |
| 461 | 461 | } |
| 462 | 462 | |
@@ -468,51 +468,51 @@ discard block |
||
| 468 | 468 | $buff = $this->requestFeedContents($args->rss_url); |
| 469 | 469 | |
| 470 | 470 | $encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches); |
| 471 | - if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff); |
|
| 471 | + if ($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff); |
|
| 472 | 472 | |
| 473 | 473 | $buff = preg_replace("/<\?xml.*\?>/i", "", $buff); |
| 474 | 474 | |
| 475 | 475 | $oXmlParser = new XmlParser(); |
| 476 | 476 | $xml_doc = $oXmlParser->parse($buff); |
| 477 | - if($xml_doc->rss) |
|
| 477 | + if ($xml_doc->rss) |
|
| 478 | 478 | { |
| 479 | 479 | $rss->title = $xml_doc->rss->channel->title->body; |
| 480 | 480 | $rss->link = $xml_doc->rss->channel->link->body; |
| 481 | 481 | |
| 482 | 482 | $items = $xml_doc->rss->channel->item; |
| 483 | 483 | |
| 484 | - if(!$items) return; |
|
| 485 | - if($items && !is_array($items)) $items = array($items); |
|
| 484 | + if (!$items) return; |
|
| 485 | + if ($items && !is_array($items)) $items = array($items); |
|
| 486 | 486 | |
| 487 | 487 | $content_items = array(); |
| 488 | 488 | |
| 489 | 489 | foreach ($items as $key => $value) |
| 490 | 490 | { |
| 491 | - if($key >= $args->list_count * $args->page_count) break; |
|
| 491 | + if ($key >= $args->list_count * $args->page_count) break; |
|
| 492 | 492 | unset($item); |
| 493 | 493 | |
| 494 | - foreach($value as $key2 => $value2) |
|
| 494 | + foreach ($value as $key2 => $value2) |
|
| 495 | 495 | { |
| 496 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 496 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
| 497 | 497 | $item->{$key2} = $this->_getRssBody($value2); |
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | $content_item = new contentItem($rss->title); |
| 501 | 501 | $content_item->setContentsLink($rss->link); |
| 502 | 502 | $content_item->setTitle($item->title); |
| 503 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
| 503 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
| 504 | 504 | //$content_item->setCategory($item->category); |
| 505 | - $item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description); |
|
| 505 | + $item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description); |
|
| 506 | 506 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
| 507 | 507 | $content_item->setThumbnail($this->_getRssThumbnail($item->description)); |
| 508 | 508 | $content_item->setLink($item->link); |
| 509 | - $date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'}))); |
|
| 509 | + $date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'}))); |
|
| 510 | 510 | $content_item->setRegdate($date); |
| 511 | 511 | |
| 512 | 512 | $content_items[] = $content_item; |
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | - else if($xml_doc->{'rdf:rdf'}) |
|
| 515 | + else if ($xml_doc->{'rdf:rdf'}) |
|
| 516 | 516 | { |
| 517 | 517 | // rss1.0 supported (XE's XML is case-insensitive because XML parser converts all to small letters. Fixed by misol |
| 518 | 518 | $rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body; |
@@ -520,102 +520,102 @@ discard block |
||
| 520 | 520 | |
| 521 | 521 | $items = $xml_doc->{'rdf:rdf'}->item; |
| 522 | 522 | |
| 523 | - if(!$items) return; |
|
| 524 | - if($items && !is_array($items)) $items = array($items); |
|
| 523 | + if (!$items) return; |
|
| 524 | + if ($items && !is_array($items)) $items = array($items); |
|
| 525 | 525 | |
| 526 | 526 | $content_items = array(); |
| 527 | 527 | |
| 528 | 528 | foreach ($items as $key => $value) |
| 529 | 529 | { |
| 530 | - if($key >= $args->list_count * $args->page_count) break; |
|
| 530 | + if ($key >= $args->list_count * $args->page_count) break; |
|
| 531 | 531 | unset($item); |
| 532 | 532 | |
| 533 | - foreach($value as $key2 => $value2) |
|
| 533 | + foreach ($value as $key2 => $value2) |
|
| 534 | 534 | { |
| 535 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 535 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
| 536 | 536 | $item->{$key2} = $this->_getRssBody($value2); |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | $content_item = new contentItem($rss->title); |
| 540 | 540 | $content_item->setContentsLink($rss->link); |
| 541 | 541 | $content_item->setTitle($item->title); |
| 542 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
| 542 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
| 543 | 543 | //$content_item->setCategory($item->category); |
| 544 | - $item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description); |
|
| 544 | + $item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description); |
|
| 545 | 545 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
| 546 | 546 | $content_item->setThumbnail($this->_getRssThumbnail($item->description)); |
| 547 | 547 | $content_item->setLink($item->link); |
| 548 | - $date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'}))); |
|
| 548 | + $date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'}))); |
|
| 549 | 549 | $content_item->setRegdate($date); |
| 550 | 550 | |
| 551 | 551 | $content_items[] = $content_item; |
| 552 | 552 | } |
| 553 | 553 | } |
| 554 | - else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
| 554 | + else if ($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
| 555 | 555 | { |
| 556 | 556 | // Atom 1.0 spec supported by misol |
| 557 | 557 | $rss->title = $xml_doc->feed->title->body; |
| 558 | 558 | $links = $xml_doc->feed->link; |
| 559 | - if(is_array($links)) |
|
| 559 | + if (is_array($links)) |
|
| 560 | 560 | { |
| 561 | 561 | foreach ($links as $value) |
| 562 | 562 | { |
| 563 | - if($value->attrs->rel == 'alternate') |
|
| 563 | + if ($value->attrs->rel == 'alternate') |
|
| 564 | 564 | { |
| 565 | 565 | $rss->link = $value->attrs->href; |
| 566 | 566 | break; |
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | - else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href; |
|
| 570 | + else if ($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href; |
|
| 571 | 571 | |
| 572 | 572 | $items = $xml_doc->feed->entry; |
| 573 | 573 | |
| 574 | - if(!$items) return; |
|
| 575 | - if($items && !is_array($items)) $items = array($items); |
|
| 574 | + if (!$items) return; |
|
| 575 | + if ($items && !is_array($items)) $items = array($items); |
|
| 576 | 576 | |
| 577 | 577 | $content_items = array(); |
| 578 | 578 | |
| 579 | 579 | foreach ($items as $key => $value) |
| 580 | 580 | { |
| 581 | - if($key >= $args->list_count * $args->page_count) break; |
|
| 581 | + if ($key >= $args->list_count * $args->page_count) break; |
|
| 582 | 582 | unset($item); |
| 583 | 583 | |
| 584 | - foreach($value as $key2 => $value2) |
|
| 584 | + foreach ($value as $key2 => $value2) |
|
| 585 | 585 | { |
| 586 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 586 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
| 587 | 587 | $item->{$key2} = $this->_getRssBody($value2); |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | $content_item = new contentItem($rss->title); |
| 591 | 591 | $links = $value->link; |
| 592 | - if(is_array($links)) |
|
| 592 | + if (is_array($links)) |
|
| 593 | 593 | { |
| 594 | 594 | foreach ($links as $val) |
| 595 | 595 | { |
| 596 | - if($val->attrs->rel == 'alternate') |
|
| 596 | + if ($val->attrs->rel == 'alternate') |
|
| 597 | 597 | { |
| 598 | 598 | $item->link = $val->attrs->href; |
| 599 | 599 | break; |
| 600 | 600 | } |
| 601 | 601 | } |
| 602 | 602 | } |
| 603 | - else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href; |
|
| 603 | + else if ($links->attrs->rel == 'alternate') $item->link = $links->attrs->href; |
|
| 604 | 604 | |
| 605 | 605 | $content_item->setContentsLink($rss->link); |
| 606 | - if($item->title) |
|
| 606 | + if ($item->title) |
|
| 607 | 607 | { |
| 608 | - if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body; |
|
| 608 | + if (stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body; |
|
| 609 | 609 | } |
| 610 | 610 | $content_item->setTitle($item->title); |
| 611 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
| 611 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
| 612 | 612 | $content_item->setAuthorSite($value->author->uri->body); |
| 613 | 613 | |
| 614 | 614 | //$content_item->setCategory($item->category); |
| 615 | 615 | $item->description = ($item->content) ? $item->content : $item->description = $item->summary; |
| 616 | - $item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description); |
|
| 616 | + $item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description); |
|
| 617 | 617 | |
| 618 | - if(($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE)) |
|
| 618 | + if (($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE)) |
|
| 619 | 619 | { |
| 620 | 620 | $item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 621 | 621 | |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
| 625 | 625 | $content_item->setThumbnail($this->_getRssThumbnail($item->description)); |
| 626 | 626 | $content_item->setLink($item->link); |
| 627 | - $date = date('YmdHis', strtotime(max($item->published,$item->updated,$item->{'dc:date'}))); |
|
| 627 | + $date = date('YmdHis', strtotime(max($item->published, $item->updated, $item->{'dc:date'}))); |
|
| 628 | 628 | $content_item->setRegdate($date); |
| 629 | 629 | |
| 630 | 630 | $content_items[] = $content_item; |
@@ -637,15 +637,15 @@ discard block |
||
| 637 | 637 | { |
| 638 | 638 | @preg_match('@<img[^>]+src\s*=\s*(?:"(.+)"|\'(.+)\'|([^\s>(?:/>)]+))@', $content, $matches); |
| 639 | 639 | |
| 640 | - if($matches[1]) |
|
| 640 | + if ($matches[1]) |
|
| 641 | 641 | { |
| 642 | 642 | return $matches[1]; |
| 643 | 643 | } |
| 644 | - elseif($matches[2]) |
|
| 644 | + elseif ($matches[2]) |
|
| 645 | 645 | { |
| 646 | 646 | return $matches[2]; |
| 647 | 647 | } |
| 648 | - elseif($matches[3]) |
|
| 648 | + elseif ($matches[3]) |
|
| 649 | 649 | { |
| 650 | 650 | return $matches[3]; |
| 651 | 651 | } |
@@ -658,17 +658,17 @@ discard block |
||
| 658 | 658 | function _getTrackbackItems($args) |
| 659 | 659 | { |
| 660 | 660 | $oTrackbackModel = getModel('trackback'); |
| 661 | - if(!$oTrackbackModel) |
|
| 661 | + if (!$oTrackbackModel) |
|
| 662 | 662 | { |
| 663 | 663 | return; |
| 664 | 664 | } |
| 665 | 665 | |
| 666 | 666 | $obj = new stdClass; |
| 667 | 667 | // Get categories |
| 668 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
| 669 | - if($output->toBool() && $output->data) |
|
| 668 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
| 669 | + if ($output->toBool() && $output->data) |
|
| 670 | 670 | { |
| 671 | - foreach($output->data as $key => $val) |
|
| 671 | + foreach ($output->data as $key => $val) |
|
| 672 | 672 | { |
| 673 | 673 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
| 674 | 674 | } |
@@ -681,14 +681,14 @@ discard block |
||
| 681 | 681 | // Get model object from the trackback module and execute getTrackbackList() method |
| 682 | 682 | $output = $oTrackbackModel->getNewestTrackbackList($obj); |
| 683 | 683 | // If an error occurs, just ignore it. |
| 684 | - if(!$output->toBool() || !$output->data) return; |
|
| 684 | + if (!$output->toBool() || !$output->data) return; |
|
| 685 | 685 | // If the result exists, make each document as an object |
| 686 | 686 | $content_items = array(); |
| 687 | - foreach($output->data as $key => $item) |
|
| 687 | + foreach ($output->data as $key => $item) |
|
| 688 | 688 | { |
| 689 | 689 | $domain = $args->module_srls_info[$item->module_srl]->domain; |
| 690 | 690 | $category = $category_lists[$item->module_srl]->text; |
| 691 | - $url = getSiteUrl($domain,'','document_srl',$item->document_srl); |
|
| 691 | + $url = getSiteUrl($domain, '', 'document_srl', $item->document_srl); |
|
| 692 | 692 | $browser_title = $args->module_srls_info[$item->module_srl]->browser_title; |
| 693 | 693 | |
| 694 | 694 | $content_item = new contentItem($browser_title); |
@@ -696,8 +696,8 @@ discard block |
||
| 696 | 696 | $content_item->setTitle($item->title); |
| 697 | 697 | $content_item->setCategory($category); |
| 698 | 698 | $content_item->setNickName($item->blog_name); |
| 699 | - $content_item->setContent($item->excerpt); ///<< |
|
| 700 | - $content_item->setDomain($domain); ///<< |
|
| 699 | + $content_item->setContent($item->excerpt); ///<< |
|
| 700 | + $content_item->setDomain($domain); ///<< |
|
| 701 | 701 | $content_item->setLink($url); |
| 702 | 702 | $content_item->add('mid', $args->mid_lists[$item->module_srl]); |
| 703 | 703 | $content_item->setRegdate($item->regdate); |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | return $content_items; |
| 707 | 707 | } |
| 708 | 708 | |
| 709 | - function _compile($args,$content_items) |
|
| 709 | + function _compile($args, $content_items) |
|
| 710 | 710 | { |
| 711 | 711 | $oTemplate = &TemplateHandler::getInstance(); |
| 712 | 712 | // Set variables for widget |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | $widget_info->nickname_cut_size = $args->nickname_cut_size; |
| 721 | 721 | $widget_info->new_window = $args->new_window; |
| 722 | 722 | |
| 723 | - $widget_info->duration_new = $args->duration_new * 60*60; |
|
| 723 | + $widget_info->duration_new = $args->duration_new * 60 * 60; |
|
| 724 | 724 | $widget_info->thumbnail_type = $args->thumbnail_type; |
| 725 | 725 | $widget_info->thumbnail_width = $args->thumbnail_width; |
| 726 | 726 | $widget_info->thumbnail_height = $args->thumbnail_height; |
@@ -738,12 +738,12 @@ discard block |
||
| 738 | 738 | |
| 739 | 739 | $widget_info->markup_type = $args->markup_type; |
| 740 | 740 | // If it is a tab type, list up tab items and change key value(module_srl) to index |
| 741 | - if($args->tab_type != 'none' && $args->tab_type) |
|
| 741 | + if ($args->tab_type != 'none' && $args->tab_type) |
|
| 742 | 742 | { |
| 743 | 743 | $tab = array(); |
| 744 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 744 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 745 | 745 | { |
| 746 | - if(!is_array($content_items[$module_srl]) || !count($content_items[$module_srl])) continue; |
|
| 746 | + if (!is_array($content_items[$module_srl]) || !count($content_items[$module_srl])) continue; |
|
| 747 | 747 | |
| 748 | 748 | unset($tab_item); |
| 749 | 749 | $tab_item = new stdClass(); |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | $tab_item->content_items = $content_items[$module_srl]; |
| 752 | 752 | $tab_item->domain = $content_items[$module_srl][0]->getDomain(); |
| 753 | 753 | $tab_item->url = $content_items[$module_srl][0]->getContentsLink(); |
| 754 | - if(!$tab_item->url) $tab_item->url = getSiteUrl($tab_item->domain, '','mid',$mid); |
|
| 754 | + if (!$tab_item->url) $tab_item->url = getSiteUrl($tab_item->domain, '', 'mid', $mid); |
|
| 755 | 755 | $tab[] = $tab_item; |
| 756 | 756 | } |
| 757 | 757 | $widget_info->tab = $tab; |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | var $contents_link = null; |
| 780 | 780 | var $domain = null; |
| 781 | 781 | |
| 782 | - function __construct($browser_title='') |
|
| 782 | + function __construct($browser_title = '') |
|
| 783 | 783 | { |
| 784 | 784 | $this->browser_title = $browser_title; |
| 785 | 785 | } |
@@ -789,22 +789,22 @@ discard block |
||
| 789 | 789 | } |
| 790 | 790 | function setFirstThumbnailIdx($first_thumbnail_idx) |
| 791 | 791 | { |
| 792 | - if(is_null($this->first_thumbnail) && $first_thumbnail_idx>-1) |
|
| 792 | + if (is_null($this->first_thumbnail) && $first_thumbnail_idx > -1) |
|
| 793 | 793 | { |
| 794 | 794 | $this->has_first_thumbnail_idx = true; |
| 795 | - $this->first_thumbnail_idx= $first_thumbnail_idx; |
|
| 795 | + $this->first_thumbnail_idx = $first_thumbnail_idx; |
|
| 796 | 796 | } |
| 797 | 797 | } |
| 798 | 798 | function setExtraImages($extra_images) |
| 799 | 799 | { |
| 800 | - $this->add('extra_images',$extra_images); |
|
| 800 | + $this->add('extra_images', $extra_images); |
|
| 801 | 801 | } |
| 802 | 802 | function setDomain($domain) |
| 803 | 803 | { |
| 804 | 804 | static $default_domain = null; |
| 805 | - if(!$domain) |
|
| 805 | + if (!$domain) |
|
| 806 | 806 | { |
| 807 | - if(is_null($default_domain)) $default_domain = Context::getDefaultUrl(); |
|
| 807 | + if (is_null($default_domain)) $default_domain = Context::getDefaultUrl(); |
|
| 808 | 808 | $domain = $default_domain; |
| 809 | 809 | } |
| 810 | 810 | $this->domain = $domain; |
@@ -868,17 +868,17 @@ discard block |
||
| 868 | 868 | { |
| 869 | 869 | return $this->get('module_srl'); |
| 870 | 870 | } |
| 871 | - function getTitle($cut_size = 0, $tail='...') |
|
| 871 | + function getTitle($cut_size = 0, $tail = '...') |
|
| 872 | 872 | { |
| 873 | 873 | $title = htmlspecialchars($this->get('title'), ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 874 | 874 | |
| 875 | - if($cut_size) $title = cut_str($title, $cut_size, $tail); |
|
| 875 | + if ($cut_size) $title = cut_str($title, $cut_size, $tail); |
|
| 876 | 876 | |
| 877 | 877 | $attrs = array(); |
| 878 | - if($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold'; |
|
| 879 | - if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color'); |
|
| 878 | + if ($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold'; |
|
| 879 | + if ($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color'); |
|
| 880 | 880 | |
| 881 | - if(count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), $title); |
|
| 881 | + if (count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), $title); |
|
| 882 | 882 | |
| 883 | 883 | return $title; |
| 884 | 884 | } |
@@ -890,9 +890,9 @@ discard block |
||
| 890 | 890 | { |
| 891 | 891 | return $this->get('category'); |
| 892 | 892 | } |
| 893 | - function getNickName($cut_size = 0, $tail='...') |
|
| 893 | + function getNickName($cut_size = 0, $tail = '...') |
|
| 894 | 894 | { |
| 895 | - if($cut_size) $nick_name = cut_str($this->get('nick_name'), $cut_size, $tail); |
|
| 895 | + if ($cut_size) $nick_name = cut_str($this->get('nick_name'), $cut_size, $tail); |
|
| 896 | 896 | else $nick_name = $this->get('nick_name'); |
| 897 | 897 | |
| 898 | 898 | return $nick_name; |
@@ -904,12 +904,12 @@ discard block |
||
| 904 | 904 | function getCommentCount() |
| 905 | 905 | { |
| 906 | 906 | $comment_count = $this->get('comment_count'); |
| 907 | - return $comment_count>0 ? $comment_count : ''; |
|
| 907 | + return $comment_count > 0 ? $comment_count : ''; |
|
| 908 | 908 | } |
| 909 | 909 | function getTrackbackCount() |
| 910 | 910 | { |
| 911 | 911 | $trackback_count = $this->get('trackback_count'); |
| 912 | - return $trackback_count>0 ? $trackback_count : ''; |
|
| 912 | + return $trackback_count > 0 ? $trackback_count : ''; |
|
| 913 | 913 | } |
| 914 | 914 | function getRegdate($format = 'Y.m.d H:i:s') |
| 915 | 915 | { |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * @file config/config.inc.php |
| 8 | 8 | * @author NAVER ([email protected]) |
| 9 | 9 | */ |
| 10 | -if(version_compare(PHP_VERSION, '5.4.0', '<')) |
|
| 10 | +if (version_compare(PHP_VERSION, '5.4.0', '<')) |
|
| 11 | 11 | { |
| 12 | 12 | @error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING); |
| 13 | 13 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | @error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING ^ E_STRICT); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -if(!defined('__XE__')) |
|
| 19 | +if (!defined('__XE__')) |
|
| 20 | 20 | { |
| 21 | 21 | exit(); |
| 22 | 22 | } |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | // Set can use other method instead cookie to store session id(for file upload) |
| 53 | 53 | ini_set('session.use_only_cookies', 0); |
| 54 | 54 | |
| 55 | -if(file_exists(_XE_PATH_ . 'config/package.inc.php')) |
|
| 55 | +if (file_exists(_XE_PATH_.'config/package.inc.php')) |
|
| 56 | 56 | { |
| 57 | - require _XE_PATH_ . 'config/package.inc.php'; |
|
| 57 | + require _XE_PATH_.'config/package.inc.php'; |
|
| 58 | 58 | } |
| 59 | 59 | else |
| 60 | 60 | { |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | * define('__ENABLE_PHPUNIT_TEST__', 0); |
| 97 | 97 | * define('__PROXY_SERVER__', 'http://domain:port/path'); |
| 98 | 98 | */ |
| 99 | -if(file_exists(_XE_PATH_ . 'config/config.user.inc.php')) |
|
| 99 | +if (file_exists(_XE_PATH_.'config/config.user.inc.php')) |
|
| 100 | 100 | { |
| 101 | - require _XE_PATH_ . 'config/config.user.inc.php'; |
|
| 101 | + require _XE_PATH_.'config/config.user.inc.php'; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | -if(!defined('__DEBUG__')) |
|
| 104 | +if (!defined('__DEBUG__')) |
|
| 105 | 105 | { |
| 106 | 106 | /** |
| 107 | 107 | * output debug message(bit value) |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | define('__DEBUG__', 0); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | -if(!defined('__DEBUG_OUTPUT__')) |
|
| 119 | +if (!defined('__DEBUG_OUTPUT__')) |
|
| 120 | 120 | { |
| 121 | 121 | /** |
| 122 | 122 | * output location of debug message |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | define('__DEBUG_OUTPUT__', 0); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | -if(!defined('__DEBUG_PROTECT__')) |
|
| 133 | +if (!defined('__DEBUG_PROTECT__')) |
|
| 134 | 134 | { |
| 135 | 135 | /** |
| 136 | 136 | * output comments of the firePHP console and browser |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | define('__DEBUG_PROTECT__', 1); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | -if(!defined('__DEBUG_PROTECT_IP__')) |
|
| 146 | +if (!defined('__DEBUG_PROTECT_IP__')) |
|
| 147 | 147 | { |
| 148 | 148 | /** |
| 149 | 149 | * Set a ip address to allow debug |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | define('__DEBUG_PROTECT_IP__', '127.0.0.1'); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | -if(!defined('__DEBUG_DB_OUTPUT__')) |
|
| 154 | +if (!defined('__DEBUG_DB_OUTPUT__')) |
|
| 155 | 155 | { |
| 156 | 156 | /** |
| 157 | 157 | * DB error message definition |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | define('__DEBUG_DB_OUTPUT__', 0); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | -if(!defined('__LOG_SLOW_QUERY__')) |
|
| 167 | +if (!defined('__LOG_SLOW_QUERY__')) |
|
| 168 | 168 | { |
| 169 | 169 | /** |
| 170 | 170 | * Query log for only timeout query among DB queries |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | define('__LOG_SLOW_QUERY__', 0); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | -if(!defined('__LOG_SLOW_TRIGGER__')) |
|
| 181 | +if (!defined('__LOG_SLOW_TRIGGER__')) |
|
| 182 | 182 | { |
| 183 | 183 | /** |
| 184 | 184 | * Trigger excute time log |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | define('__LOG_SLOW_TRIGGER__', 0); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | -if(!defined('__LOG_SLOW_ADDON__')) |
|
| 195 | +if (!defined('__LOG_SLOW_ADDON__')) |
|
| 196 | 196 | { |
| 197 | 197 | /** |
| 198 | 198 | * Addon excute time log |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | define('__LOG_SLOW_ADDON__', 0); |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | -if(!defined('__LOG_SLOW_WIDGET__')) |
|
| 209 | +if (!defined('__LOG_SLOW_WIDGET__')) |
|
| 210 | 210 | { |
| 211 | 211 | /** |
| 212 | 212 | * Widget excute time log |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | define('__LOG_SLOW_WIDGET__', 0); |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | -if(!defined('__DEBUG_QUERY__')) |
|
| 223 | +if (!defined('__DEBUG_QUERY__')) |
|
| 224 | 224 | { |
| 225 | 225 | /** |
| 226 | 226 | * Leave DB query information |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | define('__DEBUG_QUERY__', 0); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | -if(!defined('__OB_GZHANDLER_ENABLE__')) |
|
| 236 | +if (!defined('__OB_GZHANDLER_ENABLE__')) |
|
| 237 | 237 | { |
| 238 | 238 | /** |
| 239 | 239 | * option to enable/disable a compression feature using ob_gzhandler |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | define('__OB_GZHANDLER_ENABLE__', 1); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | -if(!defined('__ENABLE_PHPUNIT_TEST__')) |
|
| 250 | +if (!defined('__ENABLE_PHPUNIT_TEST__')) |
|
| 251 | 251 | { |
| 252 | 252 | /** |
| 253 | 253 | * decide to use/not use the php unit test (Path/tests/index.php) |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | define('__ENABLE_PHPUNIT_TEST__', 0); |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | -if(!defined('__PROXY_SERVER__')) |
|
| 263 | +if (!defined('__PROXY_SERVER__')) |
|
| 264 | 264 | { |
| 265 | 265 | /** |
| 266 | 266 | * __PROXY_SERVER__ has server information to request to the external through the target server |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | define('__PROXY_SERVER__', NULL); |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | -if(!defined('__ERROR_LOG__')) |
|
| 272 | +if (!defined('__ERROR_LOG__')) |
|
| 273 | 273 | { |
| 274 | 274 | /** |
| 275 | 275 | * __ERROR_LOG__ 는 PHP의 에러로그를 출력하는 기능입니다. 개발시 워닝에러이상의 에러부터 잡기 시작합니다. |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | define('__ERROR_LOG__', 0); |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | -if(!defined('__DISABLE_DEFAULT_CSS__')) |
|
| 283 | +if (!defined('__DISABLE_DEFAULT_CSS__')) |
|
| 284 | 284 | { |
| 285 | 285 | /** |
| 286 | 286 | * XE의 기본 CSS 스타일을 로드하지 않도록 합니다. |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | define('__DISABLE_DEFAULT_CSS__', 0); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | -if(!defined('__AUTO_OPCACHE_INVALIDATE__')) |
|
| 298 | +if (!defined('__AUTO_OPCACHE_INVALIDATE__')) |
|
| 299 | 299 | { |
| 300 | 300 | /** |
| 301 | 301 | * 업데이트 시 주요 파일의 OPcache를 자동 초기화 옵션 |
@@ -310,13 +310,13 @@ discard block |
||
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | // Require specific files when using Firebug console output |
| 313 | -if((__DEBUG_OUTPUT__ == 2) && version_compare(PHP_VERSION, '6.0.0') === -1) |
|
| 313 | +if ((__DEBUG_OUTPUT__ == 2) && version_compare(PHP_VERSION, '6.0.0') === -1) |
|
| 314 | 314 | { |
| 315 | - require _XE_PATH_ . 'libs/FirePHPCore/FirePHP.class.php'; |
|
| 315 | + require _XE_PATH_.'libs/FirePHPCore/FirePHP.class.php'; |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | // Set Timezone as server time |
| 319 | -if(version_compare(PHP_VERSION, '5.3.0') >= 0) |
|
| 319 | +if (version_compare(PHP_VERSION, '5.3.0') >= 0) |
|
| 320 | 320 | { |
| 321 | 321 | date_default_timezone_set(@date_default_timezone_get()); |
| 322 | 322 | } |
@@ -422,8 +422,8 @@ discard block |
||
| 422 | 422 | * Invalidates a cached script of OPcache when version is changed. |
| 423 | 423 | * @see https://github.com/xpressengine/xe-core/issues/2189 |
| 424 | 424 | **/ |
| 425 | -$cache_path = _XE_PATH_ . 'files/cache/store/' . __XE_VERSION__; |
|
| 426 | -if( |
|
| 425 | +$cache_path = _XE_PATH_.'files/cache/store/'.__XE_VERSION__; |
|
| 426 | +if ( |
|
| 427 | 427 | __AUTO_OPCACHE_INVALIDATE__ === 1 |
| 428 | 428 | && !is_dir($cache_path) |
| 429 | 429 | && function_exists('opcache_get_status') |
@@ -433,62 +433,62 @@ discard block |
||
| 433 | 433 | @mkdir($cache_path, 0755, TRUE); |
| 434 | 434 | @chmod($cache_path, 0755); |
| 435 | 435 | |
| 436 | - foreach($GLOBALS['__xe_autoload_file_map'] as $script) { |
|
| 437 | - opcache_invalidate(_XE_PATH_ . $script, true); |
|
| 436 | + foreach ($GLOBALS['__xe_autoload_file_map'] as $script) { |
|
| 437 | + opcache_invalidate(_XE_PATH_.$script, true); |
|
| 438 | 438 | } |
| 439 | - opcache_invalidate(_XE_PATH_ . 'config/func.inc.php', true); |
|
| 439 | + opcache_invalidate(_XE_PATH_.'config/func.inc.php', true); |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | // Require a function-defined-file for simple use |
| 443 | -require(_XE_PATH_ . 'config/func.inc.php'); |
|
| 443 | +require(_XE_PATH_.'config/func.inc.php'); |
|
| 444 | 444 | |
| 445 | -if(__DEBUG__) { |
|
| 445 | +if (__DEBUG__) { |
|
| 446 | 446 | define('__StartTime__', getMicroTime()); |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | -if(__DEBUG__) { |
|
| 449 | +if (__DEBUG__) { |
|
| 450 | 450 | $GLOBALS['__elapsed_class_load__'] = 0; |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | function __xe_autoload($class_name) |
| 454 | 454 | { |
| 455 | - if(__DEBUG__) { |
|
| 455 | + if (__DEBUG__) { |
|
| 456 | 456 | $time_at = getMicroTime(); |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | - if(isset($GLOBALS['__xe_autoload_file_map'][strtolower($class_name)])) |
|
| 459 | + if (isset($GLOBALS['__xe_autoload_file_map'][strtolower($class_name)])) |
|
| 460 | 460 | { |
| 461 | - require _XE_PATH_ . $GLOBALS['__xe_autoload_file_map'][strtolower($class_name)]; |
|
| 461 | + require _XE_PATH_.$GLOBALS['__xe_autoload_file_map'][strtolower($class_name)]; |
|
| 462 | 462 | } |
| 463 | - elseif(preg_match('/^([a-zA-Z0-9_]+?)(Admin)?(View|Controller|Model|Api|Wap|Mobile)?$/', $class_name, $matches)) |
|
| 463 | + elseif (preg_match('/^([a-zA-Z0-9_]+?)(Admin)?(View|Controller|Model|Api|Wap|Mobile)?$/', $class_name, $matches)) |
|
| 464 | 464 | { |
| 465 | 465 | $candidate_filename = array(); |
| 466 | - $candidate_filename[] = 'modules/' . $matches[1] . '/' . $matches[1]; |
|
| 467 | - if(isset($matches[2]) && $matches[2]) $candidate_filename[] = 'admin'; |
|
| 466 | + $candidate_filename[] = 'modules/'.$matches[1].'/'.$matches[1]; |
|
| 467 | + if (isset($matches[2]) && $matches[2]) $candidate_filename[] = 'admin'; |
|
| 468 | 468 | $candidate_filename[] = (isset($matches[3]) && $matches[3]) ? strtolower($matches[3]) : 'class'; |
| 469 | 469 | $candidate_filename[] = 'php'; |
| 470 | 470 | |
| 471 | 471 | $candidate_filename = implode('.', $candidate_filename); |
| 472 | 472 | |
| 473 | - if(file_exists(_XE_PATH_ . $candidate_filename)) |
|
| 473 | + if (file_exists(_XE_PATH_.$candidate_filename)) |
|
| 474 | 474 | { |
| 475 | - require _XE_PATH_ . $candidate_filename; |
|
| 475 | + require _XE_PATH_.$candidate_filename; |
|
| 476 | 476 | } |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | - if(__DEBUG__) { |
|
| 479 | + if (__DEBUG__) { |
|
| 480 | 480 | $GLOBALS['__elapsed_class_load__'] += getMicroTime() - $time_at; |
| 481 | 481 | } |
| 482 | 482 | } |
| 483 | 483 | spl_autoload_register('__xe_autoload'); |
| 484 | 484 | |
| 485 | -if(version_compare(PHP_VERSION, '7.2', '<')) |
|
| 485 | +if (version_compare(PHP_VERSION, '7.2', '<')) |
|
| 486 | 486 | { |
| 487 | 487 | class_alias('BaseObject', 'Object', true); |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | -if(file_exists(_XE_PATH_ . '/vendor/autoload.php')) { |
|
| 491 | - require _XE_PATH_ . '/vendor/autoload.php'; |
|
| 490 | +if (file_exists(_XE_PATH_.'/vendor/autoload.php')) { |
|
| 491 | + require _XE_PATH_.'/vendor/autoload.php'; |
|
| 492 | 492 | } |
| 493 | 493 | /* End of file config.inc.php */ |
| 494 | 494 | /* Location: ./config/config.inc.php */ |
@@ -31,21 +31,21 @@ discard block |
||
| 31 | 31 | * @param array $columnList |
| 32 | 32 | * @return array layout lists in site |
| 33 | 33 | */ |
| 34 | - function getLayoutList($site_srl = 0, $layout_type="P", $columnList = array()) |
|
| 34 | + function getLayoutList($site_srl = 0, $layout_type = "P", $columnList = array()) |
|
| 35 | 35 | { |
| 36 | - if(!$site_srl) |
|
| 36 | + if (!$site_srl) |
|
| 37 | 37 | { |
| 38 | 38 | $site_module_info = Context::get('site_module_info'); |
| 39 | - $site_srl = (int)$site_module_info->site_srl; |
|
| 39 | + $site_srl = (int) $site_module_info->site_srl; |
|
| 40 | 40 | } |
| 41 | 41 | $args = new stdClass(); |
| 42 | 42 | $args->site_srl = $site_srl; |
| 43 | 43 | $args->layout_type = $layout_type; |
| 44 | 44 | $output = executeQueryArray('layout.getLayoutList', $args, $columnList); |
| 45 | 45 | |
| 46 | - foreach($output->data as $no => &$val) |
|
| 46 | + foreach ($output->data as $no => &$val) |
|
| 47 | 47 | { |
| 48 | - if(!$this->isExistsLayoutFile($val->layout, $layout_type)) |
|
| 48 | + if (!$this->isExistsLayoutFile($val->layout, $layout_type)) |
|
| 49 | 49 | { |
| 50 | 50 | unset($output->data[$no]); |
| 51 | 51 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | $oLayoutAdminModel = getAdminModel('layout'); |
| 55 | 55 | $siteDefaultLayoutSrl = $oLayoutAdminModel->getSiteDefaultLayout($layout_type, $site_srl); |
| 56 | - if($siteDefaultLayoutSrl) |
|
| 56 | + if ($siteDefaultLayoutSrl) |
|
| 57 | 57 | { |
| 58 | 58 | $siteDefaultLayoutInfo = $this->getlayout($siteDefaultLayoutSrl); |
| 59 | 59 | $newLayout = sprintf('%s, %s', $siteDefaultLayoutInfo->title, $siteDefaultLayoutInfo->layout); |
@@ -80,24 +80,24 @@ discard block |
||
| 80 | 80 | $layoutList = $this->getLayoutInstanceList($siteSrl, $layoutType); |
| 81 | 81 | $thumbs = array(); |
| 82 | 82 | |
| 83 | - foreach($layoutList as $key => $val) |
|
| 83 | + foreach ($layoutList as $key => $val) |
|
| 84 | 84 | { |
| 85 | - if($thumbs[$val->layouts]) |
|
| 85 | + if ($thumbs[$val->layouts]) |
|
| 86 | 86 | { |
| 87 | 87 | $val->thumbnail = $thumbs[$val->layouts]; |
| 88 | 88 | continue; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $token = explode('|@|', $val->layout); |
| 92 | - if(count($token) == 2) |
|
| 92 | + if (count($token) == 2) |
|
| 93 | 93 | { |
| 94 | - $thumbnailPath = sprintf('./themes/%s/layouts/%s/thumbnail.png' , $token[0], $token[1]); |
|
| 94 | + $thumbnailPath = sprintf('./themes/%s/layouts/%s/thumbnail.png', $token[0], $token[1]); |
|
| 95 | 95 | } |
| 96 | 96 | else |
| 97 | 97 | { |
| 98 | - $thumbnailPath = sprintf('./layouts/%s/thumbnail.png' , $val->layout); |
|
| 98 | + $thumbnailPath = sprintf('./layouts/%s/thumbnail.png', $val->layout); |
|
| 99 | 99 | } |
| 100 | - if(is_readable($thumbnailPath)) |
|
| 100 | + if (is_readable($thumbnailPath)) |
|
| 101 | 101 | { |
| 102 | 102 | $val->thumbnail = $thumbnailPath; |
| 103 | 103 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if (!$siteSrl) |
| 124 | 124 | { |
| 125 | 125 | $siteModuleInfo = Context::get('site_module_info'); |
| 126 | - $siteSrl = (int)$siteModuleInfo->site_srl; |
|
| 126 | + $siteSrl = (int) $siteModuleInfo->site_srl; |
|
| 127 | 127 | } |
| 128 | 128 | $args = new stdClass(); |
| 129 | 129 | $args->site_srl = $siteSrl; |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | // Create instance name list |
| 135 | 135 | $instanceList = array(); |
| 136 | - if(is_array($output->data)) |
|
| 136 | + if (is_array($output->data)) |
|
| 137 | 137 | { |
| 138 | - foreach($output->data as $no => $iInfo) |
|
| 138 | + foreach ($output->data as $no => $iInfo) |
|
| 139 | 139 | { |
| 140 | - if($this->isExistsLayoutFile($iInfo->layout, $layoutType)) |
|
| 140 | + if ($this->isExistsLayoutFile($iInfo->layout, $layoutType)) |
|
| 141 | 141 | { |
| 142 | 142 | $instanceList[] = $iInfo->layout; |
| 143 | 143 | } |
@@ -152,18 +152,18 @@ discard block |
||
| 152 | 152 | $downloadedList = array(); |
| 153 | 153 | $titleList = array(); |
| 154 | 154 | $_downloadedList = $this->getDownloadedLayoutList($layoutType); |
| 155 | - if(is_array($_downloadedList)) |
|
| 155 | + if (is_array($_downloadedList)) |
|
| 156 | 156 | { |
| 157 | - foreach($_downloadedList as $dLayoutInfo) |
|
| 157 | + foreach ($_downloadedList as $dLayoutInfo) |
|
| 158 | 158 | { |
| 159 | 159 | $downloadedList[$dLayoutInfo->layout] = $dLayoutInfo->layout; |
| 160 | 160 | $titleList[$dLayoutInfo->layout] = $dLayoutInfo->title; |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - if($layout) |
|
| 164 | + if ($layout) |
|
| 165 | 165 | { |
| 166 | - if(count($instanceList) < 1 && $downloadedList[$layout]) |
|
| 166 | + if (count($instanceList) < 1 && $downloadedList[$layout]) |
|
| 167 | 167 | { |
| 168 | 168 | $insertArgs = new stdClass(); |
| 169 | 169 | $insertArgs->site_srl = $siteSrl; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | { |
| 182 | 182 | // Get downloaded name list have no instance |
| 183 | 183 | $noInstanceList = array_diff($downloadedList, $instanceList); |
| 184 | - foreach($noInstanceList as $layoutName) |
|
| 184 | + foreach ($noInstanceList as $layoutName) |
|
| 185 | 185 | { |
| 186 | 186 | $insertArgs = new stdClass(); |
| 187 | 187 | $insertArgs->site_srl = $siteSrl; |
@@ -197,15 +197,15 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | // If create layout instance, reload instance list |
| 200 | - if($isCreateInstance) |
|
| 200 | + if ($isCreateInstance) |
|
| 201 | 201 | { |
| 202 | 202 | $output = executeQueryArray('layout.getLayoutList', $args, $columnList); |
| 203 | 203 | |
| 204 | - if(is_array($output->data)) |
|
| 204 | + if (is_array($output->data)) |
|
| 205 | 205 | { |
| 206 | - foreach($output->data as $no => $iInfo) |
|
| 206 | + foreach ($output->data as $no => $iInfo) |
|
| 207 | 207 | { |
| 208 | - if(!$this->isExistsLayoutFile($iInfo->layout, $layoutType)) |
|
| 208 | + if (!$this->isExistsLayoutFile($iInfo->layout, $layoutType)) |
|
| 209 | 209 | { |
| 210 | 210 | unset($output->data[$no]); |
| 211 | 211 | } |
@@ -226,28 +226,28 @@ discard block |
||
| 226 | 226 | function isExistsLayoutFile($layout, $layoutType) |
| 227 | 227 | { |
| 228 | 228 | //TODO If remove a support themes, remove this codes also. |
| 229 | - if($layoutType == 'P') |
|
| 229 | + if ($layoutType == 'P') |
|
| 230 | 230 | { |
| 231 | - $pathPrefix = _XE_PATH_ . 'layouts/'; |
|
| 232 | - $themePathFormat = _XE_PATH_ . 'themes/%s/layouts/%s'; |
|
| 231 | + $pathPrefix = _XE_PATH_.'layouts/'; |
|
| 232 | + $themePathFormat = _XE_PATH_.'themes/%s/layouts/%s'; |
|
| 233 | 233 | } |
| 234 | 234 | else |
| 235 | 235 | { |
| 236 | - $pathPrefix = _XE_PATH_ . 'm.layouts/'; |
|
| 237 | - $themePathFormat = _XE_PATH_ . 'themes/%s/m.layouts/%s'; |
|
| 236 | + $pathPrefix = _XE_PATH_.'m.layouts/'; |
|
| 237 | + $themePathFormat = _XE_PATH_.'themes/%s/m.layouts/%s'; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | - if(strpos($layout, '|@|') !== FALSE) |
|
| 240 | + if (strpos($layout, '|@|') !== FALSE) |
|
| 241 | 241 | { |
| 242 | 242 | list($themeName, $layoutName) = explode('|@|', $layout); |
| 243 | 243 | $path = sprintf($themePathFormat, $themeName, $layoutName); |
| 244 | 244 | } |
| 245 | 245 | else |
| 246 | 246 | { |
| 247 | - $path = $pathPrefix . $layout; |
|
| 247 | + $path = $pathPrefix.$layout; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - return is_readable($path . '/layout.html'); |
|
| 250 | + return is_readable($path.'/layout.html'); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | /** |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $args = new stdClass(); |
| 263 | 263 | $args->layout_srl = $layout_srl; |
| 264 | 264 | $output = executeQuery('layout.getLayout', $args); |
| 265 | - if(!$output->data) return; |
|
| 265 | + if (!$output->data) return; |
|
| 266 | 266 | |
| 267 | 267 | // Return xml file informaton after listing up the layout and extra_vars |
| 268 | 268 | $layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | $args = new stdClass(); |
| 276 | 276 | $args->layout_srl = $layout_srl; |
| 277 | 277 | $output = executeQuery('layout.getLayout', $args, $columnList); |
| 278 | - if(!$output->toBool()) |
|
| 278 | + if (!$output->toBool()) |
|
| 279 | 279 | { |
| 280 | 280 | return; |
| 281 | 281 | } |
@@ -292,15 +292,15 @@ discard block |
||
| 292 | 292 | function getLayoutPath($layout_name = "", $layout_type = "P") |
| 293 | 293 | { |
| 294 | 294 | $layout_parse = explode('|@|', $layout_name); |
| 295 | - if(count($layout_parse) > 1) |
|
| 295 | + if (count($layout_parse) > 1) |
|
| 296 | 296 | { |
| 297 | 297 | $class_path = './themes/'.$layout_parse[0].'/layouts/'.$layout_parse[1].'/'; |
| 298 | 298 | } |
| 299 | - else if($layout_name == 'faceoff') |
|
| 299 | + else if ($layout_name == 'faceoff') |
|
| 300 | 300 | { |
| 301 | 301 | $class_path = './modules/layout/faceoff/'; |
| 302 | 302 | } |
| 303 | - else if($layout_type == "M") |
|
| 303 | + else if ($layout_type == "M") |
|
| 304 | 304 | { |
| 305 | 305 | $class_path = sprintf("./m.layouts/%s/", $layout_name); |
| 306 | 306 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | { |
| 309 | 309 | $class_path = sprintf('./layouts/%s/', $layout_name); |
| 310 | 310 | } |
| 311 | - if(is_dir($class_path)) return $class_path; |
|
| 311 | + if (is_dir($class_path)) return $class_path; |
|
| 312 | 312 | return ""; |
| 313 | 313 | } |
| 314 | 314 | |
@@ -326,24 +326,24 @@ discard block |
||
| 326 | 326 | // Get a list of downloaded layout and installed layout |
| 327 | 327 | $searched_list = $this->_getInstalledLayoutDirectories($layout_type); |
| 328 | 328 | $searched_count = count($searched_list); |
| 329 | - if(!$searched_count) return; |
|
| 329 | + if (!$searched_count) return; |
|
| 330 | 330 | |
| 331 | 331 | // natcasesort($searched_list); |
| 332 | 332 | // Return information for looping searched list of layouts |
| 333 | 333 | $list = array(); |
| 334 | - for($i=0;$i<$searched_count;$i++) |
|
| 334 | + for ($i = 0; $i < $searched_count; $i++) |
|
| 335 | 335 | { |
| 336 | 336 | // Name of the layout |
| 337 | 337 | $layout = $searched_list[$i]; |
| 338 | 338 | // Get information of the layout |
| 339 | 339 | $layout_info = $this->getLayoutInfo($layout, null, $layout_type); |
| 340 | 340 | |
| 341 | - if(!$layout_info) |
|
| 341 | + if (!$layout_info) |
|
| 342 | 342 | { |
| 343 | 343 | continue; |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | - if($withAutoinstallInfo) |
|
| 346 | + if ($withAutoinstallInfo) |
|
| 347 | 347 | { |
| 348 | 348 | // get easyinstall remove url |
| 349 | 349 | $packageSrl = $oAutoinstallModel->getPackageSrlByPath($layout_info->path); |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $layout_info->need_update = $package[$packageSrl]->need_update; |
| 355 | 355 | |
| 356 | 356 | // get easyinstall update url |
| 357 | - if($layout_info->need_update) |
|
| 357 | + if ($layout_info->need_update) |
|
| 358 | 358 | { |
| 359 | 359 | $layout_info->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl); |
| 360 | 360 | } |
@@ -371,12 +371,12 @@ discard block |
||
| 371 | 371 | */ |
| 372 | 372 | function sortLayoutByTitle($a, $b) |
| 373 | 373 | { |
| 374 | - if(!$a->title) |
|
| 374 | + if (!$a->title) |
|
| 375 | 375 | { |
| 376 | 376 | $a->title = $a->layout; |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | - if(!$b->title) |
|
| 379 | + if (!$b->title) |
|
| 380 | 380 | { |
| 381 | 381 | $b->title = $b->layout; |
| 382 | 382 | } |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $aTitle = strtolower($a->title); |
| 385 | 385 | $bTitle = strtolower($b->title); |
| 386 | 386 | |
| 387 | - if($aTitle == $bTitle) |
|
| 387 | + if ($aTitle == $bTitle) |
|
| 388 | 388 | { |
| 389 | 389 | return 0; |
| 390 | 390 | } |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | */ |
| 411 | 411 | function _getInstalledLayoutDirectories($layoutType = 'P') |
| 412 | 412 | { |
| 413 | - if($layoutType == 'M') |
|
| 413 | + if ($layoutType == 'M') |
|
| 414 | 414 | { |
| 415 | 415 | $directory = './m.layouts'; |
| 416 | 416 | $globalValueKey = 'MOBILE_LAYOUT_DIRECTOIES'; |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $globalValueKey = 'PC_LAYOUT_DIRECTORIES'; |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | - if($GLOBALS[$globalValueKey]) return $GLOBALS[$globalValueKey]; |
|
| 424 | + if ($GLOBALS[$globalValueKey]) return $GLOBALS[$globalValueKey]; |
|
| 425 | 425 | |
| 426 | 426 | $searchedList = FileHandler::readDir($directory); |
| 427 | 427 | if (!$searchedList) $searchedList = array(); |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | */ |
| 441 | 441 | function getLayoutInfo($layout, $info = null, $layout_type = "P") |
| 442 | 442 | { |
| 443 | - if($info) |
|
| 443 | + if ($info) |
|
| 444 | 444 | { |
| 445 | 445 | $layout_title = $info->title; |
| 446 | 446 | $layout = $info->layout; |
@@ -448,35 +448,35 @@ discard block |
||
| 448 | 448 | $site_srl = $info->site_srl; |
| 449 | 449 | $vars = unserialize($info->extra_vars); |
| 450 | 450 | |
| 451 | - if($info->module_srl) |
|
| 451 | + if ($info->module_srl) |
|
| 452 | 452 | { |
| 453 | - $layout_path = preg_replace('/([a-zA-Z0-9\_\.]+)(\.html)$/','',$info->layout_path); |
|
| 453 | + $layout_path = preg_replace('/([a-zA-Z0-9\_\.]+)(\.html)$/', '', $info->layout_path); |
|
| 454 | 454 | $xml_file = sprintf('%sskin.xml', $layout_path); |
| 455 | 455 | } |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | // Get a path of the requested module. Return if not exists. |
| 459 | - if(!$layout_path) $layout_path = $this->getLayoutPath($layout, $layout_type); |
|
| 460 | - if(!is_dir($layout_path)) return; |
|
| 459 | + if (!$layout_path) $layout_path = $this->getLayoutPath($layout, $layout_type); |
|
| 460 | + if (!is_dir($layout_path)) return; |
|
| 461 | 461 | |
| 462 | 462 | // Read the xml file for module skin information |
| 463 | - if(!$xml_file) $xml_file = sprintf("%sconf/info.xml", $layout_path); |
|
| 464 | - if(!file_exists($xml_file)) |
|
| 463 | + if (!$xml_file) $xml_file = sprintf("%sconf/info.xml", $layout_path); |
|
| 464 | + if (!file_exists($xml_file)) |
|
| 465 | 465 | { |
| 466 | 466 | $layout_info = new stdClass; |
| 467 | 467 | $layout_info->title = $layout; |
| 468 | 468 | $layout_info->layout = $layout; |
| 469 | 469 | $layout_info->path = $layout_path; |
| 470 | 470 | $layout_info->layout_title = $layout_title; |
| 471 | - if(!$layout_info->layout_type) |
|
| 471 | + if (!$layout_info->layout_type) |
|
| 472 | 472 | { |
| 473 | - $layout_info->layout_type = $layout_type; |
|
| 473 | + $layout_info->layout_type = $layout_type; |
|
| 474 | 474 | } |
| 475 | 475 | return $layout_info; |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | // Include the cache file if it is valid and then return $layout_info variable |
| 479 | - if(!$layout_srl) |
|
| 479 | + if (!$layout_srl) |
|
| 480 | 480 | { |
| 481 | 481 | $cache_file = $this->getLayoutCache($layout, Context::getLangType(), $layout_type); |
| 482 | 482 | } |
@@ -485,22 +485,22 @@ discard block |
||
| 485 | 485 | $cache_file = $this->getUserLayoutCache($layout_srl, Context::getLangType()); |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | - if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file)) |
|
| 488 | + if (file_exists($cache_file) && filemtime($cache_file) > filemtime($xml_file)) |
|
| 489 | 489 | { |
| 490 | 490 | include($cache_file); |
| 491 | 491 | |
| 492 | - if($layout_info->extra_var && $vars) |
|
| 492 | + if ($layout_info->extra_var && $vars) |
|
| 493 | 493 | { |
| 494 | - foreach($vars as $key => $value) |
|
| 494 | + foreach ($vars as $key => $value) |
|
| 495 | 495 | { |
| 496 | - if(!$layout_info->extra_var->{$key} && !$layout_info->{$key}) |
|
| 496 | + if (!$layout_info->extra_var->{$key} && !$layout_info->{$key}) |
|
| 497 | 497 | { |
| 498 | 498 | $layout_info->{$key} = $value; |
| 499 | 499 | } |
| 500 | 500 | } |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | - if(!$layout_info->title) |
|
| 503 | + if (!$layout_info->title) |
|
| 504 | 504 | { |
| 505 | 505 | $layout_info->title = $layout; |
| 506 | 506 | } |
@@ -511,16 +511,16 @@ discard block |
||
| 511 | 511 | $oXmlParser = new XmlParser(); |
| 512 | 512 | $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); |
| 513 | 513 | |
| 514 | - if($tmp_xml_obj->layout) $xml_obj = $tmp_xml_obj->layout; |
|
| 515 | - elseif($tmp_xml_obj->skin) $xml_obj = $tmp_xml_obj->skin; |
|
| 514 | + if ($tmp_xml_obj->layout) $xml_obj = $tmp_xml_obj->layout; |
|
| 515 | + elseif ($tmp_xml_obj->skin) $xml_obj = $tmp_xml_obj->skin; |
|
| 516 | 516 | |
| 517 | - if(!$xml_obj) return; |
|
| 517 | + if (!$xml_obj) return; |
|
| 518 | 518 | |
| 519 | 519 | $buff = array(); |
| 520 | 520 | $buff[] = '$layout_info = new stdClass;'; |
| 521 | 521 | $buff[] = sprintf('$layout_info->site_srl = "%s";', $site_srl); |
| 522 | 522 | |
| 523 | - if($xml_obj->version && $xml_obj->attrs->version == '0.2') |
|
| 523 | + if ($xml_obj->version && $xml_obj->attrs->version == '0.2') |
|
| 524 | 524 | { |
| 525 | 525 | // Layout title, version and other information |
| 526 | 526 | sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d); |
@@ -540,11 +540,11 @@ discard block |
||
| 540 | 540 | $buff[] = sprintf('$layout_info->layout_type = "%s";', $layout_type); |
| 541 | 541 | |
| 542 | 542 | // Author information |
| 543 | - if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; |
|
| 543 | + if (!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; |
|
| 544 | 544 | else $author_list = $xml_obj->author; |
| 545 | 545 | |
| 546 | 546 | $buff[] = '$layout_info->author = array();'; |
| 547 | - for($i=0, $c=count($author_list); $i<$c; $i++) |
|
| 547 | + for ($i = 0, $c = count($author_list); $i < $c; $i++) |
|
| 548 | 548 | { |
| 549 | 549 | $buff[] = sprintf('$layout_info->author[%d] = new stdClass;', $i); |
| 550 | 550 | $buff[] = sprintf('$layout_info->author[%d]->name = "%s";', $i, $author_list[$i]->name->body); |
@@ -554,22 +554,22 @@ discard block |
||
| 554 | 554 | |
| 555 | 555 | // Extra vars (user defined variables to use in a template) |
| 556 | 556 | $extra_var_groups = $xml_obj->extra_vars->group; |
| 557 | - if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; |
|
| 558 | - if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); |
|
| 557 | + if (!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; |
|
| 558 | + if (!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); |
|
| 559 | 559 | |
| 560 | 560 | $buff[] = '$layout_info->extra_var = new stdClass;'; |
| 561 | 561 | $extra_var_count = 0; |
| 562 | - foreach($extra_var_groups as $group) |
|
| 562 | + foreach ($extra_var_groups as $group) |
|
| 563 | 563 | { |
| 564 | 564 | $extra_vars = $group->var; |
| 565 | - if($extra_vars) |
|
| 565 | + if ($extra_vars) |
|
| 566 | 566 | { |
| 567 | - if(!is_array($extra_vars)) $extra_vars = array($extra_vars); |
|
| 567 | + if (!is_array($extra_vars)) $extra_vars = array($extra_vars); |
|
| 568 | 568 | |
| 569 | 569 | $count = count($extra_vars); |
| 570 | 570 | $extra_var_count += $count; |
| 571 | 571 | |
| 572 | - for($i=0;$i<$count;$i++) |
|
| 572 | + for ($i = 0; $i < $count; $i++) |
|
| 573 | 573 | { |
| 574 | 574 | unset($var, $options); |
| 575 | 575 | $var = $extra_vars[$i]; |
@@ -580,26 +580,26 @@ discard block |
||
| 580 | 580 | $buff[] = sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body); |
| 581 | 581 | $buff[] = sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type); |
| 582 | 582 | $buff[] = sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name); |
| 583 | - $buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body)); |
|
| 583 | + $buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"', '\"', $var->description->body)); |
|
| 584 | 584 | |
| 585 | 585 | $options = $var->options; |
| 586 | - if(!$options) continue; |
|
| 587 | - if(!is_array($options)) $options = array($options); |
|
| 586 | + if (!$options) continue; |
|
| 587 | + if (!is_array($options)) $options = array($options); |
|
| 588 | 588 | |
| 589 | 589 | $buff[] = sprintf('$layout_info->extra_var->%s->options = array();', $var->attrs->name); |
| 590 | 590 | $options_count = count($options); |
| 591 | 591 | $thumbnail_exist = false; |
| 592 | - for($j=0; $j < $options_count; $j++) |
|
| 592 | + for ($j = 0; $j < $options_count; $j++) |
|
| 593 | 593 | { |
| 594 | 594 | $buff[] = sprintf('$layout_info->extra_var->%s->options["%s"] = new stdClass;', $var->attrs->name, $options[$j]->attrs->value); |
| 595 | 595 | $thumbnail = $options[$j]->attrs->src; |
| 596 | - if($thumbnail) |
|
| 596 | + if ($thumbnail) |
|
| 597 | 597 | { |
| 598 | 598 | $thumbnail = $layout_path.$thumbnail; |
| 599 | - if(file_exists($thumbnail)) |
|
| 599 | + if (file_exists($thumbnail)) |
|
| 600 | 600 | { |
| 601 | 601 | $buff[] = sprintf('$layout_info->extra_var->%s->options["%s"]->thumbnail = "%s";', $var->attrs->name, $options[$j]->attrs->value, $thumbnail); |
| 602 | - if(!$thumbnail_exist) |
|
| 602 | + if (!$thumbnail_exist) |
|
| 603 | 603 | { |
| 604 | 604 | $buff[] = sprintf('$layout_info->extra_var->%s->thumbnail_exist = true;', $var->attrs->name); |
| 605 | 605 | $thumbnail_exist = true; |
@@ -613,26 +613,26 @@ discard block |
||
| 613 | 613 | } |
| 614 | 614 | $buff[] = sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count); |
| 615 | 615 | // Menu |
| 616 | - if($xml_obj->menus->menu) |
|
| 616 | + if ($xml_obj->menus->menu) |
|
| 617 | 617 | { |
| 618 | 618 | $menus = $xml_obj->menus->menu; |
| 619 | - if(!is_array($menus)) $menus = array($menus); |
|
| 619 | + if (!is_array($menus)) $menus = array($menus); |
|
| 620 | 620 | |
| 621 | 621 | $menu_count = count($menus); |
| 622 | 622 | $buff[] = sprintf('$layout_info->menu_count = "%s";', $menu_count); |
| 623 | 623 | $buff[] = '$layout_info->menu = new stdClass;'; |
| 624 | - for($i=0;$i<$menu_count;$i++) |
|
| 624 | + for ($i = 0; $i < $menu_count; $i++) |
|
| 625 | 625 | { |
| 626 | 626 | $name = $menus[$i]->attrs->name; |
| 627 | - if($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name); |
|
| 627 | + if ($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name); |
|
| 628 | 628 | $buff[] = sprintf('$layout_info->menu->%s = new stdClass;', $name); |
| 629 | - $buff[] = sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name); |
|
| 630 | - $buff[] = sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body); |
|
| 631 | - $buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->attrs->maxdepth); |
|
| 629 | + $buff[] = sprintf('$layout_info->menu->%s->name = "%s";', $name, $menus[$i]->attrs->name); |
|
| 630 | + $buff[] = sprintf('$layout_info->menu->%s->title = "%s";', $name, $menus[$i]->title->body); |
|
| 631 | + $buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";', $name, $menus[$i]->attrs->maxdepth); |
|
| 632 | 632 | |
| 633 | 633 | $buff[] = sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name); |
| 634 | - $buff[] = sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name); |
|
| 635 | - $buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name); |
|
| 634 | + $buff[] = sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";', $name, $name); |
|
| 635 | + $buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";', $name, $name); |
|
| 636 | 636 | } |
| 637 | 637 | } |
| 638 | 638 | } |
@@ -655,19 +655,19 @@ discard block |
||
| 655 | 655 | $buff[] = sprintf('$layout_info->author[0]->homepage = "%s";', $xml_obj->author->attrs->link); |
| 656 | 656 | // Extra vars (user defined variables to use in a template) |
| 657 | 657 | $extra_var_groups = $xml_obj->extra_vars->group; |
| 658 | - if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; |
|
| 659 | - if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); |
|
| 660 | - foreach($extra_var_groups as $group) |
|
| 658 | + if (!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars; |
|
| 659 | + if (!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups); |
|
| 660 | + foreach ($extra_var_groups as $group) |
|
| 661 | 661 | { |
| 662 | 662 | $extra_vars = $group->var; |
| 663 | - if($extra_vars) |
|
| 663 | + if ($extra_vars) |
|
| 664 | 664 | { |
| 665 | - if(!is_array($extra_vars)) $extra_vars = array($extra_vars); |
|
| 665 | + if (!is_array($extra_vars)) $extra_vars = array($extra_vars); |
|
| 666 | 666 | |
| 667 | 667 | $extra_var_count = count($extra_vars); |
| 668 | 668 | |
| 669 | 669 | $buff[] = sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count); |
| 670 | - for($i=0;$i<$extra_var_count;$i++) |
|
| 670 | + for ($i = 0; $i < $extra_var_count; $i++) |
|
| 671 | 671 | { |
| 672 | 672 | unset($var, $options); |
| 673 | 673 | $var = $extra_vars[$i]; |
@@ -677,14 +677,14 @@ discard block |
||
| 677 | 677 | $buff[] = sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body); |
| 678 | 678 | $buff[] = sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type); |
| 679 | 679 | $buff[] = sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name); |
| 680 | - $buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body)); |
|
| 680 | + $buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"', '\"', $var->description->body)); |
|
| 681 | 681 | |
| 682 | 682 | $options = $var->options; |
| 683 | - if(!$options) continue; |
|
| 683 | + if (!$options) continue; |
|
| 684 | 684 | |
| 685 | - if(!is_array($options)) $options = array($options); |
|
| 685 | + if (!is_array($options)) $options = array($options); |
|
| 686 | 686 | $options_count = count($options); |
| 687 | - for($j=0;$j<$options_count;$j++) |
|
| 687 | + for ($j = 0; $j < $options_count; $j++) |
|
| 688 | 688 | { |
| 689 | 689 | $buff[] = sprintf('$layout_info->extra_var->%s->options["%s"]->val = "%s";', $var->attrs->name, $options[$j]->value->body, $options[$j]->title->body); |
| 690 | 690 | } |
@@ -692,23 +692,23 @@ discard block |
||
| 692 | 692 | } |
| 693 | 693 | } |
| 694 | 694 | // Menu |
| 695 | - if($xml_obj->menus->menu) |
|
| 695 | + if ($xml_obj->menus->menu) |
|
| 696 | 696 | { |
| 697 | 697 | $menus = $xml_obj->menus->menu; |
| 698 | - if(!is_array($menus)) $menus = array($menus); |
|
| 698 | + if (!is_array($menus)) $menus = array($menus); |
|
| 699 | 699 | |
| 700 | 700 | $menu_count = count($menus); |
| 701 | 701 | $buff[] = sprintf('$layout_info->menu_count = "%s";', $menu_count); |
| 702 | - for($i=0;$i<$menu_count;$i++) |
|
| 702 | + for ($i = 0; $i < $menu_count; $i++) |
|
| 703 | 703 | { |
| 704 | 704 | $name = $menus[$i]->attrs->name; |
| 705 | - if($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name); |
|
| 706 | - $buff[] = sprintf('$layout_info->menu->%s->name = "%s";',$name, $name); |
|
| 707 | - $buff[] = sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body); |
|
| 708 | - $buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->maxdepth->body); |
|
| 705 | + if ($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name); |
|
| 706 | + $buff[] = sprintf('$layout_info->menu->%s->name = "%s";', $name, $name); |
|
| 707 | + $buff[] = sprintf('$layout_info->menu->%s->title = "%s";', $name, $menus[$i]->title->body); |
|
| 708 | + $buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";', $name, $menus[$i]->maxdepth->body); |
|
| 709 | 709 | $buff[] = sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name); |
| 710 | - $buff[] = sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name); |
|
| 711 | - $buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name); |
|
| 710 | + $buff[] = sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";', $name, $name); |
|
| 711 | + $buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";', $name, $name); |
|
| 712 | 712 | } |
| 713 | 713 | } |
| 714 | 714 | } |
@@ -718,15 +718,15 @@ discard block |
||
| 718 | 718 | $layout_config = $oModuleModel->getModulePartConfig('layout', $layout_srl); |
| 719 | 719 | $header_script = trim($layout_config->header_script); |
| 720 | 720 | |
| 721 | - if($header_script) |
|
| 721 | + if ($header_script) |
|
| 722 | 722 | { |
| 723 | 723 | $buff[] = sprintf(' $layout_info->header_script = %s; ', var_export($header_script, true)); |
| 724 | 724 | } |
| 725 | 725 | |
| 726 | - FileHandler::writeFile($cache_file, '<?php if(!defined("__XE__")) exit(); ' . join(PHP_EOL, $buff)); |
|
| 727 | - if(FileHandler::exists($cache_file)) include($cache_file); |
|
| 726 | + FileHandler::writeFile($cache_file, '<?php if(!defined("__XE__")) exit(); '.join(PHP_EOL, $buff)); |
|
| 727 | + if (FileHandler::exists($cache_file)) include($cache_file); |
|
| 728 | 728 | |
| 729 | - if(!$layout_info->title) |
|
| 729 | + if (!$layout_info->title) |
|
| 730 | 730 | { |
| 731 | 731 | $layout_info->title = $layout; |
| 732 | 732 | } |
@@ -750,12 +750,12 @@ discard block |
||
| 750 | 750 | * @param string $layout_name |
| 751 | 751 | * @return array |
| 752 | 752 | */ |
| 753 | - function getUserLayoutIniConfig($layout_srl, $layout_name=null) |
|
| 753 | + function getUserLayoutIniConfig($layout_srl, $layout_name = null) |
|
| 754 | 754 | { |
| 755 | 755 | $file = $this->getUserLayoutIni($layout_srl); |
| 756 | - if($layout_name && FileHandler::exists($file) === FALSE) |
|
| 756 | + if ($layout_name && FileHandler::exists($file) === FALSE) |
|
| 757 | 757 | { |
| 758 | - FileHandler::copyFile($this->getDefaultLayoutIni($layout_name),$this->getUserLayoutIni($layout_srl)); |
|
| 758 | + FileHandler::copyFile($this->getDefaultLayoutIni($layout_name), $this->getUserLayoutIni($layout_srl)); |
|
| 759 | 759 | } |
| 760 | 760 | |
| 761 | 761 | return FileHandler::readIniFile($file); |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | */ |
| 769 | 769 | function getUserLayoutPath($layout_srl) |
| 770 | 770 | { |
| 771 | - return sprintf("./files/faceOff/%s", getNumberingPath($layout_srl,3)); |
|
| 771 | + return sprintf("./files/faceOff/%s", getNumberingPath($layout_srl, 3)); |
|
| 772 | 772 | } |
| 773 | 773 | |
| 774 | 774 | /** |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | */ |
| 779 | 779 | function getUserLayoutImagePath($layout_srl) |
| 780 | 780 | { |
| 781 | - return $this->getUserLayoutPath($layout_srl). 'images/'; |
|
| 781 | + return $this->getUserLayoutPath($layout_srl).'images/'; |
|
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | /** |
@@ -788,7 +788,7 @@ discard block |
||
| 788 | 788 | */ |
| 789 | 789 | function getUserLayoutCss($layout_srl) |
| 790 | 790 | { |
| 791 | - return $this->getUserLayoutPath($layout_srl). 'layout.css'; |
|
| 791 | + return $this->getUserLayoutPath($layout_srl).'layout.css'; |
|
| 792 | 792 | } |
| 793 | 793 | |
| 794 | 794 | /** |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | */ |
| 799 | 799 | function getUserLayoutFaceOffCss($layout_srl) |
| 800 | 800 | { |
| 801 | - if($this->useUserLayoutTemp == 'temp') return; |
|
| 801 | + if ($this->useUserLayoutTemp == 'temp') return; |
|
| 802 | 802 | return $this->_getUserLayoutFaceOffCss($layout_srl); |
| 803 | 803 | } |
| 804 | 804 | |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | */ |
| 810 | 810 | function _getUserLayoutFaceOffCss($layout_srl) |
| 811 | 811 | { |
| 812 | - return $this->getUserLayoutPath($layout_srl). 'faceoff.css'; |
|
| 812 | + return $this->getUserLayoutPath($layout_srl).'faceoff.css'; |
|
| 813 | 813 | } |
| 814 | 814 | |
| 815 | 815 | /** |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | */ |
| 820 | 820 | function getUserLayoutTempFaceOffCss($layout_srl) |
| 821 | 821 | { |
| 822 | - return $this->getUserLayoutPath($layout_srl). 'tmp.faceoff.css'; |
|
| 822 | + return $this->getUserLayoutPath($layout_srl).'tmp.faceoff.css'; |
|
| 823 | 823 | } |
| 824 | 824 | |
| 825 | 825 | /** |
@@ -829,11 +829,11 @@ discard block |
||
| 829 | 829 | */ |
| 830 | 830 | function getUserLayoutHtml($layout_srl) |
| 831 | 831 | { |
| 832 | - $src = $this->getUserLayoutPath($layout_srl). 'layout.html'; |
|
| 833 | - if($this->useUserLayoutTemp == 'temp') |
|
| 832 | + $src = $this->getUserLayoutPath($layout_srl).'layout.html'; |
|
| 833 | + if ($this->useUserLayoutTemp == 'temp') |
|
| 834 | 834 | { |
| 835 | 835 | $temp = $this->getUserLayoutTempHtml($layout_srl); |
| 836 | - if(FileHandler::exists($temp) === FALSE) FileHandler::copyFile($src,$temp); |
|
| 836 | + if (FileHandler::exists($temp) === FALSE) FileHandler::copyFile($src, $temp); |
|
| 837 | 837 | return $temp; |
| 838 | 838 | } |
| 839 | 839 | |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | */ |
| 848 | 848 | function getUserLayoutTempHtml($layout_srl) |
| 849 | 849 | { |
| 850 | - return $this->getUserLayoutPath($layout_srl). 'tmp.layout.html'; |
|
| 850 | + return $this->getUserLayoutPath($layout_srl).'tmp.layout.html'; |
|
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | /** |
@@ -857,11 +857,11 @@ discard block |
||
| 857 | 857 | */ |
| 858 | 858 | function getUserLayoutIni($layout_srl) |
| 859 | 859 | { |
| 860 | - $src = $this->getUserLayoutPath($layout_srl). 'layout.ini'; |
|
| 861 | - if($this->useUserLayoutTemp == 'temp') |
|
| 860 | + $src = $this->getUserLayoutPath($layout_srl).'layout.ini'; |
|
| 861 | + if ($this->useUserLayoutTemp == 'temp') |
|
| 862 | 862 | { |
| 863 | 863 | $temp = $this->getUserLayoutTempIni($layout_srl); |
| 864 | - if(!file_exists(FileHandler::getRealPath($temp))) FileHandler::copyFile($src,$temp); |
|
| 864 | + if (!file_exists(FileHandler::getRealPath($temp))) FileHandler::copyFile($src, $temp); |
|
| 865 | 865 | return $temp; |
| 866 | 866 | } |
| 867 | 867 | |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | */ |
| 876 | 876 | function getUserLayoutTempIni($layout_srl) |
| 877 | 877 | { |
| 878 | - return $this->getUserLayoutPath($layout_srl). 'tmp.layout.ini'; |
|
| 878 | + return $this->getUserLayoutPath($layout_srl).'tmp.layout.ini'; |
|
| 879 | 879 | } |
| 880 | 880 | |
| 881 | 881 | /** |
@@ -885,9 +885,9 @@ discard block |
||
| 885 | 885 | * @param string $lang_type |
| 886 | 886 | * @return string |
| 887 | 887 | */ |
| 888 | - function getUserLayoutCache($layout_srl,$lang_type) |
|
| 888 | + function getUserLayoutCache($layout_srl, $lang_type) |
|
| 889 | 889 | { |
| 890 | - return $this->getUserLayoutPath($layout_srl). "{$lang_type}.cache.php"; |
|
| 890 | + return $this->getUserLayoutPath($layout_srl)."{$lang_type}.cache.php"; |
|
| 891 | 891 | } |
| 892 | 892 | |
| 893 | 893 | /** |
@@ -896,15 +896,15 @@ discard block |
||
| 896 | 896 | * @param string $lang_type |
| 897 | 897 | * @return string |
| 898 | 898 | */ |
| 899 | - function getLayoutCache($layout_name,$lang_type,$layout_type='P') |
|
| 899 | + function getLayoutCache($layout_name, $lang_type, $layout_type = 'P') |
|
| 900 | 900 | { |
| 901 | - if($layout_type=='P') |
|
| 901 | + if ($layout_type == 'P') |
|
| 902 | 902 | { |
| 903 | - return sprintf("%sfiles/cache/layout/%s.%s.cache.php", _XE_PATH_, $layout_name,$lang_type); |
|
| 903 | + return sprintf("%sfiles/cache/layout/%s.%s.cache.php", _XE_PATH_, $layout_name, $lang_type); |
|
| 904 | 904 | } |
| 905 | 905 | else |
| 906 | 906 | { |
| 907 | - return sprintf("%sfiles/cache/layout/m.%s.%s.cache.php", _XE_PATH_, $layout_name,$lang_type); |
|
| 907 | + return sprintf("%sfiles/cache/layout/m.%s.%s.cache.php", _XE_PATH_, $layout_name, $lang_type); |
|
| 908 | 908 | } |
| 909 | 909 | } |
| 910 | 910 | |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | */ |
| 916 | 916 | function getDefaultLayoutIni($layout_name) |
| 917 | 917 | { |
| 918 | - return $this->getDefaultLayoutPath($layout_name). 'layout.ini'; |
|
| 918 | + return $this->getDefaultLayoutPath($layout_name).'layout.ini'; |
|
| 919 | 919 | } |
| 920 | 920 | |
| 921 | 921 | /** |
@@ -925,7 +925,7 @@ discard block |
||
| 925 | 925 | */ |
| 926 | 926 | function getDefaultLayoutHtml($layout_name) |
| 927 | 927 | { |
| 928 | - return $this->getDefaultLayoutPath($layout_name). 'layout.html'; |
|
| 928 | + return $this->getDefaultLayoutPath($layout_name).'layout.html'; |
|
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | /** |
@@ -935,7 +935,7 @@ discard block |
||
| 935 | 935 | */ |
| 936 | 936 | function getDefaultLayoutCss($layout_name) |
| 937 | 937 | { |
| 938 | - return $this->getDefaultLayoutPath($layout_name). 'css/layout.css'; |
|
| 938 | + return $this->getDefaultLayoutPath($layout_name).'css/layout.css'; |
|
| 939 | 939 | } |
| 940 | 940 | |
| 941 | 941 | /** |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | * @param string $flag (default 'temp') |
| 965 | 965 | * @return void |
| 966 | 966 | */ |
| 967 | - function setUseUserLayoutTemp($flag='temp') |
|
| 967 | + function setUseUserLayoutTemp($flag = 'temp') |
|
| 968 | 968 | { |
| 969 | 969 | $this->useUserLayoutTemp = $flag; |
| 970 | 970 | } |
@@ -998,11 +998,11 @@ discard block |
||
| 998 | 998 | ); |
| 999 | 999 | |
| 1000 | 1000 | $image_path = $this->getUserLayoutImagePath($layout_srl); |
| 1001 | - $image_list = FileHandler::readDir($image_path,'/(.*(?:jpg|jpeg|gif|bmp|png)$)/i'); |
|
| 1001 | + $image_list = FileHandler::readDir($image_path, '/(.*(?:jpg|jpeg|gif|bmp|png)$)/i'); |
|
| 1002 | 1002 | |
| 1003 | - foreach($image_list as $image) |
|
| 1003 | + foreach ($image_list as $image) |
|
| 1004 | 1004 | { |
| 1005 | - $file_list[] = 'images/' . $image; |
|
| 1005 | + $file_list[] = 'images/'.$image; |
|
| 1006 | 1006 | } |
| 1007 | 1007 | return $file_list; |
| 1008 | 1008 | } |
@@ -1020,20 +1020,20 @@ discard block |
||
| 1020 | 1020 | Context::addCSSFile($this->getDefaultLayoutCss($layout_info->layout)); |
| 1021 | 1021 | // CSS generated in the layout manager |
| 1022 | 1022 | $faceoff_layout_css = $this->getUserLayoutFaceOffCss($layout_info->layout_srl); |
| 1023 | - if($faceoff_layout_css) Context::addCSSFile($faceoff_layout_css); |
|
| 1023 | + if ($faceoff_layout_css) Context::addCSSFile($faceoff_layout_css); |
|
| 1024 | 1024 | // CSS output for the widget |
| 1025 | 1025 | Context::loadFile($this->module_path.'/tpl/css/widget.css', true); |
| 1026 | - if($layout_info->extra_var->colorset->value == 'black') Context::loadFile($this->module_path.'/tpl/css/[email protected]', true); |
|
| 1026 | + if ($layout_info->extra_var->colorset->value == 'black') Context::loadFile($this->module_path.'/tpl/css/[email protected]', true); |
|
| 1027 | 1027 | else Context::loadFile($this->module_path.'/tpl/css/[email protected]', true); |
| 1028 | 1028 | // Different page displayed upon user's permission |
| 1029 | 1029 | $logged_info = Context::get('logged_info'); |
| 1030 | 1030 | // Display edit button for faceoff layout |
| 1031 | - if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')===false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) |
|
| 1031 | + if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) |
|
| 1032 | 1032 | { |
| 1033 | - Context::addHtmlFooter('<div class="faceOffManager" style="height: 23px; position: fixed; right: 3px; top: 3px;"><a href="'.getUrl('','mid',Context::get('mid'),'act','dispLayoutAdminLayoutModify','delete_tmp','Y').'">'.Context::getLang('cmd_layout_edit').'</a></div>'); |
|
| 1033 | + Context::addHtmlFooter('<div class="faceOffManager" style="height: 23px; position: fixed; right: 3px; top: 3px;"><a href="'.getUrl('', 'mid', Context::get('mid'), 'act', 'dispLayoutAdminLayoutModify', 'delete_tmp', 'Y').'">'.Context::getLang('cmd_layout_edit').'</a></div>'); |
|
| 1034 | 1034 | } |
| 1035 | 1035 | // Display menu when editing the faceOff page |
| 1036 | - if(Context::get('act')=='dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) |
|
| 1036 | + if (Context::get('act') == 'dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) |
|
| 1037 | 1037 | { |
| 1038 | 1038 | $oTemplate = &TemplateHandler::getInstance(); |
| 1039 | 1039 | Context::addBodyHeader($oTemplate->compile($this->module_path.'/tpl', 'faceoff_layout_menu')); |