Changeset 3580 for extensions/floPure
- Timestamp:
- Jul 14, 2009, 8:25:08 PM (15 years ago)
- Location:
- extensions/floPure
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/floPure/header.tpl
r3579 r3580 76 76 if (is_admin()) 77 77 { 78 global $template, $ user, $page;78 global $template, $page; 79 79 $header_msgs = array(); 80 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');81 //include_once(PHPWG_ROOT_PATH.'admin/include/plugins.class.php');82 80 include_once(PHPWG_ROOT_PATH.'template/floPure/tools/version.conf.php'); 83 81 include_once(PHPWG_ROOT_PATH.'template/floPure/tools/floPure.class.php'); 84 82 load_language('template.lang', PHPWG_ROOT_PATH.'template/floPure/tools/'); 85 83 $floPure = new floPure(); 86 87 // Retrieve PEM versions 88 $version = PHPWG_VERSION; 89 $versions_to_check = array(); 90 $url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php'; 91 if (fetchRemote($url, $result) and $pem_versions = @unserialize($result)) 92 { 93 if (!preg_match('/^\d+\.\d+\.\d+/', $version)) 94 { 95 $version = $pem_versions[0]['name']; 96 } 97 $branch = substr($version, 0, strrpos($version, '.')); 98 foreach ($pem_versions as $pem_version) 99 { 100 if (strpos($pem_version['name'], $branch) === 0) 101 { 102 $versions_to_check[] = $pem_version['id']; 103 } 104 } 105 } 106 107 // Retrieve PEM template infos 108 $url = PEM_URL . '/api/get_revision_list.php?format=php&last_revision_only=true'; 109 $url .= '&version=' . implode(',', $versions_to_check); 110 //$url .= '&lang=' . substr($user['language'], 0, 2); 111 $url .= '&extension_include=135'; 112 fetchRemote($url, $result); 113 $pem_res = @unserialize($result); 114 foreach($pem_res as $pem_floPure) 115 { 116 if (!is_array($pem_floPure)) 117 { 118 $template->assign( 119 array( 120 'erreur' => 'erreur url : '.$url, 121 ) 122 ); 123 } 124 125 126 if (!$floPure->floPure_version_compare($floPure_conf['version'], $pem_floPure['revision_name'])) 127 { 128 $header_msgs[]=l10n('floPure_update_needed'); 129 } 130 } 131 if (count($header_msgs) > 0) 84 if( $floPure->is_not_up_to_date($floPure_conf['version'], '135') ) 132 85 { 133 $template->assign('header_msgs', $header_msgs); 134 $header_msgs=array(); 86 $template->append('header_msgs', l10n('floPure_update_needed')); 135 87 } 88 $floPure->theme_version_search(PHPWG_ROOT_PATH.'template/floPure/theme'); 136 89 137 90 … … 141 94 {$erreur} 142 95 {$test} 96 {$URL} 97 {foreach from=$test_a item=test_b} 98 {$test_b.A} / {$test_b.B}<br /> 99 {/foreach} 143 100 144 101 {if not empty($header_msgs)} -
extensions/floPure/theme/autumn/themeconf.inc.php
r3333 r3580 8 8 'mime_icon_dir' => 'template/floPure/icon/mimetypes/', 9 9 'local_head' => '<!-- no theme specific head content -->', 10 'eid' => '233', 11 'version' => '1.0.0', 10 12 ); 11 13 ?> -
extensions/floPure/theme/clear_blue/themeconf.inc.php
r3333 r3580 8 8 'mime_icon_dir' => 'template/floPure/icon/mimetypes/', 9 9 'local_head' => '<!-- no theme specific head content -->', 10 'eid' => '143', 11 'version' => '2.0.0', 10 12 ); 11 13 ?> -
extensions/floPure/tools/floPure.class.php
r3579 r3580 11 11 return version_compare($array[0], $array[1], '>='); 12 12 } 13 function theme_version_search($dir) 14 { 15 global $template, $page; 16 load_language('template.lang', PHPWG_ROOT_PATH.'template/floPure/tools/'); 17 $header_msgs = array(); 18 $dh = opendir ($dir); 19 while (($file = readdir ($dh)) !== false ) { 20 if ($file !== '.' && $file !== '..' && $file !== '.svn') { // enleve svn 21 $path =$dir.'/'.$file; 22 if (is_dir($path)) { 23 $this->theme_version_search($path); 24 } 25 else 26 { 27 $page = explode('.', $file); 28 $nb = count($page); 29 $nom_fichier = $page[0]; 30 for ($i = 1; $i < $nb-1; $i++){ 31 $nom_fichier .= '.'.$page[$i]; 32 } 33 if(isset($page[1])){ 34 $ext_fichier = $page[$nb-1]; 35 } 36 else { 37 $ext_fichier = ''; 38 } 39 if($nom_fichier == 'themeconf.inc' and $ext_fichier == 'php') { 40 include($path); 41 if (isset($themeconf['eid'])) 42 { 43 if($this->is_not_up_to_date($themeconf['version'],$themeconf['eid']) ) 44 { 45 46 $msg=l10n('theme_update_needed_1').$themeconf['theme'].l10n('theme_update_needed_2').$themeconf['eid'].l10n('theme_update_needed_3').$themeconf['theme'].l10n('theme_update_needed_4'); 47 $template->append('header_msgs', $msg); 48 } 49 } 50 51 } 52 } 53 } 54 } 55 closedir ($dh); // on ferme le repertoire courant 56 } 57 function is_not_up_to_date($v_local, $eid) 58 { 59 60 global $template, $user, $page; 61 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 62 load_language('template.lang', PHPWG_ROOT_PATH.'template/floPure/tools/'); 63 64 // Retrieve PEM versions 65 $version = PHPWG_VERSION; 66 $versions_to_check = array(); 67 $url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php'; 68 if (fetchRemote($url, $result) and $pem_versions = @unserialize($result)) 69 { 70 if (!preg_match('/^\d+\.\d+\.\d+/', $version)) 71 { 72 $version = $pem_versions[0]['name']; 73 } 74 $branch = substr($version, 0, strrpos($version, '.')); 75 foreach ($pem_versions as $pem_version) 76 { 77 if (strpos($pem_version['name'], $branch) === 0) 78 { 79 $versions_to_check[] = $pem_version['id']; 80 } 81 } 82 } 83 84 // Retrieve PEM template infos 85 $url = PEM_URL . '/api/get_revision_list.php?format=php&last_revision_only=true'; 86 $url .= '&version=' . implode(',', $versions_to_check); 87 //$url .= '&lang=' . substr($user['language'], 0, 2); 88 $url .= '&extension_include='.$eid; 89 fetchRemote($url, $result); 90 $pem_res = @unserialize($result); 91 foreach($pem_res as $pem_floPure) 92 { 93 if (!is_array($pem_floPure)) 94 { 95 $template->assign( 96 array( 97 'erreur' => 'erreur url : '.$url, 98 ) 99 ); 100 } 101 if (!$this->floPure_version_compare($v_local, $pem_floPure['revision_name'])) 102 { 103 return true; 104 } 105 else 106 { 107 return false; 108 } 109 } 110 } 111 13 112 } 14 113 ?> -
extensions/floPure/tools/language/en_UK/template.lang.php
r3579 r3580 2 2 3 3 $lang['floPure_update_needed'] = 'Your version of floPure is not up to date : <a href="http://fr.piwigo.org/ext/extension_view.php?eid=135" title="go to the page of the template" target="_blank" >click here to download the last revision of the template floPure</a>'; 4 4 $lang['theme_update_needed_1'] = 'Le thème '; 5 $lang['theme_update_needed_2'] = ' n\'est pas à jour : <a href="http://fr.piwigo.org/ext/extension_view.php?eid='; 6 $lang['theme_update_needed_3'] = '" title="aller à la mise à jour" target="_blank" >cliquez ici pour accéder à la dernière révision du thème '; 7 $lang['theme_update_needed_4'] = '</a>'; 5 8 ?> -
extensions/floPure/tools/language/fr_FR/template.lang.php
r3579 r3580 2 2 3 3 $lang['floPure_update_needed'] = 'Votre version de floPure n\'est pas à jour : <a href="http://fr.piwigo.org/ext/extension_view.php?eid=135" title="aller à la mise à jour" target="_blank" >cliquez ici pour accéder à la dernière révision du template floPure</a>'; 4 $lang['theme_update_needed_1'] = 'Le thème '; 5 $lang['theme_update_needed_2'] = ' n\'est pas à jour : <a href="http://fr.piwigo.org/ext/extension_view.php?eid='; 6 $lang['theme_update_needed_3'] = '" title="aller à la mise à jour" target="_blank" >cliquez ici pour accéder à la dernière révision du thème '; 7 $lang['theme_update_needed_4'] = '</a>'; 4 8 5 9 ?> -
extensions/floPure/tools/version.conf.php
r3579 r3580 2 2 $floPure_conf = array( 3 3 'name' => 'floPure', 4 'version' => '2. 1.0',4 'version' => '2.0.1', 5 5 ); 6 6
Note: See TracChangeset
for help on using the changeset viewer.