Browse Source

c'est vieux .... adopter l'installation moderne des tables.

svn/root/tags/v1.2.1
erational@erational.org 3 years ago
parent
commit
d3e206999d
  1. 3
      formulaires/editer_rssarticle.php
  2. 10
      paquet.xml
  3. 63
      rssarticle_administrations.php

3
formulaires/editer_rssarticle.php

@ -17,8 +17,9 @@ function formulaires_editer_rssarticle_charger_dist($id_syndic='new', $retour=''
$valeurs['id_syndic'] = $id_syndic;
$valeurs['editable'] = true;
if (!autoriser('modifier', 'syndic', $id_syndic))
if (!autoriser('modifier', 'syndic', $id_syndic)) {
$valeurs['editable'] = false;
}
return $valeurs;
}

10
paquet.xml

@ -1,20 +1,22 @@
<paquet
prefix="rssarticle"
categorie="edition"
version="1.1.7"
version="1.2.0"
etat="stable"
compatibilite="[3.0.2;3.2.*]"
compatibilite="[3.2.0;3.2.*]"
logo="prive/themes/spip/images/rssarticle-64.png"
documentation="https://contrib.spip.net/Flux-RSS-en-articles"
schema="1.0.0"
schema="1.1.0"
>
<nom>Flux RSS en articles</nom>
<auteur lien='https://www.erational.org'>erational</auteur>
<auteur>LudoRA</auteur>
<licence>GNU/GPL v3</licence>
<licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL 3</licence>
<pipeline nom="declarer_tables_principales" inclure="base/rssarticle.php"/>
<pipeline nom="declarer_tables_interfaces" inclure="base/rssarticle.php"/>
<pipeline nom="declarer_tables_auxiliaires" inclure="base/rssarticle.php"/>
<pipeline nom="taches_generales_cron" inclure="rssarticle_pipelines.php"/>
<pipeline nom="affiche_milieu" inclure="rssarticle_pipelines.php"/>
<menu nom="configurer_rssarticle" titre="rssarticle:configuration_rssarticle" parent="menu_configuration" icone="images/rssarticle-16.png" />

63
rssarticle_administrations.php

@ -4,58 +4,31 @@ if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
$GLOBALS['rssarticle_base_version'] = 0.3;
function rssarticle_upgrade(){
$version_base = $GLOBALS['rssarticle_base_version'];
$current_version = 0.0;
if ((!isset($GLOBALS['meta']['rssarticle_base_version']) )
|| (($current_version = $GLOBALS['meta']['rssarticle_base_version'])!=$version_base)){
include_spip('base/rssarticle');
if ($current_version==0.0){
include_spip('base/create');
include_spip('base/abstract_sql');
creer_base();
maj_tables('spip_syndic');
echo "<p>"._T('rssarticle:install_rssarticle')."</p>";
ecrire_meta('rssarticle_base_version',$current_version=$version_base,'non');
}
if (version_compare($current_version,"0.3","<")){
include_spip('base/create');
maj_tables('spip_syndic');
echo "<p>"._T('rssarticle:mise_a_jour_v03')."</p>";
ecrire_meta('rssarticle_base_version',$current_version="0.3",'non');
}
ecrire_metas();
}
}
/**
* Installation/maj du plugin rssarticle
*
* @param string $nom_meta_base_version
* @param string $version_cible
*/
function rssarticle_upgrade($nom_meta_base_version, $version_cible) {
$maj = array();
$maj['create'] = array(
array('sql_alter', 'TABLE spip_syndic ADD rssarticle varchar(3) DEFAULT "non" NOT NULL'),
);
function rssarticle_install($action){
$version_base = $GLOBALS['rssarticle_base_version'];
switch ($action){
case 'test':
return (isset($GLOBALS['meta']['rssarticle_base_version']) AND ($GLOBALS['meta']['rssarticle_base_version']>=$version_base));
break;
case 'install':
rssarticle_upgrade();
break;
case 'uninstall':
rssarticle_vider_tables();
break;
}
include_spip('base/upgrade');
maj_plugin($nom_meta_base_version, $version_cible, $maj);
}
/**
* Desinstallation du plugin
* Desinstallation du plugin rssarticle
*
* @param string $nom_meta_base_version
*/
function rssarticle_vider_tables() {
sql_alter("TABLE spip_syndic DROP rssarticle");
spip_query("DROP TABLE spip_articles_syndic");
effacer_meta('rssarticle_base_version');
ecrire_metas();
function rssarticle_vider_tables($nom_meta_base_version) {
sql_alter("TABLE spip_syndic DROP COLUMN rssarticle");
effacer_meta($nom_meta_base_version);
}

Loading…
Cancel
Save