From 7b2e48276b2a3ceff83c906d38077f8d0479c3df Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Thu, 18 Oct 2018 01:08:46 +0200 Subject: 2.92 new architecture + quickcss class --- public/index.php | 11 -- public/test.php | 277 ++++++++++++++++++------------ public/test2.php | 84 +++++++++ public/w/article.php | 33 ---- public/w/css/styleadmin.css | 80 --------- public/w/css/stylebase.css | 85 --------- public/w/css/styleedit.css | 250 --------------------------- public/w/css/stylehome.css | 117 ------------- public/w/css/styleinfo.css | 80 --------- public/w/css/stylemedia.css | 103 ----------- public/w/css/stylerecord.css | 79 --------- public/w/home.php | 85 --------- public/w/index.php | 359 +-------------------------------------- public/w/menu.php | 56 ------ public/w/rsc/css/styleadmin.css | 80 +++++++++ public/w/rsc/css/stylebase.css | 85 +++++++++ public/w/rsc/css/styleedit.css | 250 +++++++++++++++++++++++++++ public/w/rsc/css/stylehome.css | 117 +++++++++++++ public/w/rsc/css/styleinfo.css | 80 +++++++++ public/w/rsc/css/stylemedia.css | 103 +++++++++++ public/w/rsc/css/stylerecord.css | 79 +++++++++ 21 files changed, 1051 insertions(+), 1442 deletions(-) delete mode 100644 public/index.php create mode 100644 public/test2.php delete mode 100644 public/w/article.php delete mode 100644 public/w/css/styleadmin.css delete mode 100644 public/w/css/stylebase.css delete mode 100644 public/w/css/styleedit.css delete mode 100644 public/w/css/stylehome.css delete mode 100644 public/w/css/styleinfo.css delete mode 100644 public/w/css/stylemedia.css delete mode 100644 public/w/css/stylerecord.css delete mode 100644 public/w/home.php delete mode 100644 public/w/menu.php create mode 100644 public/w/rsc/css/styleadmin.css create mode 100644 public/w/rsc/css/stylebase.css create mode 100644 public/w/rsc/css/styleedit.css create mode 100644 public/w/rsc/css/stylehome.css create mode 100644 public/w/rsc/css/styleinfo.css create mode 100644 public/w/rsc/css/stylemedia.css create mode 100644 public/w/rsc/css/stylerecord.css (limited to 'public') diff --git a/public/index.php b/public/index.php deleted file mode 100644 index ab7ff55..0000000 --- a/public/index.php +++ /dev/null @@ -1,11 +0,0 @@ - -

Vincent Peugnet

-

W

- -

@

-v.peugnet@free.fr - -

📐

- - - \ No newline at end of file diff --git a/public/test.php b/public/test.php index 6e5e835..aee0004 100644 --- a/public/test.php +++ b/public/test.php @@ -1,119 +1,186 @@ tiTre2:laguerre dqs fdddddddfdfdsfs fdsfdksdfjnsdjkhsf lkfljkfhjldshsf fsdf -fdgfgdfgdfgdsggggggggggggg -dfgdsfgdh -dh - -gh -g -hg -fhhhhhhhhhhhhhhhhhhgfghfghfgh -

-fhfgfgdfgdfgdsggggggggggggg -dfgdsfgdh

-dh
dh
dh
dh
dh
dh
dh
dh
dh
- -gh

-g -hg

-fhhhhhhhhhhhhhhhhhhgfghfghfgh -gh -g -hg -fhhhhhhhhhhhhhhhhhhgfghfghfgh -

-fhfgfgdfgdfgdsggggggggggggg -dfgdsfgdh

-dh
dh
dh
dh
dh
dh
dh
dh
dh
- -gh

-g -hg

-fhhhhhhhhhhhhhhhhhhgfghfghfgh -gh -

YOLO

-

PROUT

-

LOLDELAMORT

-hg -fhhhhhhhhhhhhhhhhhhgfghfghfgh - -

-fhfgfgdfgdfgdsggggggggggggg -dfgdsfgdh

-dh
dh
dh
dh
dh
dh
dh
dh
dh
- -gh

-g -hg

-fhhhhhhhhhhhhhhhhhhgfghfghfgh - -fhf -g -hffffgggggggggggggggggggggggggggggggggggggdsf

titre 3- les hommes

la fin'; - - -function sumparser($text) -{ - preg_match_all('#(.+)#iU', $text, $out); - - var_dump($out); - - $sum = []; - foreach ($out[2] as $key => $value) { - $sum[$value][$out[1][$key]] = $out[3][$key]; + + +require('../w/class/class.w.quickcss.php'); + +$quick = new Quickcss; + + + +var_dump($quick); + + + + +$color = ['color', 'background-color', 'border-color']; +$size = ['width', 'height', 'margin', 'padding', 'border-width']; +$font = ['font-size']; +$unique = ['background-image', 'opacity', 'border-style', 'text-align']; +$params = array_merge($color, $size, $font, $unique); + + + + + + +// $presets = ['body' => ['font-size' => 'px']]; +// $quickcss = ['section' => ['color' => '#a74545', 'font-size' => '32px'], 'p' => ['background-color' => '#458da7', 'width' => '7px']]; + +$presets = []; +$quickcss = []; + +if (isset($_POST['quickcss'])) { + $quickcss = $_POST['quickcss']; +} + +if (isset($_POST['presets'])) { + $presets = $_POST['presets']; +} + + +if (isset($_POST['active'])) { + $active = $_POST['active']; + echo '

active

'; + var_dump($active); + $intersect = array_intersect_key($quickcss, $active); + + foreach ($intersect as $element => $css) { + $intersect[$element] = array_intersect_key($quickcss[$element], $active[$element]); } + + echo '

intersect

