Ignore:
Timestamp:
Aug 21, 2019 7:44:47 PM (6 years ago)
Author:
anonymous
Message:

use localstorage to store/restore settings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/testa/php/content.php

    r23 r25  
    99require_once( dirname(__FILE__) . '/NorthernCross/ns/PathInfo.php');
    1010require_once( dirname(__FILE__) . "/spyc-0.5/spyc.php"); // ★の部分にはspyc.phpを置いたパスを入れます
    11 
    1211
    1312function get_url_data_array()
     
    123122function cmdx(){
    124123    $filelist_filename = "filelist.json";
     124    $setting_filelist_filename = "setting-filelist.json";
    125125    $storage_dir = dirname(__FILE__) . '/../storage';
    126126
     
    132132
    133133            switch ($cmd) {
     134            case 'get_setting_filelist':
     135                $path = ensure_storage_dir( $storage_dir , $num, $setting_filelist_filename );
     136                if( file_exists($path) ){
     137                    $content = input_file( $path );
     138                }
     139                else {
     140                    $content = get_path_info( $num );
     141                    output_file( $path , $content );
     142                }
     143                break;
     144            case 'build':
     145                break;
    134146            case 'get_content':
    135147                if (isset($_GET['path'])) {
     
    146158                $path = ensure_storage_dir( $storage_dir , $num, $filelist_filename );
    147159                if( file_exists($path) ){
    148                     $content = input_file( $filename );
     160                    $content = input_file( $path );
    149161                }
    150162                else {
Note: See TracChangeset for help on using the changeset viewer.