@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | |
@@ -23,12 +23,12 @@ discard block |
||
| 23 | 23 | * @return array |
| 24 | 24 | */ |
| 25 | 25 | function inc_simplexml_to_array_dist($u, $utiliser_namespace = false) { |
| 26 | - // decoder la chaine en SimpleXML si pas deja fait |
|
| 27 | - if (is_string($u)) { |
|
| 28 | - $u = simplexml_load_string($u); |
|
| 29 | - } |
|
| 26 | + // decoder la chaine en SimpleXML si pas deja fait |
|
| 27 | + if (is_string($u)) { |
|
| 28 | + $u = simplexml_load_string($u); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - return array('root' => @xmlObjToArr($u, $utiliser_namespace)); |
|
| 31 | + return array('root' => @xmlObjToArr($u, $utiliser_namespace)); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
@@ -43,66 +43,66 @@ discard block |
||
| 43 | 43 | **/ |
| 44 | 44 | function xmlObjToArr($obj, $utiliser_namespace = false) { |
| 45 | 45 | |
| 46 | - $tableau = array(); |
|
| 46 | + $tableau = array(); |
|
| 47 | 47 | |
| 48 | - // Cette fonction getDocNamespaces() est longue sur de gros xml. On permet donc |
|
| 49 | - // de l'activer ou pas suivant le contenu supposé du XML |
|
| 50 | - if (is_object($obj)) { |
|
| 51 | - if (is_array($utiliser_namespace)) { |
|
| 52 | - $namespace = $utiliser_namespace; |
|
| 53 | - } else { |
|
| 54 | - if ($utiliser_namespace) { |
|
| 55 | - $namespace = $obj->getDocNamespaces(true); |
|
| 56 | - } |
|
| 57 | - $namespace[null] = null; |
|
| 58 | - } |
|
| 48 | + // Cette fonction getDocNamespaces() est longue sur de gros xml. On permet donc |
|
| 49 | + // de l'activer ou pas suivant le contenu supposé du XML |
|
| 50 | + if (is_object($obj)) { |
|
| 51 | + if (is_array($utiliser_namespace)) { |
|
| 52 | + $namespace = $utiliser_namespace; |
|
| 53 | + } else { |
|
| 54 | + if ($utiliser_namespace) { |
|
| 55 | + $namespace = $obj->getDocNamespaces(true); |
|
| 56 | + } |
|
| 57 | + $namespace[null] = null; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - $name = strtolower((string)$obj->getName()); |
|
| 61 | - $text = trim((string)$obj); |
|
| 62 | - if (strlen($text) <= 0) { |
|
| 63 | - $text = null; |
|
| 64 | - } |
|
| 60 | + $name = strtolower((string)$obj->getName()); |
|
| 61 | + $text = trim((string)$obj); |
|
| 62 | + if (strlen($text) <= 0) { |
|
| 63 | + $text = null; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - $children = array(); |
|
| 67 | - $attributes = array(); |
|
| 66 | + $children = array(); |
|
| 67 | + $attributes = array(); |
|
| 68 | 68 | |
| 69 | - // get info for all namespaces |
|
| 70 | - foreach ($namespace as $ns => $nsUrl) { |
|
| 71 | - // attributes |
|
| 72 | - $objAttributes = $obj->attributes($ns, true); |
|
| 73 | - foreach ($objAttributes as $attributeName => $attributeValue) { |
|
| 74 | - $attribName = strtolower(trim((string)$attributeName)); |
|
| 75 | - $attribVal = trim((string)$attributeValue); |
|
| 76 | - if (!empty($ns)) { |
|
| 77 | - $attribName = $ns . ':' . $attribName; |
|
| 78 | - } |
|
| 79 | - $attributes[$attribName] = $attribVal; |
|
| 80 | - } |
|
| 69 | + // get info for all namespaces |
|
| 70 | + foreach ($namespace as $ns => $nsUrl) { |
|
| 71 | + // attributes |
|
| 72 | + $objAttributes = $obj->attributes($ns, true); |
|
| 73 | + foreach ($objAttributes as $attributeName => $attributeValue) { |
|
| 74 | + $attribName = strtolower(trim((string)$attributeName)); |
|
| 75 | + $attribVal = trim((string)$attributeValue); |
|
| 76 | + if (!empty($ns)) { |
|
| 77 | + $attribName = $ns . ':' . $attribName; |
|
| 78 | + } |
|
| 79 | + $attributes[$attribName] = $attribVal; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - // children |
|
| 83 | - $objChildren = $obj->children($ns, true); |
|
| 84 | - foreach ($objChildren as $childName => $child) { |
|
| 85 | - $childName = strtolower((string)$childName); |
|
| 86 | - if (!empty($ns)) { |
|
| 87 | - $childName = $ns . ':' . $childName; |
|
| 88 | - } |
|
| 89 | - $children[$childName][] = xmlObjToArr($child, $namespace); |
|
| 90 | - } |
|
| 91 | - } |
|
| 82 | + // children |
|
| 83 | + $objChildren = $obj->children($ns, true); |
|
| 84 | + foreach ($objChildren as $childName => $child) { |
|
| 85 | + $childName = strtolower((string)$childName); |
|
| 86 | + if (!empty($ns)) { |
|
| 87 | + $childName = $ns . ':' . $childName; |
|
| 88 | + } |
|
| 89 | + $children[$childName][] = xmlObjToArr($child, $namespace); |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - $tableau = array( |
|
| 94 | - 'name' => $name, |
|
| 95 | - ); |
|
| 96 | - if ($text) { |
|
| 97 | - $tableau['text'] = $text; |
|
| 98 | - } |
|
| 99 | - if ($attributes) { |
|
| 100 | - $tableau['attributes'] = $attributes; |
|
| 101 | - } |
|
| 102 | - if ($children) { |
|
| 103 | - $tableau['children'] = $children; |
|
| 104 | - } |
|
| 105 | - } |
|
| 93 | + $tableau = array( |
|
| 94 | + 'name' => $name, |
|
| 95 | + ); |
|
| 96 | + if ($text) { |
|
| 97 | + $tableau['text'] = $text; |
|
| 98 | + } |
|
| 99 | + if ($attributes) { |
|
| 100 | + $tableau['attributes'] = $attributes; |
|
| 101 | + } |
|
| 102 | + if ($children) { |
|
| 103 | + $tableau['children'] = $children; |
|
| 104 | + } |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | - return $tableau; |
|
| 107 | + return $tableau; |
|
| 108 | 108 | } |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | $namespace[null] = null; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - $name = strtolower((string)$obj->getName()); |
|
| 61 | - $text = trim((string)$obj); |
|
| 60 | + $name = strtolower((string) $obj->getName()); |
|
| 61 | + $text = trim((string) $obj); |
|
| 62 | 62 | if (strlen($text) <= 0) { |
| 63 | 63 | $text = null; |
| 64 | 64 | } |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | // attributes |
| 72 | 72 | $objAttributes = $obj->attributes($ns, true); |
| 73 | 73 | foreach ($objAttributes as $attributeName => $attributeValue) { |
| 74 | - $attribName = strtolower(trim((string)$attributeName)); |
|
| 75 | - $attribVal = trim((string)$attributeValue); |
|
| 74 | + $attribName = strtolower(trim((string) $attributeName)); |
|
| 75 | + $attribVal = trim((string) $attributeValue); |
|
| 76 | 76 | if (!empty($ns)) { |
| 77 | - $attribName = $ns . ':' . $attribName; |
|
| 77 | + $attribName = $ns.':'.$attribName; |
|
| 78 | 78 | } |
| 79 | 79 | $attributes[$attribName] = $attribVal; |
| 80 | 80 | } |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | // children |
| 83 | 83 | $objChildren = $obj->children($ns, true); |
| 84 | 84 | foreach ($objChildren as $childName => $child) { |
| 85 | - $childName = strtolower((string)$childName); |
|
| 85 | + $childName = strtolower((string) $childName); |
|
| 86 | 86 | if (!empty($ns)) { |
| 87 | - $childName = $ns . ':' . $childName; |
|
| 87 | + $childName = $ns.':'.$childName; |
|
| 88 | 88 | } |
| 89 | 89 | $children[$childName][] = xmlObjToArr($child, $namespace); |
| 90 | 90 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | include_spip('inc/precharger_objet'); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * Couples clés / valeurs des champs du formulaire à charger. |
| 40 | 40 | **/ |
| 41 | 41 | function inc_precharger_article_dist($id_article, $id_rubrique = 0, $lier_trad = 0) { |
| 42 | - return precharger_objet('article', $id_article, $id_rubrique, $lier_trad, 'titre'); |
|
| 42 | + return precharger_objet('article', $id_article, $id_rubrique, $lier_trad, 'titre'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
@@ -60,5 +60,5 @@ discard block |
||
| 60 | 60 | * Couples clés / valeurs des champs du formulaire à charger |
| 61 | 61 | **/ |
| 62 | 62 | function inc_precharger_traduction_article_dist($id_article, $id_rubrique = 0, $lier_trad = 0) { |
| 63 | - return precharger_traduction_objet('article', $id_article, $id_rubrique, $lier_trad, 'titre'); |
|
| 63 | + return precharger_traduction_objet('article', $id_article, $id_rubrique, $lier_trad, 'titre'); |
|
| 64 | 64 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
@@ -39,29 +39,29 @@ discard block |
||
| 39 | 39 | * Code HTML de la liste |
| 40 | 40 | */ |
| 41 | 41 | function inc_lister_objets_dist($vue, $contexte = array(), $force = false) { |
| 42 | - $res = ""; // debug |
|
| 43 | - if (!is_array($contexte)) { |
|
| 44 | - return _L('$contexte doit etre un tableau dans inc/lister_objets'); |
|
| 45 | - } |
|
| 42 | + $res = ""; // debug |
|
| 43 | + if (!is_array($contexte)) { |
|
| 44 | + return _L('$contexte doit etre un tableau dans inc/lister_objets'); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - $fond = "prive/objets/liste/$vue"; |
|
| 48 | - if (!find_in_path($fond . "." . _EXTENSION_SQUELETTES)) { |
|
| 49 | - // traiter les cas particuliers |
|
| 50 | - include_spip('base/connect_sql'); |
|
| 51 | - $vue = table_objet($vue); |
|
| 52 | - $fond = "prive/objets/liste/$vue"; |
|
| 53 | - if (!find_in_path($fond . "." . _EXTENSION_SQUELETTES)) { |
|
| 54 | - return _L("vue $vue introuvable pour lister les objets"); |
|
| 55 | - } |
|
| 56 | - } |
|
| 47 | + $fond = "prive/objets/liste/$vue"; |
|
| 48 | + if (!find_in_path($fond . "." . _EXTENSION_SQUELETTES)) { |
|
| 49 | + // traiter les cas particuliers |
|
| 50 | + include_spip('base/connect_sql'); |
|
| 51 | + $vue = table_objet($vue); |
|
| 52 | + $fond = "prive/objets/liste/$vue"; |
|
| 53 | + if (!find_in_path($fond . "." . _EXTENSION_SQUELETTES)) { |
|
| 54 | + return _L("vue $vue introuvable pour lister les objets"); |
|
| 55 | + } |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | 58 | |
| 59 | - $contexte['sinon'] = ($force ? $contexte['titre'] : ''); |
|
| 59 | + $contexte['sinon'] = ($force ? $contexte['titre'] : ''); |
|
| 60 | 60 | |
| 61 | - $res = recuperer_fond($fond, $contexte, array('ajax' => true)); |
|
| 62 | - if (_request('var_liste')) { |
|
| 63 | - echo var_export($contexte, true); |
|
| 64 | - } |
|
| 61 | + $res = recuperer_fond($fond, $contexte, array('ajax' => true)); |
|
| 62 | + if (_request('var_liste')) { |
|
| 63 | + echo var_export($contexte, true); |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - return $res; |
|
| 66 | + return $res; |
|
| 67 | 67 | } |
@@ -45,12 +45,12 @@ |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $fond = "prive/objets/liste/$vue"; |
| 48 | - if (!find_in_path($fond . "." . _EXTENSION_SQUELETTES)) { |
|
| 48 | + if (!find_in_path($fond."."._EXTENSION_SQUELETTES)) { |
|
| 49 | 49 | // traiter les cas particuliers |
| 50 | 50 | include_spip('base/connect_sql'); |
| 51 | 51 | $vue = table_objet($vue); |
| 52 | 52 | $fond = "prive/objets/liste/$vue"; |
| 53 | - if (!find_in_path($fond . "." . _EXTENSION_SQUELETTES)) { |
|
| 53 | + if (!find_in_path($fond."."._EXTENSION_SQUELETTES)) { |
|
| 54 | 54 | return _L("vue $vue introuvable pour lister les objets"); |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -29,27 +29,27 @@ discard block |
||
| 29 | 29 | * @param string $titre Inutilisé |
| 30 | 30 | **/ |
| 31 | 31 | function base_delete_all_dist($titre) { |
| 32 | - $delete = _request('delete'); |
|
| 33 | - $res = array(); |
|
| 34 | - if (is_array($delete)) { |
|
| 35 | - foreach ($delete as $table) { |
|
| 36 | - if (sql_drop_table($table)) { |
|
| 37 | - $res[] = $table; |
|
| 38 | - } else { |
|
| 39 | - spip_log("SPIP n'a pas pu detruire $table.", _LOG_ERREUR); |
|
| 40 | - } |
|
| 41 | - } |
|
| 32 | + $delete = _request('delete'); |
|
| 33 | + $res = array(); |
|
| 34 | + if (is_array($delete)) { |
|
| 35 | + foreach ($delete as $table) { |
|
| 36 | + if (sql_drop_table($table)) { |
|
| 37 | + $res[] = $table; |
|
| 38 | + } else { |
|
| 39 | + spip_log("SPIP n'a pas pu detruire $table.", _LOG_ERREUR); |
|
| 40 | + } |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - // un pipeline pour detruire les tables installees par les plugins |
|
| 44 | - pipeline('delete_tables', ''); |
|
| 43 | + // un pipeline pour detruire les tables installees par les plugins |
|
| 44 | + pipeline('delete_tables', ''); |
|
| 45 | 45 | |
| 46 | - spip_unlink(_FILE_CONNECT); |
|
| 47 | - spip_unlink(_FILE_CHMOD); |
|
| 48 | - spip_unlink(_FILE_META); |
|
| 49 | - spip_unlink(_ACCESS_FILE_NAME); |
|
| 50 | - spip_unlink(_CACHE_RUBRIQUES); |
|
| 51 | - } |
|
| 52 | - $d = count($delete); |
|
| 53 | - $r = count($res); |
|
| 54 | - spip_log("Tables detruites: $r sur $d: " . join(', ', $res), _LOG_INFO_IMPORTANTE); |
|
| 46 | + spip_unlink(_FILE_CONNECT); |
|
| 47 | + spip_unlink(_FILE_CHMOD); |
|
| 48 | + spip_unlink(_FILE_META); |
|
| 49 | + spip_unlink(_ACCESS_FILE_NAME); |
|
| 50 | + spip_unlink(_CACHE_RUBRIQUES); |
|
| 51 | + } |
|
| 52 | + $d = count($delete); |
|
| 53 | + $r = count($res); |
|
| 54 | + spip_log("Tables detruites: $r sur $d: " . join(', ', $res), _LOG_INFO_IMPORTANTE); |
|
| 55 | 55 | } |
@@ -51,5 +51,5 @@ |
||
| 51 | 51 | } |
| 52 | 52 | $d = count($delete); |
| 53 | 53 | $r = count($res); |
| 54 | - spip_log("Tables detruites: $r sur $d: " . join(', ', $res), _LOG_INFO_IMPORTANTE); |
|
| 54 | + spip_log("Tables detruites: $r sur $d: ".join(', ', $res), _LOG_INFO_IMPORTANTE); |
|
| 55 | 55 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | **/ |
| 22 | 22 | |
| 23 | 23 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 24 | - return; |
|
| 24 | + return; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | include_spip('base/objets'); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | include_spip('prive/objets/liste/auteurs_fonctions'); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | include_spip('prive/objets/liste/auteurs_fonctions'); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 4 | - return; |
|
| 4 | + return; |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | include_spip('inc/bandeau'); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 4 | - return; |
|
| 4 | + return; |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | include_spip('inc/bandeau'); |