diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/css/old/styleedit.css | 27 | ||||
-rw-r--r-- | public/css/style.css | 0 | ||||
-rw-r--r-- | public/css/styleadmin.css | 0 | ||||
-rw-r--r-- | public/css/stylebase.css | 189 | ||||
-rw-r--r-- | public/css/styleedit.css | 120 | ||||
-rw-r--r-- | public/css/stylehome.css | 56 | ||||
-rw-r--r-- | public/css/stylew.css | 249 | ||||
-rw-r--r-- | public/rsc/js/app.js | 4 | ||||
-rw-r--r-- | public/w/index.php | 87 |
9 files changed, 288 insertions, 444 deletions
diff --git a/public/css/old/styleedit.css b/public/css/old/styleedit.css new file mode 100644 index 0000000..21435fb --- /dev/null +++ b/public/css/old/styleedit.css @@ -0,0 +1,27 @@ +.edit { + background-color: greenyellow; +} + +#linklist { + background-color: blanchedalmond; +} + +#submit { + background-color: coral; +} + +#copy { + background-color: darkkhaki; +} + +#html { + background-color: deepskyblue; +} + +#artedit { + background-color: darksalmon; +} + +#editoption { + background-color: blueviolet; +}
\ No newline at end of file diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/public/css/style.css diff --git a/public/css/styleadmin.css b/public/css/styleadmin.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/public/css/styleadmin.css diff --git a/public/css/stylebase.css b/public/css/stylebase.css index ff59114..5621363 100644 --- a/public/css/stylebase.css +++ b/public/css/stylebase.css @@ -1,193 +1,58 @@ -body { - background-color: #dcdcdceb; - font-family: helvetica, arial, sans-serif; - margin: 0px; - -} - -h1 { - font-size: 3em; - font-variant: all-small-caps; - margin-top: 0px; - margin-bottom: 0px; -} - -h2 { - font-style: italic; +:root { + --color1: lightgrey; + --color2: lightslategrey; + --color3: white; + --color4: grey; } -h3 { - opacity: 0.7; -} - -h6 { - font-size: 1em; -} - -p{ - font-size: 1em; -} - -em { - opacity: 0.8; -} - -a{ - text-decoration: none; -} - -a:hover{ - text-decoration: underline; +body { + margin: 0; + font-family: monospace; } -form { - margin-bottom: 0px; -} section { - padding: 3%; -} - -.edit body { - overflow-y: scroll; -} - -.edit section { - text-align: left; - padding-top: 0px; - padding-bottom: 0px; - padding-left: 8%; - padding-right: 8%; - line-height: 1.2em; } -.button, input, textarea, select { - display: inline-block; - width: 90%; - padding-left: 15px; - padding-right: 15px; - margin: 5px; - margin-left: 5%; - margin-right: 5%; - height: 30px; - border-style: unset; -} -.button { - text-align: center; - color: black; - font-size: 13px; - padding-top: 7px; - background-color: #bfbfbf; - box-sizing: border-box; - align-items: flex-start; - text-align: center; - cursor: default; - white-space: pre; - -webkit-rtl-ordering: logical; - text-rendering: auto; - color: initial; - letter-spacing: normal; - word-spacing: normal; - text-transform: none; - text-indent: 0px; - text-shadow: none; -} -.button:hover { - - text-decoration: none; -} -article { - position: relative; - z-index: 7; -} -#html{ - height: calc(100% - 95px); +form{ + margin: 0; } -#css{ - height: 250px; -} -input[type="submit"] { - background-color: #bfbfbf; -} - -aside { - position: fixed; - bottom: 0px; - right: -300px; - padding: 7px; - z-index: 5; - background: #bfbfbf; - opacity: 0.3; - width: 350px; - overflow-y: scroll; - max-height: calc(100% - 200px); -} - -aside:hover { - opacity: 1; - right: 0px; -} nav { position: fixed; - top: 0px; - right: -6%; - z-index: 10; - opacity: 0.3; - width: 8%; - text-align: right; -} - - - -nav:hover, .edit nav { - opacity: 1; - right: 0px; + top: 0; + right: 0; + z-index: 10; + background-color: var(--color1); + /* width: calc(10% - 20px); */ + width: 10%; + border: ridge 1px grey; } -.alert h4 { - background-color: red; - margin: 0px; +div#menu { + display: none; } -table { - width: 100%; - margin-top: 20px; -} - -.home tr:hover { - background-color: #bfbfbf; +nav:hover div#menu { + display: block; } -.home td:hover { - background-color: #a7a6a6; +nav a { + display: block; } -td { - border: 1px solid #ffffff00; - padding-top: 3px; - padding-bottom: 3px; +nav a:hover { + background-color: var(--color2); } -.submit { - position: fixed; - top: 0px; - left: 0px; - width: 8%; +nav #loginpass { + width: 100%; } -summary { - height: 24px; - outline: none; - font-size: 1.4em; - background-color: #a0a0a0; - margin-top: 3px; - margin-bottom: 3px; -}
\ No newline at end of file diff --git a/public/css/styleedit.css b/public/css/styleedit.css new file mode 100644 index 0000000..0e5ed01 --- /dev/null +++ b/public/css/styleedit.css @@ -0,0 +1,120 @@ +.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); +} + + + + + + +details#editinfo { + position: fixed; + top: 0; + left: 10%; + width: 40%; +} + +details#editcss { + position: fixed; + top: 0; + left: 50%; + width: 40%; +} + +div#submit { + position: fixed; + top: 0; + width: 10%; +} + +textarea#html { + width: 100%; + height: 100%; + font-size: 1em; + padding-top: 40px; + padding-bottom: 40px; + font-family: serif; + padding-left: 2%; + padding-right: calc(50% - 500px); + +} + + +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 { + display: block; + margin-top: 4px; +} + +textarea#css { + width: 100%; + height: 200px; +} + +details select, details input, details label, details textarea#css { + width: 100%; +} + +fieldset { + margin: 0; + padding: 0; + border: none; +} + +summary, div#linklist, div#copy, div#submit { + border: ridge 1px grey; + +}
\ No newline at end of file diff --git a/public/css/stylehome.css b/public/css/stylehome.css new file mode 100644 index 0000000..b2e8c73 --- /dev/null +++ b/public/css/stylehome.css @@ -0,0 +1,56 @@ +div#options { + background-color: var(--color1); +} + +#home2table { + background-color: var(--color3); +} + +header { + background-color: var(--color1); +} + + + + +section.home { + margin-top: 20px; + display: inline-flex; + width: 100%; +} + +header { + position: fixed; + width: 100%; + border: ridge 1px grey; +} + + +div#options { + width: 15%; + list-style: none; +} + + +#home2table { + width: 85%; +} + +#options ul { + list-style: none; + margin: 0; + padding: 0; +} + + +#home2table tr:hover { + background-color: var(--color1); +} + +#home2table th { + background-color: var(--color1); + border: ridge 1px grey; +} + + + diff --git a/public/css/stylew.css b/public/css/stylew.css deleted file mode 100644 index f175036..0000000 --- a/public/css/stylew.css +++ /dev/null @@ -1,249 +0,0 @@ -body { - background-color: #dcdcdceb; - font-family: helvetica, arial, sans-serif; - margin: 0px; - overflow: hidden; - -} - -h1 { - font-size: 3em; - font-variant: all-small-caps; - margin-top: 0px; - margin-bottom: 0px; -} - -h2 { - font-style: italic; -} - -h3 { - opacity: 0.7; -} - -h6 { - font-size: 1em; -} - -p{ - font-size: 1em; -} - -em { - opacity: 0.8; -} - -a{ - text-decoration: none; -} - -a:hover{ - text-decoration: underline; -} - -img { - width: 90%; - max-width: 1000px; -} - -form { - margin-bottom: 0px; -} - -section { - text-align: justify; - padding: 3%; -} - -.edit { - overflow-y: scroll; - height: 100%; - -} - -.lecture { - overflow-wrap: break-word; - overflow-y: auto; - height: 100%; -} - -.home { - overflow-y: scroll; - height: 100%; -} - -.edit section { - text-align: left; - padding-top: 0px; - padding-bottom: 0px; - padding-left: 8%; - padding-right: 8%; - line-height: 1.2em; -} - -.button, input, textarea, select { - display: inline-block; - width: 90%; - padding-left: 15px; - padding-right: 15px; - margin: 5px; - margin-left: 5%; - margin-right: 5%; - height: 30px; - border-style: unset; -} - -.button { - text-align: center; - color: black; - font-size: 13px; - padding-top: 7px; - background-color: #bfbfbf; - box-sizing: border-box; - align-items: flex-start; - text-align: center; - cursor: default; - white-space: pre; - -webkit-rtl-ordering: logical; - text-rendering: auto; - color: initial; - letter-spacing: normal; - word-spacing: normal; - text-transform: none; - text-indent: 0px; - text-shadow: none; -} - -.button:hover { - - text-decoration: none; -} - -article { - position: relative; - z-index: 7; -} - -#html{ - height: calc(100% - 95px); -} - -#css{ - height: 250px; -} - -input[type="submit"] { - background-color: #bfbfbf; -} - -aside { - position: fixed; - bottom: 0px; - right: -300px; - padding: 7px; - z-index: 5; - background: #bfbfbf; - opacity: 0.3; - width: 350px; - overflow-y: scroll; - max-height: calc(100% - 200px); -} - -aside:hover { - opacity: 1; - right: 0px; -} - -nav { - position: fixed; - top: 0px; - right: -6%; - z-index: 10; - opacity: 0.3; - width: 8%; - text-align: right; -} - - - -nav:hover, .edit nav { - opacity: 1; - right: 0px; -} - -.alert h4 { - background-color: red; - margin: 0px; -} - -table { - width: 100%; - margin-top: 20px; -} - -.home tr:hover { - background-color: #bfbfbf; -} - -.home td:hover { - background-color: #a7a6a6; -} - -td { - border: 1px solid #ffffff00; - padding-top: 3px; - padding-bottom: 3px; -} - -.submit { - position: fixed; - top: 0px; - left: 0px; - width: 8%; -} - -.thumbnail { - max-width: 30px; -} - -.infobulle { - width: 20%; - display: none; -} - -.little:hover .infobulle { - display: inline; - position: absolute; - background-color: white; - border: 1px solid black; -} - -span.infobulle img { - width: 100% -} - -.grid { - display: flex; - flex-wrap: wrap; -} - -.copy { - position: fixed; - bottom: 0px; - left: 0px; - width: 8%; -} - -.container { - position: relative; - width: 100%; - height: 0; - padding-bottom: 56.25%; - } - .video { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - }
\ No newline at end of file diff --git a/public/rsc/js/app.js b/public/rsc/js/app.js index d1b9f55..b806baf 100644 --- a/public/rsc/js/app.js +++ b/public/rsc/js/app.js @@ -1,5 +1,7 @@ -function confirmSubmit(event, element) { +function confirmSubmit(event, element, idform) { if (window.confirm('Confirmer ? ' + element) === false) { event.preventDefault(); + } else { + document.getElementById(idform).submit(); } }
\ No newline at end of file diff --git a/public/w/index.php b/public/w/index.php index 9229bb9..8b5069f 100644 --- a/public/w/index.php +++ b/public/w/index.php @@ -4,16 +4,14 @@ // _____________________________________________________ R E Q U I R E ________________________________________________________________ require('../../vendor/autoload.php'); -use Michelf\Markdown; -use Michelf\MarkdownExtra; - require('../../fn/fn.php'); -require('../../class/class.w.config.php'); -require('../../class/class.w.art.php'); -require('../../class/class.w.app.php'); -require('../../class/class.w.aff.php'); -require('../../class/class.w.media.php'); -require('../../class/class.w.record.php'); + +function my_autoloader($class) +{ + require('../../class/class.w.' . strtolower($class) . '.php'); +} +spl_autoload_register('my_autoloader'); + // ________________________________________________________ I N S T A L _________________________________________________ @@ -173,19 +171,18 @@ if (isset($_GET['id'])) { $app->setbdd($config); if ($app->exist($_GET['id'])) { $art = $app->get($_GET['id']); - if (isset($_GET['edit']) && $_GET['edit'] == 1) { - $aff->arthead($art, $config->cssread(), 1); - } else { - $aff->arthead($art, $config->cssread(), 0); + if (!isset($_GET['edit'])) { + $_GET['edit'] = 0; } + $aff->arthead($art, $config->cssread(), $_GET['edit']); } else { - $aff->head($_GET['id'], 'w'); + $aff->head($_GET['id'], ''); } } elseif (isset($_GET['aff'])) { $aff->head($_GET['aff'], $_GET['aff']); } else { - $aff->head('home', 'w'); + $aff->head('home', 'home'); } @@ -197,7 +194,7 @@ if (isset($_GET['id'])) { // _____________________________________________________ A L E R T _______________________________________________________________ if (isset($_GET['message'])) { - echo '<span class="alert"><h4>' . $_GET['message'] . '</h4></span>'; + echo '<span class="alert">' . $_GET['message'] . '</span>'; } @@ -221,11 +218,15 @@ if (isset($_GET['id'])) { $art = $app->get($_GET['id']); if (isset($_GET['edit']) and $_GET['edit'] == 1 and $app->session() >= $app::EDITOR) { - $aff->edit($art, $app, $app->getlister(['id', 'titre'], 'id')); - $aff->copy($art, $app->getlister(['id', 'titre'], 'id')); + echo '<section class=edit>'; + $aff->edit($art, $app, $app->getlister(['id', 'titre'])); + $aff->copy($art, $app->getlister(['id', 'titre'])); $aff->aside($app); + echo '</section>'; } else { + echo '<section class="lecture">'; $aff->lecture($art, $app); + echo '</section>'; } } else { @@ -237,7 +238,7 @@ if (isset($_GET['id'])) { header('Location: ?id=' . $_GET['id'] . '&edit=1'); } } else { - echo '<span class="alert"><h4>This article does not exist yet</h4></span>'; + echo '<span class="alert">This article does not exist yet</span>'; if ($app->session() >= $app::EDITOR) { echo '<form action="?id=' . $_GET['id'] . '&edit=1" method="post"><input type="hidden" name="action" value="new"><input type="submit" value="Create"></form>'; @@ -254,7 +255,7 @@ if (isset($_GET['id'])) { } elseif (isset($_GET['lien'])) { $app->setbdd($config); echo '<h4><a href="?id=' . $_GET['lien'] . '">' . $_GET['lien'] . '</a></h4>'; - $aff->lien($app->getlister(['id', 'titre', 'intro', 'lien'], 'id'), $_GET['lien'], $app); + $aff->lien($app->getlister(['id', 'titre', 'intro', 'lien']), $_GET['lien'], $app); } elseif (isset($_GET['aff']) && $app->session() >= $app::EDITOR) { if ($_GET['aff'] == 'admin' && $app->session() >= $app::ADMIN) { @@ -292,27 +293,49 @@ if (isset($_GET['id'])) { echo '</section>'; + } elseif ($_GET['aff'] == 'map') { + $app->setbdd($config); + $aff->map($app, $config->domain()); } else { header('Location: ./'); } } else { - $app->setbdd($config); - if (isset($_GET['tri'])) { - $tri = strip_tags($_GET['tri']); - } else { - $tri = 'id'; - } - if (isset($_GET['desc'])) { - $desc = strip_tags($_GET['desc']); - } else { - $desc = 'ASC'; + $aff->header(); + + echo '<section class="home">'; + + + $app->setbdd($config); + $opt = new Opt(Art::classvarlist()); + $opt->hydrate($_GET); + $opt->setcol(['id', 'tag', 'lien', 'contenu', 'intro', 'titre', 'datemodif', 'datecreation', 'secure']); + $table = $app->getlisteropt($opt); + $app->listcalclien($table); + $opt->settaglist($table); + $opt->setcol(['id', 'tag', 'lien', 'contenu', 'intro', 'titre', 'datemodif', 'datecreation', 'secure', 'liento']); + + $aff->option($app, $opt); + + $filtertagor = $app->filtertagor($table, $opt->tagor()); + $filtersecure = $app->filtersecure($table, $opt->secure()); + + $filter = array_intersect($filtertagor, $filtersecure); + $table2 = []; + foreach ($table as $art) { + if (in_array($art->id(), $filter)) { + $table2[] = $art; + } } - $aff->home2table($app, $app->getlister(['id', 'titre', 'intro', 'lien', 'datecreation', 'datemodif'], $tri, $desc)); + $app->artlistsort($table2, $opt->sortby(), $opt->order()); + + + + $aff->home2table($app, $table2); - //var_dump($app->getlister(['id', 'lien'])); + echo '</section>'; } |