| | 159 | |
| | 160 | /** |
| | 161 | * update from release 1.0.0 |
| | 162 | * |
| | 163 | * - create the /local/plugins/GMaps/kml directory |
| | 164 | * - move kml files from /plugins/GMaps/kml directory to the new directory |
| | 165 | * - remove the /plugins/GMaps/kml directory |
| | 166 | */ |
| | 167 | private function updateFrom_010000() |
| | 168 | { |
| | 169 | mkdir(GPCCore::getPiwigoSystemPath().self::KML_DIRECTORY, 0755, true); |
| | 170 | |
| | 171 | $directory=scandir(GMAPS_PATH.'kml/'); |
| | 172 | foreach($directory as $file) |
| | 173 | { |
| | 174 | $ext=(pathinfo($file, PATHINFO_EXTENSION)); |
| | 175 | if(preg_match('/.*(?:\.kml|\.kmz)$/i', $file)) |
| | 176 | { |
| | 177 | rename(GMAPS_PATH.'kml/'.$file, GPCCore::getPiwigoSystemPath().self::KML_DIRECTORY.$file); |
| | 178 | } |
| | 179 | } |
| | 180 | |
| | 181 | mkdir(GPCCore::getPiwigoSystemPath().self::KML_DIRECTORY); |
| | 182 | |
| | 183 | |
| | 184 | $tablesUpdate=array( |
| | 185 | $this->tables['images_tags'] => array( |
| | 186 | 'zoomLevelMaxActivated' => " ADD COLUMN `zoomLevelMaxActivated` CHAR(1) NOT NULL DEFAULT 'n' AFTER `style` ", |
| | 187 | ) |
| | 188 | ); |
| | 189 | |
| | 190 | $tablef=new GPCTables(array($this->tables['maps'])); |
| | 191 | $tablef->updateTablesFields($tablesUpdate); |
| | 192 | |
| | 193 | unset($tablesUpdate); |
| | 194 | } |
| | 195 | |