@@ 56-112 (lines=57) @@ | ||
53 | $module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array(); |
|
54 | $site_module_info = Context::get('site_module_info'); |
|
55 | // List URLs if a type is RSS |
|
56 | if($args->content_type == 'rss') |
|
57 | { |
|
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++) |
|
61 | { |
|
62 | if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
63 | } |
|
64 | // Get module information after listing module_srls if the module is not RSS |
|
65 | } |
|
66 | else |
|
67 | { |
|
68 | $obj = new stdClass(); |
|
69 | // Apply to all modules in the site if a target module is not specified |
|
70 | if(!$args->module_srls) |
|
71 | { |
|
72 | $obj->site_srl = (int)$site_module_info->site_srl; |
|
73 | $output = executeQueryArray('widgets.content.getMids', $obj); |
|
74 | if($output->data) |
|
75 | { |
|
76 | foreach($output->data as $key => $val) |
|
77 | { |
|
78 | $args->modules_info[$val->mid] = $val; |
|
79 | $args->module_srls_info[$val->module_srl] = $val; |
|
80 | $args->mid_lists[$val->module_srl] = $val->mid; |
|
81 | $module_srls[] = $val->module_srl; |
|
82 | } |
|
83 | } |
|
84 | ||
85 | $args->modules_info = $oModuleModel->getMidList($obj); |
|
86 | // Apply to the module only if a target module is specified |
|
87 | } |
|
88 | else |
|
89 | { |
|
90 | $obj->module_srls = $args->module_srls; |
|
91 | $output = executeQueryArray('widgets.content.getMids', $obj); |
|
92 | if($output->data) |
|
93 | { |
|
94 | foreach($output->data as $key => $val) |
|
95 | { |
|
96 | $args->modules_info[$val->mid] = $val; |
|
97 | $args->module_srls_info[$val->module_srl] = $val; |
|
98 | $module_srls[] = $val->module_srl; |
|
99 | } |
|
100 | $idx = explode(',',$args->module_srls); |
|
101 | for($i=0,$c=count($idx);$i<$c;$i++) |
|
102 | { |
|
103 | $srl = $idx[$i]; |
|
104 | if(!$args->module_srls_info[$srl]) continue; |
|
105 | $args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid; |
|
106 | } |
|
107 | } |
|
108 | } |
|
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); |
|
112 | } |
|
113 | ||
114 | /** |
|
115 | * Method is separately made because content extraction, articles, comments, trackbacks, RSS and other elements exist |
@@ 40-96 (lines=57) @@ | ||
37 | $module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array(); |
|
38 | $site_module_info = Context::get('site_module_info'); |
|
39 | // List URLs if a type is RSS |
|
40 | if($args->content_type == 'rss') |
|
41 | { |
|
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++) |
|
45 | { |
|
46 | if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
47 | } |
|
48 | // Get module information after listing module_srls if the module is not RSS |
|
49 | } |
|
50 | else |
|
51 | { |
|
52 | $obj = new stdClass(); |
|
53 | // Apply to all modules in the site if a target module is not specified |
|
54 | if(!$args->module_srls) |
|
55 | { |
|
56 | $obj->site_srl = (int)$site_module_info->site_srl; |
|
57 | $output = executeQueryArray('widgets.content.getMids', $obj); |
|
58 | if($output->data) |
|
59 | { |
|
60 | foreach($output->data as $key => $val) |
|
61 | { |
|
62 | $args->modules_info[$val->mid] = $val; |
|
63 | $args->module_srls_info[$val->module_srl] = $val; |
|
64 | $args->mid_lists[$val->module_srl] = $val->mid; |
|
65 | $module_srls[] = $val->module_srl; |
|
66 | } |
|
67 | } |
|
68 | ||
69 | $args->modules_info = $oModuleModel->getMidList($obj); |
|
70 | // Apply to the module only if a target module is specified |
|
71 | } |
|
72 | else |
|
73 | { |
|
74 | $obj->module_srls = $args->module_srls; |
|
75 | $output = executeQueryArray('widgets.content.getMids', $obj); |
|
76 | if($output->data) |
|
77 | { |
|
78 | foreach($output->data as $key => $val) |
|
79 | { |
|
80 | $args->modules_info[$val->mid] = $val; |
|
81 | $args->module_srls_info[$val->module_srl] = $val; |
|
82 | $module_srls[] = $val->module_srl; |
|
83 | } |
|
84 | $idx = explode(',',$args->module_srls); |
|
85 | for($i=0,$c=count($idx);$i<$c;$i++) |
|
86 | { |
|
87 | $srl = $idx[$i]; |
|
88 | if(!$args->module_srls_info[$srl]) continue; |
|
89 | $args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid; |
|
90 | } |
|
91 | } |
|
92 | } |
|
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); |
|
96 | } |
|
97 | ||
98 | /** |
|
99 | * Method is separately made because content extraction, articles, comments, trackbacks, RSS and other elements exist |