1 | <?php
|
---|
2 | if(INCLUDED!==true)exit;
|
---|
3 | // ==================== //
|
---|
4 | $pathway_info[] = array('title'=>$lang['components_manage'],'link'=>$com_links['sub_components']);
|
---|
5 | // ==================== //
|
---|
6 |
|
---|
7 | if($_GET['action']=='doupdate'){
|
---|
8 | chmod('core/cache/',0777);
|
---|
9 | chmod('lang/',0777);
|
---|
10 | if ($handle = opendir('components/')) {
|
---|
11 | while (false !== ($file = readdir($handle))) {
|
---|
12 | if ($file != "." && $file != ".." && $file != "Thumbs.db" && $file != "index.html") {
|
---|
13 | $exist_comp[] = $file;
|
---|
14 | }
|
---|
15 | }
|
---|
16 | closedir($handle);
|
---|
17 | }
|
---|
18 | $com_content = array();
|
---|
19 | $tmp_allowed_ext = array();
|
---|
20 | $tmp_mainnav_links = array();
|
---|
21 | foreach($exist_comp as $tmp_comp){
|
---|
22 | @include('components/'.$tmp_comp.'/main.php');
|
---|
23 | // search install lang files
|
---|
24 | foreach($languages as $lang_s=>$lang_name){
|
---|
25 | if(file_exists('components/'.$tmp_comp.'/'.$lang_s.'.'.$lang_name.'.lang')){
|
---|
26 | $langfile = @file_get_contents('lang/'.$lang_s.'.'.$lang_name.'.lang');
|
---|
27 | $langfile = str_replace("\n",'',$langfile);
|
---|
28 | $langfile = str_replace("\r",'',$langfile);
|
---|
29 | $langfile = explode('|=|',$langfile);
|
---|
30 | foreach($langfile as $langstr){
|
---|
31 | $langstra = explode(' :=: ',$langstr);
|
---|
32 | if(isset($langstra[1]))$thislang[$langstra[0]] = $langstra[1];
|
---|
33 | }
|
---|
34 | $langfile = @file_get_contents('components/'.$tmp_comp.'/'.$lang_s.'.'.$lang_name.'.lang');
|
---|
35 | $langfile = str_replace("\n",'',$langfile);
|
---|
36 | $langfile = str_replace("\r",'',$langfile);
|
---|
37 | $langfile = explode('|=|',$langfile);
|
---|
38 | foreach($langfile as $langstr){
|
---|
39 | $langstra = explode(' :=: ',$langstr);
|
---|
40 | if(isset($langstra[1]))$thislang[$langstra[0]] = $langstra[1];
|
---|
41 | }
|
---|
42 | $newlangfile = '';
|
---|
43 | $thislang = array_unique($thislang);
|
---|
44 | foreach($thislang as $key => $val){
|
---|
45 | $newlangfile .= '|=|'.$key.' :=: '.$val."\n";
|
---|
46 | }
|
---|
47 | file_put_contents('lang/'.$lang_s.'.'.$lang_name.'.lang',$newlangfile);
|
---|
48 | unset($newlangfile);
|
---|
49 | }
|
---|
50 | }
|
---|
51 | }
|
---|
52 | foreach ($com_content as $comp_name=>$comp_array){
|
---|
53 | foreach ($comp_array as $comp_members){
|
---|
54 | if($comp_members[3]){
|
---|
55 | $tmp_mainnav_links[$comp_members[3]][] = array($comp_members[1],$comp_members[2],$comp_members[0]);
|
---|
56 | }
|
---|
57 | }
|
---|
58 | $tmp_allowed_ext[] = $comp_name;
|
---|
59 | }
|
---|
60 | ksort($tmp_mainnav_links);
|
---|
61 |
|
---|
62 | $cache_str = "<?php\n";
|
---|
63 | $cache_str .= '$mainnav_links = '.var_export($tmp_mainnav_links,true).';';
|
---|
64 | $cache_str .= "\n\n";
|
---|
65 | $cache_str .= '$allowed_ext = '.var_export($tmp_allowed_ext,true).';';
|
---|
66 | $cache_str .= "?>";
|
---|
67 | file_put_contents('core/cache/comp_cache.php',$cache_str);
|
---|
68 |
|
---|
69 | redirect($com_content['admin']['components'][2],1);
|
---|
70 | }
|
---|
71 | ?>
|
---|