Changeset 22769 for extensions/meta
- Timestamp:
- May 20, 2013, 7:29:15 PM (12 years ago)
- Location:
- extensions/meta
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/meta/admin/admin.php
r21161 r22769 13 13 //-------------------------------------------------------- sections definitions 14 14 15 // Gestion des onglets15 // TAB gest 16 16 if (!isset($_GET['tab'])) 17 17 $page['tab'] = 'gestion'; … … 23 23 l10n('meta_onglet_gestion'), 24 24 $my_base_url.'&tab=gestion'); 25 $tabsheet->add('Personal Meta', 26 l10n('Personal Metadata'), 27 $my_base_url.'&tab=persometa'); 25 28 $tabsheet->add('description', 26 29 l10n('meta_onglet_description'), … … 29 32 $tabsheet->assign(); 30 33 31 // Onglet gestion des meta34 // Tab gest 32 35 switch ($page['tab']) 33 36 { 34 37 case 'gestion': 35 38 36 // charge la liste des meta39 //read metadata list 37 40 $groups = array(); 38 41 $query = ' … … 64 67 65 68 66 //edit demeta69 //edit meta 67 70 if (isset($_POST['submitchoixmeta']) and is_numeric($_POST['metalist']) and (!$_POST['metalist'])==0 and !is_adviser()) 68 71 { … … 90 93 } 91 94 92 //ins értion de meta dans latable93 if (isset($_POST['submitinsmeta']) and !is_adviser())95 //inser metadata in table 96 if (isset($_POST['submitinsmeta'])) 94 97 { 95 98 $query = ' … … 103 106 break; 104 107 105 // Onglet description108 //description TAB 106 109 case 'description': 107 110 … … 113 116 )); 114 117 break; 118 119 // TAB personnal metadata 120 case 'persometa': 121 122 $template->assign( 123 'metapersoT', 124 array( 125 'meta'=>l10n('meta_name'), 126 )); 127 $admin_base_url = $my_base_url.'&tab=persometa'; 128 $metapersos = pwg_query("SELECT * FROM `". METAPERSO_TABLE .";"); 129 130 if (pwg_db_num_rows($metapersos)) { 131 while ($metaperso = pwg_db_fetch_assoc($metapersos)) 132 { 133 $items = array( 134 'METANAME' => $metaperso['metaname'], 135 'METAVAL' => $metaperso['metaval'], 136 'METATYPE' => $metaperso['metatype'], 137 'U_DELETE' => $admin_base_url.'&delete='.$metaperso['id'], 138 'U_EDIT' => $admin_base_url.'&edit='.$metaperso['id'], 139 ); 140 141 $template->append('metapersos', $items); 142 } 143 } 144 if (isset($_POST['submitaddpersonalmeta'])) 145 { 146 $template->assign( 147 'meta_edit2', 148 array( 149 'meta'=>l10n('meta_name'), 150 'METAID' => 0, 151 )); 152 } 153 154 if (isset($_POST['submitaddmetaperso'])) 155 { 156 $query = ' 157 DELETE 158 FROM ' . METAPERSO_TABLE . ' 159 WHERE id = '.$_POST['invisibleID'].' 160 ;'; 161 $result = pwg_query($query); 162 163 164 $q = ' 165 INSERT INTO ' . $prefixeTable . 'metaperso(metaname,metaval,metatype)VALUES ("'.$_POST['insername'].'","'.$_POST['inserval'].'","'.$_POST['insertype'].'");'; 166 pwg_query($q); 167 $_SESSION['page_infos'] = array(l10n('Personal metadata update')); 168 redirect($admin_base_url); 169 } 170 171 if (isset($_GET['edit'])) 172 { 173 check_input_parameter('edit', $_GET, false, PATTERN_ID); 174 175 $query = ' 176 select id,metaname,metaval,metatype 177 FROM ' . METAPERSO_TABLE . ' 178 WHERE id = \''.$_GET['edit'].'\' 179 ;'; 180 $result = pwg_query($query); 181 $row = pwg_db_fetch_assoc($result); 182 $template->assign( 183 'meta_edit2', 184 array( 185 'METAID' => $row['id'], 186 'METANAME' => $row['metaname'], 187 'METAVAL' => $row['metaval'], 188 'METATYPE' => $row['metatype'], 189 )); 190 191 } 192 193 if (isset($_GET['delete'])) 194 { 195 check_input_parameter('delete', $_GET, false, PATTERN_ID); 196 197 $query = ' 198 DELETE 199 FROM '.METAPERSO_TABLE.' 200 WHERE id = '.$_GET['delete'].' 201 ;'; 202 pwg_query($query); 203 204 $_SESSION['page_infos'] = array(l10n('Personal metadata update')); 205 redirect($admin_base_url); 206 } 207 208 209 break; 210 115 211 116 212 } -
extensions/meta/admin/admin.tpl
r9406 r22769 54 54 </div> 55 55 {/if} 56 {if isset ($MAJ)} 57 <div class="comment"> 58 <div style="text-align:center;"> 59 <input class="submit" name="submitMAJ" type="submit" value="{'meta_onglet_maj'|@translate}" {$TAG_INPUT_ENABLED} /> 60 </div> 61 </div> 56 {if isset ($metapersoT)} 57 <form method="post" > 58 <fieldset> 59 <input class="submit" name="submitaddpersonalmeta" type="submit" value="{'Add Personal metadata'|@translate}" {$TAG_INPUT_ENABLED} /> 60 </fieldset> 61 </form> 62 <form method="post" > 63 <fieldset> 64 <legend>{'List Personal Metadata'|@translate}</legend> 65 {foreach from=$metapersos item=metaperso} 66 < meta {$metaperso.METATYPE}="{$metaperso.METANAME}" content="{$metaperso.METAVAL}"> 67 <a href="{$metaperso.U_EDIT}"> 68 <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" alt="{'edit'|@translate}" title="{'edit'|@translate}" /> 69 </a> 70 <a href="{$metaperso.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');"> 71 <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" id="btn_delete" alt="{'delete'|@translate}" title="{'Delete'|@translate}" /> 72 </a> 73 <br> 74 {/foreach} 75 </fieldset> 76 </form> 77 {if isset ($meta_edit2)} 78 <form method="post" > 79 <fieldset> 80 <legend>{'Personnal metadata'|@translate}</legend> 81 <input type="hidden" name="invisibleID" value="{$meta_edit2.METAID}"> 82 < meta <input type="text" name="insertype" value="{$meta_edit2.METATYPE}" size="30" maxlenght="30"> ="<input type="text" name="insername" value="{$meta_edit2.METANAME}" size="30" maxlenght="30">" content="<input type="text" name="inserval" value="{$meta_edit2.METAVAL}" size="60" maxlenght="100">"> 83 <br> 84 <br> 85 <div style="text-align:center;"> 86 <input class="submit" name="submitaddmetaperso" type="submit" value="{'Submit'|@translate}" {$TAG_INPUT_ENABLED} /> 87 </div> 88 </fieldset> 89 </form> 90 {/if} 62 91 {/if} -
extensions/meta/initadmin.php
r21161 r22769 7 7 function meta_admin_menu($menu) 8 8 { 9 load_language('plugin.lang', meta_PATH); 9 10 array_push($menu, array( 10 'NAME' => 'Meta',11 'NAME' => l10n('Manage tag Metadata'), 11 12 'URL' => get_admin_plugin_menu_link(meta_PATH . 'admin/admin.php'))); 12 13 return $menu; -
extensions/meta/language/en_UK/plugin.lang.php
r10233 r22769 1 1 <?php 2 3 $lang['Manage tag Metadata'] = 'Manage tag Metadata'; 2 4 3 5 //tab gest … … 26 28 $lang['meta_onglet_description'] = 'Description Metadata'; 27 29 $lang['meta_author'] = 'Description meta author'; 28 $lang['meta_author_help'] = 'Information on the author <br> 29 Information on the author of the site '; 30 $lang['meta_author_help'] = 'Information on the author <br> Information on the author of the site '; 30 31 $lang['meta_keywords'] = 'Description meta keywords'; 31 $lang['meta_keywords_help'] = '"Keyword, keyword, etc."<br> 32 Keywords describing the web page. (Separated by a comma)'; 32 $lang['meta_keywords_help'] = '"Keyword, keyword, etc."<br> Keywords describing the web page. (Separated by a comma)'; 33 33 $lang['meta_Description'] = 'Description meta Description'; 34 $lang['meta_Description_help'] = 'Description of your site<br> 35 Allows to give an information to post during the result of a search'; 34 $lang['meta_Description_help'] = 'Description of your site<br> Allows to give an information to post during the result of a search'; 36 35 $lang['meta_robots'] = 'Description meta robots'; 37 $lang['meta_robots_help'] = ' 38 all : Allows the robot to reference all the page (by default)<br> 39 follow : Allows the robot to follow the links of the page<br> 40 index : Allows the robot to index the page<br> 41 nofollow : Forbidden the robot to follow the links<br> 42 noindex : Forbidden the robot to index the page<br> 43 none : Prevent the robot from pursuing the indexation of the site<br> 44 '; 36 $lang['meta_robots_help'] = 'all : Allows the robot to reference all the page (by default)<br> follow : Allows the robot to follow the links of the page<br> index : Allows the robot to index the page<br> nofollow : Forbidden the robot to follow the links<br> noindex : Forbidden the robot to index the page<br> none : Prevent the robot from pursuing the indexation of the site<br>'; 37 38 //tab personal meta 39 $lang['Personal Metadata'] = 'Personal Metadata'; 40 $lang['Personal metadata update'] = 'Personal metadata update'; 41 $lang['Add Personal metadata'] = 'Add Personal metadata'; 42 $lang['List Personal Metadata'] = 'List Personal Metadata'; 43 45 44 ?> -
extensions/meta/language/fr_FR/plugin.lang.php
r10233 r22769 1 1 <?php 2 3 $lang['Manage tag Metadata'] = 'Gèrer balises Metadonnées'; 2 4 3 5 //tab gest … … 26 28 $lang['meta_onglet_description'] = 'Description des Metadonnées'; 27 29 $lang['meta_author'] = 'Description de meta author'; 28 $lang['meta_author_help'] = 'Informations sur l\'auteur<br> 29 Informations sur l\'auteur du site'; 30 $lang['meta_author_help'] = 'Informations sur l\'auteur<br> Informations sur l\'auteur du site'; 30 31 $lang['meta_keywords'] = 'Description de meta keywords'; 31 $lang['meta_keywords_help'] = '"mot clé, mot clé, etc."<br> 32 Mots clés décrivant la page Web.(séparé par une virgule)'; 32 $lang['meta_keywords_help'] = '"mot clé, mot clé, etc."<br> Mots clés décrivant la page Web.(séparé par une virgule)'; 33 33 $lang['meta_Description'] = 'Description de meta Description'; 34 $lang['meta_Description_help'] = 'Description de votre site<br> 35 Permet de donner une information à afficher lors du résultat d\'une recherche.'; 34 $lang['meta_Description_help'] = 'Description de votre site<br> Permet de donner une information à afficher lors du résultat d\'une recherche.'; 36 35 $lang['meta_robots'] = 'Description de meta robots'; 37 $lang['meta_robots_help'] = ' 38 all : Permet au robot de référencer toute la page (par défaut)<br> 39 follow : Permet au robot de suivre les liens de la page<br> 40 index : Permet au robot d\'indexer la page<br> 41 nofollow : Interdit au robot de suivre les liens<br> 42 noindex : Interdit au robot d\'indexer la page<br> 43 none : Empêche le robot de poursuivre l\'indexation du site<br> 44 '; 36 $lang['meta_robots_help'] = 'all : Permet au robot de référencer toute la page (par défaut)<br> follow : Permet au robot de suivre les liens de la page<br> index : Permet au robot d\'indexer la page<br> nofollow : Interdit au robot de suivre les liens<br> noindex : Interdit au robot d\'indexer la page<br> none : Empêche le robot de poursuivre l\'indexation du site<br> '; 37 38 //tab personal meta 39 $lang['Personal Metadata'] = 'Metadonnées Personels'; 40 $lang['Personal metadata update'] = 'Metadonnées Personels Misent à jours'; 41 $lang['Add Personal metadata'] = 'Ajoutez des Metadonnées Personels'; 42 $lang['List Personal Metadata'] = 'Liste des Metadonnées Personels'; 43 45 44 46 45 ?> -
extensions/meta/main.inc.php
r21161 r22769 18 18 define('meta_img_TABLE' , $prefixeTable . 'meta_img'); 19 19 define('meta_cat_TABLE' , $prefixeTable . 'meta_cat'); 20 define('METAPERSO_TABLE', $prefixeTable.'metaperso'); 20 21 21 22 // Plugin for admin … … 110 111 $template->append('head_elements', '<meta name="robots" content="'.$meta['robots'].'">'); 111 112 } 112 113 114 //Metaperso 115 if (script_basename() !== 'admin') 116 { 117 $metapersos = pwg_query("SELECT * FROM `". METAPERSO_TABLE .";"); 118 119 if (pwg_db_num_rows($metapersos)) { 120 while ($metaperso = pwg_db_fetch_assoc($metapersos)) 121 { 122 $items = array( 123 'METANAME' => $metaperso['metaname'], 124 'METAVAL' => $metaperso['metaval'], 125 'METATYPE' => $metaperso['metatype'] 126 ); 127 128 $template->append('metapersos', $items); 129 } 130 131 132 } 133 134 $template->set_filename('PERSO_META', realpath(meta_PATH.'persometa.tpl')); 135 $template->append('head_elements', $template->parse('PERSO_META', true)); 136 } 137 113 138 } 114 139 function add_metacat() -
extensions/meta/maintain.inc.php
r21161 r22769 11 11 define('meta_img_TABLE' , $prefixeTable . 'meta_img'); 12 12 define('meta_cat_TABLE' , $prefixeTable . 'meta_cat'); 13 define('METAPERSO_TABLE', $prefixeTable.'metaperso'); 14 15 $query = "CREATE TABLE IF NOT EXISTS ". METAPERSO_TABLE ." ( 16 id SMALLINT( 5 ) UNSIGNED NOT NULL auto_increment, 17 metaname VARCHAR( 255 ) NOT NULL , 18 metaval lONGTEXT NOT NULL , 19 metatype VARCHAR( 255 ) NOT NULL , 20 PRIMARY KEY (id))DEFAULT CHARSET=utf8;"; 21 $result = pwg_query($query); 13 22 14 23 //Gestion MAJ2 … … 156 165 PRIMARY KEY (id))DEFAULT CHARSET=utf8;"; 157 166 $result = pwg_query($query); 167 168 if (!defined('METAPERSO_TABLE')) define('METAPERSO_TABLE', $prefixeTable.'metaperso'); 169 $query = "CREATE TABLE IF NOT EXISTS ". METAPERSO_TABLE ." ( 170 id SMALLINT( 5 ) UNSIGNED NOT NULL auto_increment, 171 metaname VARCHAR( 255 ) NOT NULL , 172 metaval lONGTEXT NOT NULL , 173 metatype VARCHAR( 255 ) NOT NULL , 174 PRIMARY KEY (id))DEFAULT CHARSET=utf8;"; 175 $result = pwg_query($query); 158 176 159 177 $majm1='meta 2.0.5';
Note: See TracChangeset
for help on using the changeset viewer.