'; + var_dump($intersect); + + $quickcss = $intersect; + + +} + + +if (!empty($_POST['new']['element']) && !empty($_POST['new']['param']) && in_array($_POST['new']['param'], $params)) { + $new = array($_POST['new']['element'] => array($_POST['new']['param'] => '')); + var_dump($new); + + $quickcss = array_merge_recursive($quickcss, $new); +} + + + + +echo '

quickcss

'; + +var_dump($quickcss); + +echo '

presets

'; - var_dump($sum); - - $sumstring = ''; - $last = 0; - foreach ($sum as $title => $list) { - foreach ($list as $h => $link) { - if($h > $last) { - for ($i = 1; $i <= ($h - $last); $i++) { - $sumstring .= ''; - } - $sumstring .= '
  • '.$link.'
  • ' ; - } elseif ($h = $last) { - $sumstring .= '
  • '.$link.'
  • ' ; - } - $last = $h; +var_dump($presets); + +foreach ($presets as $element => $preset) { + foreach ($preset as $param => $unit) { + if (array_key_exists($element, $quickcss) && array_key_exists($param, $quickcss[$element])) { + $quickcss[$element][$param] .= $unit; } } - for ($i = 1; $i <= ($last); $i++) { - $sumstring .= ''; +} + + +$jsonquickcss = json_encode($quickcss); + +var_dump($jsonquickcss); + +$string = ''; +foreach ($quickcss as $key => $css) { + $string .= PHP_EOL . $key . ' {'; + foreach ($css as $param => $value) { + + $string .= PHP_EOL . ' ' . $param . ': ' . $value . ';'; + + } + $string .= PHP_EOL . '}' . PHP_EOL; +} + +var_dump($string); + + + + +echo '
    '; + +foreach ($quickcss as $element => $css) { + echo '

    ' . $element . '

    '; + foreach ($css as $param => $value) { + + echo ''; + + if (in_array($param, $color)) { + echo ''; + echo ''; + } + + if (in_array($param, $size)) { + echo ''; + echo ''; + + $unit = preg_replace('/\d/', '', $quickcss[$element][$param]); + ?> + + ' . $param . ''; + echo ''; + + $unit = preg_replace('/\d/', '', $quickcss[$element][$param]); + ?> + + Add element'; + +echo ''; +echo ''; + +echo '
    '; + +echo '
    '; + +?> + + + + + +
    +

    Yolo babyzesssssss

    +

    + Note that the values of array need to be valid keys, i.e. they need to be either integer or string. A warning will be emitted if a value has the wrong type, and the key/value pair in question will not be included in the result. -echo $sumstring; +If a value has several occurrences, the latest key will be used as its value, and all others will be lost. +

    -echo $text.'
    '; \ No newline at end of file +
    \ No newline at end of file diff --git a/public/test2.php b/public/test2.php new file mode 100644 index 0000000..a0cbafa --- /dev/null +++ b/public/test2.php @@ -0,0 +1,84 @@ + + + + + +
    + +setjson($_SESSION['css']); + +$quick->calc(); + +$quick->form('test2.php'); + +$_SESSION['css'] = $quick->tojson(); + + +?> + +
    + + + + + + + + +BODY +
    + SECTION +

    H1Bonjour tout le monde

    + +

    PDes bails de oufs qui toueeeett

    + +
    + ARTICLE +

    H2YOLO

    +

    P Des bails noirs très noir....

    +
    + + +
    + + + diff --git a/public/w/article.php b/public/w/article.php deleted file mode 100644 index 307caa4..0000000 --- a/public/w/article.php +++ /dev/null @@ -1,33 +0,0 @@ -exist($_GET['id'])) { - - $art = $app->get($_GET['id']); - - if (isset($_GET['edit']) and $_GET['edit'] == 1 and $app->session() >= $app::EDITOR) { - echo '
    '; - $aff->edit($art, $app, $app->getlister(['id', 'titre']), $config->fontsize(), $app->getlistermedia($app::MEDIA_DIR, 'image')); - //$aff->copy($art, $app->getlister(['id', 'titre'])); - $aff->aside($app); - echo '
    '; - } else { - echo '
    '; - - - $art->autotaglistupdate($app->taglist($app->getlister(['id', 'titre', 'intro', 'tag']), $art->autotaglist())); - - - $aff->lecture($art, $app); - echo '
    '; - - } -} else { - echo 'This article does not exist yet'; - - if ($app->session() >= $app::EDITOR) { - echo '
    '; - } - -} - -?> \ No newline at end of file diff --git a/public/w/css/styleadmin.css b/public/w/css/styleadmin.css deleted file mode 100644 index a3fcc5c..0000000 --- a/public/w/css/styleadmin.css +++ /dev/null @@ -1,80 +0,0 @@ -section { - margin-bottom: 100px; -} - -article { - border: 1px var(--color4) solid; - margin: 2px; - padding: 2px; - border: ridge; - max-width: 500px; - background-color: var(--color3); -} - -h1 { - border: ridge; - background-color: var(--color1); -} - -h2 { - margin-top: 0; - margin-bottom: 5px; -} - - -form { - display: inline-grid; - width: 98%; - margin: 1%; -} - -textarea#cssarea { - height: 400px; -} - -label { - font-weight: bold; - font-style: italic; -} - -summary { - background-color: var(--color1); - border: outset; - font-weight: bold; -} - -summary:focus { - outline: none; -} - -details { - background-color: var(--color1); - border: 1px var(--color4) solid; -} - - - -@media (max-width: 600px) { - nav { - width: unset; - position: relative; - display: block; - } - - div#menu { - display: block; - } -} - - -@media (max-width: 600px) { - nav { - width: unset; - position: relative; - display: block; - } - - div#menu { - display: block; - } -} \ No newline at end of file diff --git a/public/w/css/stylebase.css b/public/w/css/stylebase.css deleted file mode 100644 index 017b075..0000000 --- a/public/w/css/stylebase.css +++ /dev/null @@ -1,85 +0,0 @@ -:root { - --color1: lightgrey; - --color2: lightslategrey; - --color3: #ececec; - --color4: grey; -} - - -@keyframes alert { - from {top: 30px;} - to {top: -50px;} -} - -body { - margin: 0; - font-family: sans-serif; - background-color: var(--color4); -} - - -span.alert { - position: fixed; - background-color: var(--color1); - z-index: 100; - border: ridge red; - width: 200px; - text-align: center; - padding: 5px; - top: 30px; - font-weight: bold; - left: calc(50% - 100px); - animation: alert 1s linear 2s forwards; -} - - -form{ - margin: 0; -} - - - -nav { - position: fixed; - top: 0; - right: 0; - z-index: 10; - background-color: var(--color1); - border: ridge; -} - -div#menu { - display: none; -} - -nav:hover div#menu { - display: block; -} - -nav a { - display: block; -} - -nav a:hover { - background-color: var(--color3); -} - -nav #loginpass { - width: 100%; -} - - -@media (max-width: 600px) { - body { - font-size: 1.3em; - } - - input, textarea, select, button { - font-size: 0.8em; - } - - nav { - display: none; - } - -} \ No newline at end of file diff --git a/public/w/css/styleedit.css b/public/w/css/styleedit.css deleted file mode 100644 index fe6745f..0000000 --- a/public/w/css/styleedit.css +++ /dev/null @@ -1,250 +0,0 @@ -.edit { - background-color: var(--color1); -} - -#linklist { - background-color: var(--color1); -} - -#submit { - background-color: var(--color1); -} - -#copy { - background-color: var(--color1); -} - - -#artedit { - background-color: var(--color1); -} - -details { - background-color: var(--color1); -} - - - -.sidebar { - position: fixed; - width: 250px; - height: 100%; - overflow: scroll; - overflow-x: hidden; -} - -div#submit { - position: relative; -} - -textarea { - position: fixed; - width: calc(100% - 250px); - right: 0px; - height: 100%; - font-size: 1em; - padding: 2%; - padding-right: calc(50% - 500px); - resize: none; - -} - - -div#copy { - position: fixed; - bottom: 0; -} - -div#linklist { - position: fixed; - bottom: 0; - right: 0; - min-width: 10%; - max-width: 50%; - max-height: 50%; - overflow-y: auto; - -} - -div#linklist div#roll { - display: none; -} - -div#linklist:hover div#roll { - display: block; - width: auto; -} - -div#roll ul { - list-style: none; - margin: 0; - padding: 0; -} - - - -details label { - margin-top: 4px; -} - - -details select, details input, details label, details textarea#css { - width: 100%; -} - -details input[type="checkbox"] -{ - width: auto; -} - -ul { - list-style: none; - padding: 0; - margin: 2px; -} - -fieldset { - margin: 0; - padding: 0; - border: none; -} - -summary, div#linklist, div#copy, div#submit { - border: ridge 1px grey; - -} - -span#headid { - font-weight: bold; - padding-left: 1%; - padding-right: 1%; - border: ridge; - background-color: var(--color3); - -} - -input#fontsize { - width: 40px; -} - -summary { - background-color: var(--color1); - border: outset; - font-weight: bold; -} - -summary:focus { - outline: none; -} - -div#help { - padding: 2px; -} - -div#help pre { - background-color: white; - margin-bottom: 2px; -} - -div#help p { - background-color: var(--color3); - margin-top: 4px; -} - -div#help h3 {margin-bottom: 8px;} - -span.i { - background-color: var(--color2); - color: white; -} - - - -/* ------------------------------ TABS ----------------------------- */ - - - -.tabs -{ - position: absolute; - left: 250px; - top: 28px; -} - -.tabs .tab -{ - float: left; -} - -.tabs .tab .content -{ - position: absolute; - background-color: white; - left: 0px; - width: 100%; - border: 1px #000 solid; -} - -.checkboxtab -{ - display: none; -} - -.tab label -{ - margin-right: 10px; - border: outset; - background-color: var(--color1); -} - -.checkboxtab:checked ~ label -{ - border: inset; -} - -.checkboxtab:checked ~ .content -{ - z-index: 1; -} - - - - - - - -@media (max-width: 600px) { - details#editinfo, details#editcss, div#copy, div#linklist { - display: none; - } - - - nav { - position: absolute; - display: inline-flex; - } - - div#menu { - display: block; - } - - div#submit { - position: absolute; - display: block; - width: unset; - top: unset; - bottom: 0; - } - - nav form, nav a { - display: inline-flex; - margin: 1%; - } - - textarea#html { - padding-top: 60px; - } - - - -} \ No newline at end of file diff --git a/public/w/css/stylehome.css b/public/w/css/stylehome.css deleted file mode 100644 index 98822f0..0000000 --- a/public/w/css/stylehome.css +++ /dev/null @@ -1,117 +0,0 @@ -section.home { - margin-top: 27px; - display: inline-flex; - width: 100%; -} - -div#main { - border: ridge; - height: fit-content; - margin: 5px; - background-color: var(--color3); -} - -div#map { - border: ridge; - height: fit-content; - margin: 5px; - background-color: var(--color3); -} - -div#options { - border: ridge; - margin: 5px; - background-color: var(--color3); - width: 15%; - list-style: none; - max-width: 200px; - height: fit-content; - -} - -fieldset { - background-color: var(--color1); - border: outset; -} - -legend { - font-weight: bold; -} - -div#massedit { - background-color: var(--color1); -} - -header { - position: fixed; - width: 100%; - border: ridge; - background-color: var(--color1); -} - -h2 { - font-size: large; - margin: 0; - border: outset; - background-color: var(--color1); -} - -#options ul { - list-style: none; - margin: 0; - padding: 0; -} - -#home2table { - background-color: var(--color3); -} - -#home2table tr:hover { - background-color: var(--color1); -} - -#home2table th { - background-color: var(--color1); - border: ridge 1px grey; -} - - - -@media (max-width: 600px) { - - section.home { - position: relative; - display: block; - margin: unset; - } - - div#options { - position: relative; - width: unset; - } - - header { - position: relative; - border: none; - } - - table#home2table { - display: block; - position: relative; - width: 100%; - overflow-x: scroll; - font-size: 1em; - } - - nav { - width: unset; - position: relative; - display: block; - } - - div#menu { - display: block; - } - - -} \ No newline at end of file diff --git a/public/w/css/styleinfo.css b/public/w/css/styleinfo.css deleted file mode 100644 index a3fcc5c..0000000 --- a/public/w/css/styleinfo.css +++ /dev/null @@ -1,80 +0,0 @@ -section { - margin-bottom: 100px; -} - -article { - border: 1px var(--color4) solid; - margin: 2px; - padding: 2px; - border: ridge; - max-width: 500px; - background-color: var(--color3); -} - -h1 { - border: ridge; - background-color: var(--color1); -} - -h2 { - margin-top: 0; - margin-bottom: 5px; -} - - -form { - display: inline-grid; - width: 98%; - margin: 1%; -} - -textarea#cssarea { - height: 400px; -} - -label { - font-weight: bold; - font-style: italic; -} - -summary { - background-color: var(--color1); - border: outset; - font-weight: bold; -} - -summary:focus { - outline: none; -} - -details { - background-color: var(--color1); - border: 1px var(--color4) solid; -} - - - -@media (max-width: 600px) { - nav { - width: unset; - position: relative; - display: block; - } - - div#menu { - display: block; - } -} - - -@media (max-width: 600px) { - nav { - width: unset; - position: relative; - display: block; - } - - div#menu { - display: block; - } -} \ No newline at end of file diff --git a/public/w/css/stylemedia.css b/public/w/css/stylemedia.css deleted file mode 100644 index d721a9b..0000000 --- a/public/w/css/stylemedia.css +++ /dev/null @@ -1,103 +0,0 @@ -article { - border: 1px var(--color4) solid; - margin: 2px; - padding: 2px; - border: ridge; - max-width: 700px; - background-color: var(--color3); -} - -h1 { - border: ridge; - background-color: var(--color1); -} - -h2 { - margin-top: 0; - margin-bottom: 5px; -} - - -form { - display: inline-grid; - width: 98%; - margin: 1%; -} - - -label { - font-weight: bold; - font-style: italic; -} - -summary { - background-color: var(--color1); - border: outset; - font-weight: bold; -} - -summary:focus { - outline: none; -} - -details { - background-color: var(--color1); - border: 1px var(--color4) solid; -} - - -#mediatable { - background-color: var(--color3); -} - -#mediatable tr:hover { - background-color: var(--color1); -} - -#mediatable th { - background-color: var(--color1); - border: ridge 1px grey; -} - -.tooltip span { - display: none; - color: #000; - text-decoration: none; - padding: 3px; -} - -.tooltip:hover span { - display: block; - position: absolute; - background-color: var(--color3); - border: ridge; - margin-left: 30px; - margin-top: 0px; -} - - -img.thumbnail { - max-width: 100%; - max-height: 150px; -} - -input[type="checkbox"] { - width: unset; - padding: unset; - margin: unset; - height: unset; -} - - - -@media (max-width: 600px) { - nav { - width: unset; - position: relative; - display: block; - } - - div#menu { - display: block; - } -} \ No newline at end of file diff --git a/public/w/css/stylerecord.css b/public/w/css/stylerecord.css deleted file mode 100644 index 409bcd4..0000000 --- a/public/w/css/stylerecord.css +++ /dev/null @@ -1,79 +0,0 @@ -section { - padding: 0; -} - -.infobulle { - display: none; -} - -.little:hover .infobulle { - display: inline-block; - position: relative; - background-color: white; - z-index: 5; - top: 5px; - width: 300px; - font-family: monospace; - font-size: 0.9em; - line-height: 1.1em; -} - -span.infobulle img { - width: 100%; -} - -.grid { - display: flex; - flex-wrap: wrap; - padding: 4%; - margin-right: 120px; - list-style: none; - -} - -.little { - width: 100px; - height: 150px; - margin: 10px; - background-color: white; - -} - -.infobulle input[type="text"] { - font-family: monospace; - font-size: 0.9em; - margin: 3px; -} - -img.thumbnail { - max-width: 100%; - max-height: 100px; -} - -section.gest { - padding-bottom: 300px; -} - -input[type="file"] { - font-size: 1.3em; -} - -input[type="checkbox"] { - width: unset; - padding: unset; - margin: unset; - height: unset; -} - - -@media (max-width: 600px) { - nav { - width: unset; - position: relative; - display: block; - } - - div#menu { - display: block; - } -} \ No newline at end of file diff --git a/public/w/home.php b/public/w/home.php deleted file mode 100644 index 3094d03..0000000 --- a/public/w/home.php +++ /dev/null @@ -1,85 +0,0 @@ -header(); - -echo '
    '; - - -if ($app->session() >= $app::EDITOR) { - - $app->bddinit($config); - - $opt = new Opt(Art::classvarlist()); - $opt->setcol(['id', 'tag', 'lien', 'contenu', 'intro', 'titre', 'datemodif', 'datecreation', 'secure']); - $table = $app->getlisteropt($opt); - $app->listcalclien($table); - $opt->settaglist($table); - $opt->submit(); - - - - - - - - - - - - $opt->setcol(['id', 'tag', 'lien', 'contenu', 'intro', 'titre', 'datemodif', 'datecreation', 'secure', 'liento']); - - - $aff->option($app, $opt); - - $filtertagfilter = $app->filtertagfilter($table, $opt->tagfilter(), $opt->tagcompare()); - $filtersecure = $app->filtersecure($table, $opt->secure()); - - $filter = array_intersect($filtertagfilter, $filtersecure); - $table2 = []; - $table2invert = []; - foreach ($table as $art) { - if (in_array($art->id(), $filter)) { - $table2[] = $art; - } else { - $table2invert[] = $art; - } - - - } - - if(!empty($opt->invert())) { - $table2 = $table2invert; - } - - $app->artlistsort($table2, $opt->sortby(), $opt->order()); - - - echo '
    '; - - - $aff->home2table($app, $table2, $app->getlister()); - - - - - echo '
    '; - $aff->mapheader(); - if(isset($_GET['map'])) { - $aff->mermaid($app->map($table2)); - } - echo '
    '; - - - - - - echo '
    '; - -} - - - -echo '
    '; - -?> \ No newline at end of file diff --git a/public/w/index.php b/public/w/index.php index a5b3e03..bc5047e 100644 --- a/public/w/index.php +++ b/public/w/index.php @@ -1,362 +1,5 @@ readconfig(); -if (!$config) { - $message = 'config_file_error'; - echo $message; - if (isset($_POST['config']) && $_POST['config'] == 'create') { - $config = $app->createconfig($_POST); - $app->savejson($config->tojson()); - header('Location: ./'); - - } else { - $aff->configform(); - } - exit; -} - - -// _________________________________________________________ S E S ___________________________________________________________ - - -if (!isset($_SESSION['level'])) { - $session = 0; -} else { - $session = $_SESSION['level']; -} - -$app->setsession($session); - - - - -// _______________________________________________________ A C T I O N __________________________________________________________________ - - -if (isset($_POST['action'])) { - switch ($_POST['action']) { - - case 'login': - $_SESSION['level'] = $app->login($_POST['pass'], $config); - if (isset($_GET['id'])) { - header('Location: ?id=' . $_GET['id']); - } else { - header('Location: ./'); - } - break; - - case 'logout': - $_SESSION['level'] = $app->logout(); - if (isset($_GET['id'])) { - header('Location: ?id=' . $_GET['id']); - } else { - header('Location: ./'); - } - break; - - case 'addmedia': - $message = $app->addmedia($_FILES, 2 ** 24, $_POST['id']); - header('Location: ./?aff=media&message=' . $message); - break; - - case 'addcss': - $message = $app->addcss($_FILES, 2 ** 24, $_POST['id']); - header('Location: ./?aff=admin&message=' . $message); - break; - - case 'editcss': - file_put_contents($app::CSS_READ_DIR . $config->cssread(), $_POST['editcss']); - header('Location: ./?aff=admin'); - break; - - case 'editconfig': - $config->hydrate($_POST); - $app->savejson($config->tojson()); - header('Location: ./?aff=admin'); - break; - - - } -} - - - -// _____________________________________________________ D A T A B A S E __________________________________________________________________ - -if (isset($_POST['action'])) { - $app->bddinit($config); - - switch ($_POST['action']) { - - case 'new': - if (isset($_GET['id'])) { - $art = new Art($_GET); - $art->reset(); - $app->add($art); - header('Location: ?id=' . $_GET['id'] . '&edit=1'); - } - break; - - case 'update': - if ($app->exist($_GET['id'])) { - $art = new Art($_POST); - $art->updatelien(); - $art->autotaglistcalc($app->taglist($app->getlister(['id', 'titre', 'tag']), $art->autotaglist())); - $app->update($art); - if($config->fontsize() != $_POST['fontsize']) { - $config->setfontsize($_POST['fontsize']); - $app->savejson($config->tojson()); - } - header('Location: ?id=' . $art->id() . '&edit=1&message='.$art->id().'_saved'); - } - break; - - case 'display': - if ($app->exist($_GET['id'])) { - $art = new Art($_POST); - $art->updatelien(); - $art->autotaglistcalc($app->taglist($app->getlister(['id', 'titre', 'tag']), $art->autotaglist())); - $app->update($art); - if($config->fontsize() != $_POST['fontsize']) { - $config->setfontsize($_POST['fontsize']); - $app->savejson($config->tojson()); - } - header('Location: ?id=' . $art->id().'&message='.$art->id().'_saved'); - } - break; - - case 'home': - if ($app->exist($_GET['id'])) { - $art = new Art($_POST); - $art->updatelien(); - $art->autotaglistcalc($app->taglist($app->getlister(['id', 'titre', 'tag']), $art->autotaglist())); - $app->update($art); - if($config->fontsize() != $_POST['fontsize']) { - $config->setfontsize($_POST['fontsize']); - $app->savejson($config->tojson()); - } - header('Location: ./?message='.$art->id().'_saved'); - } - break; - - case 'copy': - if ($app->exist($_GET['id'])) { - $copy = $app->get($_POST['copy']); - $art = $app->get($_POST['id']); - if (!empty($_POST['css'])) { - $art->setcss($copy->css()); - } - if (!empty($_POST['color'])) { - $art->setcouleurtext($copy->couleurtext()); - $art->setcouleurbkg($copy->couleurbkg()); - $art->setcouleurlien($copy->couleurlien()); - $art->setcouleurlienblank($copy->couleurlienblank()); - } - if (!empty($_POST['html'])) { - $art->sethtml($copy->md()); - } - if (!empty($_POST['template'])) { - $art->settemplate($copy->template()); - } - $app->update($art); - header('Location: ?id=' . $art->id() . '&edit=1'); - } - break; - - case 'delete': - if ($app->exist($_GET['id'])) { - $art = new Art($_POST); - $app->delete($art); - header('Location: ?id=' . $art->id()); - } - break; - - case 'massedit': - if (isset($_POST['id'])) { - foreach ($_POST['id'] as $id) { - if ($app->exist($id)) { - $art = $app->get($id); - - switch ($_POST['massaction']) { - case 'do': - switch ($_POST['massedit']) { - case 'delete': - $app->delete($art); - break; - - case 'erasetag': - $art->settag(''); - $app->update($art); - break; - - case 'erasetemplate': - $art->settemplate(''); - $app->update($art); - break; - - case 'not published': - $art->setsecure(2); - $app->update($art); - break; - - case 'private': - $art->setsecure(1); - $app->update($art); - break; - - case 'public': - $art->setsecure(0); - $app->update($art); - break; - } - break; - - case 'set template': - if (isset($_POST['masstemplate'])) { - $art->settemplate($_POST['masstemplate']); - $app->update($art); - } - break; - - case 'add tag': - if (isset($_POST['targettag'])) { - $art = $app->get($id); - $tagstring = strip_tags(trim(strtolower($_POST['targettag']))); - $taglist = str_replace(' ', '', $tagstring); - $taglist = explode(",", $taglist); - foreach ($taglist as $tag) { - if (!in_array($tag, $art->tag('array'))) { - $newtaglist = $art->tag('array'); - array_push($newtaglist, $tag); - $art->settag($newtaglist); - } - } - $app->update($art); - } - break; - - } - - - - - } - header('Location: ./'); - } - break; - } - } -} - - - - - -if (isset($_POST['actiondb'])) { - $app->setbdd($config); - - switch ($_POST['actiondb']) { - - case 'addtable': - if (isset($_POST['tablename'])) { - $message = $app->addtable($config->dbname(), $_POST['tablename']); - header('Location: ./?aff=admin&message=' . $message); - } - break; - - case 'duplicatetable': - $message = $app->tableduplicate($config->dbname(), $_POST['arttable'], $_POST['tablename']); - header('Location: ./?aff=admin&message=' . $message); - break; - - } -} - - - - -// _______________________________________________________ H E A D _____________________________________________________________ - -if (isset($_GET['id'])) { - $app->bddinit($config); - if ($app->exist($_GET['id'])) { - $art = $app->get($_GET['id']); - if (!isset($_GET['edit'])) { - $_GET['edit'] = 0; - } - $aff->arthead($art, $app::CSS_READ_DIR, $config->cssread(), $_GET['edit']); - } else { - // $aff->head($_GET['id'], '', 'white'); - $aff->noarthead($_GET['id'], $app::CSS_READ_DIR, $config->cssread()); - - } -} elseif (isset($_GET['aff'])) { - $aff->head($_GET['aff'], $_GET['aff'], $config->color4()); -} else { - $aff->head('home', 'home', $config->color4()); -} - - - - - - - -// _____________________________________________________ A L E R T _______________________________________________________________ - -if (isset($_GET['message'])) { - echo '' . $_GET['message'] . ''; -} - - - - - - - - -// ______________________________________________________ B O D Y _______________________________________________________________ - - -$aff->nav($app); - -if (array_key_exists('id', $_GET)) { - $app->bddinit($config); - include('article.php'); -} elseif (array_key_exists('tag', $_GET)) { - $app->bddinit($config); - echo '

    ' . $_GET['tag'] . '

    '; - $aff->tag($app->getlister(['id', 'titre', 'intro', 'tag']), $_GET['tag'], $app); -} elseif (array_key_exists('lien', $_GET)) { - $app->bddinit($config); - echo '

    ' . $_GET['lien'] . '

    '; - $aff->lien($app->getlister(['id', 'titre', 'intro', 'lien']), $_GET['lien'], $app); -} elseif (array_key_exists('aff', $_GET)) { - include('menu.php'); -} else { - include('home.php'); -} - - +require('../../w/w.router.php'); ?> \ No newline at end of file diff --git a/public/w/menu.php b/public/w/menu.php deleted file mode 100644 index 8e89ed1..0000000 --- a/public/w/menu.php +++ /dev/null @@ -1,56 +0,0 @@ -session() >= $app::EDITOR) { - - if ($_GET['aff'] == 'admin' && $app->session() >= $app::ADMIN) { - echo '
    '; - echo '

    Admin

    '; - - $aff->admincss($config, $app); - $aff->adminpassword($config); - $aff->admindb($config); - if ($app->setbdd($config)) { - $status = "OK"; - } else { - $status = "Not Connected"; - } - $aff->admintable($config, $status, $app->tablelist($config->dbname())); - $aff->admindisplay($config->color4()); - - echo '
    '; - } elseif ($_GET['aff'] == 'media') { - echo '

    Media

    '; - echo '
    '; - echo '
    '; - - $aff->addmedia($app); - $aff->medialist($app->getlistermedia($app::MEDIA_DIR), $app::MEDIA_DIR); - - echo '
    '; - echo '
    '; - - } elseif ($_GET['aff'] == 'record') { - echo '

    Record

    '; - echo '
    '; - - $aff->recordlist($app); - - echo '
    '; - - } elseif ($_GET['aff'] == 'info') { - - - - } else { - - echo '

    Private

    You dont have the permission to access this page.

    '; - - } - - -} else { - echo '

    Private

    You should be connected to access this page.

    '; -} - -?> \ No newline at end of file diff --git a/public/w/rsc/css/styleadmin.css b/public/w/rsc/css/styleadmin.css new file mode 100644 index 0000000..a3fcc5c --- /dev/null +++ b/public/w/rsc/css/styleadmin.css @@ -0,0 +1,80 @@ +section { + margin-bottom: 100px; +} + +article { + border: 1px var(--color4) solid; + margin: 2px; + padding: 2px; + border: ridge; + max-width: 500px; + background-color: var(--color3); +} + +h1 { + border: ridge; + background-color: var(--color1); +} + +h2 { + margin-top: 0; + margin-bottom: 5px; +} + + +form { + display: inline-grid; + width: 98%; + margin: 1%; +} + +textarea#cssarea { + height: 400px; +} + +label { + font-weight: bold; + font-style: italic; +} + +summary { + background-color: var(--color1); + border: outset; + font-weight: bold; +} + +summary:focus { + outline: none; +} + +details { + background-color: var(--color1); + border: 1px var(--color4) solid; +} + + + +@media (max-width: 600px) { + nav { + width: unset; + position: relative; + display: block; + } + + div#menu { + display: block; + } +} + + +@media (max-width: 600px) { + nav { + width: unset; + position: relative; + display: block; + } + + div#menu { + display: block; + } +} \ No newline at end of file diff --git a/public/w/rsc/css/stylebase.css b/public/w/rsc/css/stylebase.css new file mode 100644 index 0000000..017b075 --- /dev/null +++ b/public/w/rsc/css/stylebase.css @@ -0,0 +1,85 @@ +:root { + --color1: lightgrey; + --color2: lightslategrey; + --color3: #ececec; + --color4: grey; +} + + +@keyframes alert { + from {top: 30px;} + to {top: -50px;} +} + +body { + margin: 0; + font-family: sans-serif; + background-color: var(--color4); +} + + +span.alert { + position: fixed; + background-color: var(--color1); + z-index: 100; + border: ridge red; + width: 200px; + text-align: center; + padding: 5px; + top: 30px; + font-weight: bold; + left: calc(50% - 100px); + animation: alert 1s linear 2s forwards; +} + + +form{ + margin: 0; +} + + + +nav { + position: fixed; + top: 0; + right: 0; + z-index: 10; + background-color: var(--color1); + border: ridge; +} + +div#menu { + display: none; +} + +nav:hover div#menu { + display: block; +} + +nav a { + display: block; +} + +nav a:hover { + background-color: var(--color3); +} + +nav #loginpass { + width: 100%; +} + + +@media (max-width: 600px) { + body { + font-size: 1.3em; + } + + input, textarea, select, button { + font-size: 0.8em; + } + + nav { + display: none; + } + +} \ No newline at end of file diff --git a/public/w/rsc/css/styleedit.css b/public/w/rsc/css/styleedit.css new file mode 100644 index 0000000..fe6745f --- /dev/null +++ b/public/w/rsc/css/styleedit.css @@ -0,0 +1,250 @@ +.edit { + background-color: var(--color1); +} + +#linklist { + background-color: var(--color1); +} + +#submit { + background-color: var(--color1); +} + +#copy { + background-color: var(--color1); +} + + +#artedit { + background-color: var(--color1); +} + +details { + background-color: var(--color1); +} + + + +.sidebar { + position: fixed; + width: 250px; + height: 100%; + overflow: scroll; + overflow-x: hidden; +} + +div#submit { + position: relative; +} + +textarea { + position: fixed; + width: calc(100% - 250px); + right: 0px; + height: 100%; + font-size: 1em; + padding: 2%; + padding-right: calc(50% - 500px); + resize: none; + +} + + +div#copy { + position: fixed; + bottom: 0; +} + +div#linklist { + position: fixed; + bottom: 0; + right: 0; + min-width: 10%; + max-width: 50%; + max-height: 50%; + overflow-y: auto; + +} + +div#linklist div#roll { + display: none; +} + +div#linklist:hover div#roll { + display: block; + width: auto; +} + +div#roll ul { + list-style: none; + margin: 0; + padding: 0; +} + + + +details label { + margin-top: 4px; +} + + +details select, details input, details label, details textarea#css { + width: 100%; +} + +details input[type="checkbox"] +{ + width: auto; +} + +ul { + list-style: none; + padding: 0; + margin: 2px; +} + +fieldset { + margin: 0; + padding: 0; + border: none; +} + +summary, div#linklist, div#copy, div#submit { + border: ridge 1px grey; + +} + +span#headid { + font-weight: bold; + padding-left: 1%; + padding-right: 1%; + border: ridge; + background-color: var(--color3); + +} + +input#fontsize { + width: 40px; +} + +summary { + background-color: var(--color1); + border: outset; + font-weight: bold; +} + +summary:focus { + outline: none; +} + +div#help { + padding: 2px; +} + +div#help pre { + background-color: white; + margin-bottom: 2px; +} + +div#help p { + background-color: var(--color3); + margin-top: 4px; +} + +div#help h3 {margin-bottom: 8px;} + +span.i { + background-color: var(--color2); + color: white; +} + + + +/* ------------------------------ TABS ----------------------------- */ + + + +.tabs +{ + position: absolute; + left: 250px; + top: 28px; +} + +.tabs .tab +{ + float: left; +} + +.tabs .tab .content +{ + position: absolute; + background-color: white; + left: 0px; + width: 100%; + border: 1px #000 solid; +} + +.checkboxtab +{ + display: none; +} + +.tab label +{ + margin-right: 10px; + border: outset; + background-color: var(--color1); +} + +.checkboxtab:checked ~ label +{ + border: inset; +} + +.checkboxtab:checked ~ .content +{ + z-index: 1; +} + + + + + + + +@media (max-width: 600px) { + details#editinfo, details#editcss, div#copy, div#linklist { + display: none; + } + + + nav { + position: absolute; + display: inline-flex; + } + + div#menu { + display: block; + } + + div#submit { + position: absolute; + display: block; + width: unset; + top: unset; + bottom: 0; + } + + nav form, nav a { + display: inline-flex; + margin: 1%; + } + + textarea#html { + padding-top: 60px; + } + + + +} \ No newline at end of file diff --git a/public/w/rsc/css/stylehome.css b/public/w/rsc/css/stylehome.css new file mode 100644 index 0000000..98822f0 --- /dev/null +++ b/public/w/rsc/css/stylehome.css @@ -0,0 +1,117 @@ +section.home { + margin-top: 27px; + display: inline-flex; + width: 100%; +} + +div#main { + border: ridge; + height: fit-content; + margin: 5px; + background-color: var(--color3); +} + +div#map { + border: ridge; + height: fit-content; + margin: 5px; + background-color: var(--color3); +} + +div#options { + border: ridge; + margin: 5px; + background-color: var(--color3); + width: 15%; + list-style: none; + max-width: 200px; + height: fit-content; + +} + +fieldset { + background-color: var(--color1); + border: outset; +} + +legend { + font-weight: bold; +} + +div#massedit { + background-color: var(--color1); +} + +header { + position: fixed; + width: 100%; + border: ridge; + background-color: var(--color1); +} + +h2 { + font-size: large; + margin: 0; + border: outset; + background-color: var(--color1); +} + +#options ul { + list-style: none; + margin: 0; + padding: 0; +} + +#home2table { + background-color: var(--color3); +} + +#home2table tr:hover { + background-color: var(--color1); +} + +#home2table th { + background-color: var(--color1); + border: ridge 1px grey; +} + + + +@media (max-width: 600px) { + + section.home { + position: relative; + display: block; + margin: unset; + } + + div#options { + position: relative; + width: unset; + } + + header { + position: relative; + border: none; + } + + table#home2table { + display: block; + position: relative; + width: 100%; + overflow-x: scroll; + font-size: 1em; + } + + nav { + width: unset; + position: relative; + display: block; + } + + div#menu { + display: block; + } + + +} \ No newline at end of file diff --git a/public/w/rsc/css/styleinfo.css b/public/w/rsc/css/styleinfo.css new file mode 100644 index 0000000..a3fcc5c --- /dev/null +++ b/public/w/rsc/css/styleinfo.css @@ -0,0 +1,80 @@ +section { + margin-bottom: 100px; +} + +article { + border: 1px var(--color4) solid; + margin: 2px; + padding: 2px; + border: ridge; + max-width: 500px; + background-color: var(--color3); +} + +h1 { + border: ridge; + background-color: var(--color1); +} + +h2 { + margin-top: 0; + margin-bottom: 5px; +} + + +form { + display: inline-grid; + width: 98%; + margin: 1%; +} + +textarea#cssarea { + height: 400px; +} + +label { + font-weight: bold; + font-style: italic; +} + +summary { + background-color: var(--color1); + border: outset; + font-weight: bold; +} + +summary:focus { + outline: none; +} + +details { + background-color: var(--color1); + border: 1px var(--color4) solid; +} + + + +@media (max-width: 600px) { + nav { + width: unset; + position: relative; + display: block; + } + + div#menu { + display: block; + } +} + + +@media (max-width: 600px) { + nav { + width: unset; + position: relative; + display: block; + } + + div#menu { + display: block; + } +} \ No newline at end of file diff --git a/public/w/rsc/css/stylemedia.css b/public/w/rsc/css/stylemedia.css new file mode 100644 index 0000000..d721a9b --- /dev/null +++ b/public/w/rsc/css/stylemedia.css @@ -0,0 +1,103 @@ +article { + border: 1px var(--color4) solid; + margin: 2px; + padding: 2px; + border: ridge; + max-width: 700px; + background-color: var(--color3); +} + +h1 { + border: ridge; + background-color: var(--color1); +} + +h2 { + margin-top: 0; + margin-bottom: 5px; +} + + +form { + display: inline-grid; + width: 98%; + margin: 1%; +} + + +label { + font-weight: bold; + font-style: italic; +} + +summary { + background-color: var(--color1); + border: outset; + font-weight: bold; +} + +summary:focus { + outline: none; +} + +details { + background-color: var(--color1); + border: 1px var(--color4) solid; +} + + +#mediatable { + background-color: var(--color3); +} + +#mediatable tr:hover { + background-color: var(--color1); +} + +#mediatable th { + background-color: var(--color1); + border: ridge 1px grey; +} + +.tooltip span { + display: none; + color: #000; + text-decoration: none; + padding: 3px; +} + +.tooltip:hover span { + display: block; + position: absolute; + background-color: var(--color3); + border: ridge; + margin-left: 30px; + margin-top: 0px; +} + + +img.thumbnail { + max-width: 100%; + max-height: 150px; +} + +input[type="checkbox"] { + width: unset; + padding: unset; + margin: unset; + height: unset; +} + + + +@media (max-width: 600px) { + nav { + width: unset; + position: relative; + display: block; + } + + div#menu { + display: block; + } +} \ No newline at end of file diff --git a/public/w/rsc/css/stylerecord.css b/public/w/rsc/css/stylerecord.css new file mode 100644 index 0000000..409bcd4 --- /dev/null +++ b/public/w/rsc/css/stylerecord.css @@ -0,0 +1,79 @@ +section { + padding: 0; +} + +.infobulle { + display: none; +} + +.little:hover .infobulle { + display: inline-block; + position: relative; + background-color: white; + z-index: 5; + top: 5px; + width: 300px; + font-family: monospace; + font-size: 0.9em; + line-height: 1.1em; +} + +span.infobulle img { + width: 100%; +} + +.grid { + display: flex; + flex-wrap: wrap; + padding: 4%; + margin-right: 120px; + list-style: none; + +} + +.little { + width: 100px; + height: 150px; + margin: 10px; + background-color: white; + +} + +.infobulle input[type="text"] { + font-family: monospace; + font-size: 0.9em; + margin: 3px; +} + +img.thumbnail { + max-width: 100%; + max-height: 100px; +} + +section.gest { + padding-bottom: 300px; +} + +input[type="file"] { + font-size: 1.3em; +} + +input[type="checkbox"] { + width: unset; + padding: unset; + margin: unset; + height: unset; +} + + +@media (max-width: 600px) { + nav { + width: unset; + position: relative; + display: block; + } + + div#menu { + display: block; + } +} \ No newline at end of file -- cgit v1.2.3