├── .dockerignore ├── .gitignore ├── .htaccess ├── README.md ├── application ├── controllers │ ├── !lib │ │ ├── include.php │ │ └── request │ │ │ ├── request.php │ │ │ ├── response.php │ │ │ └── verify.php │ ├── admin │ │ ├── colors │ │ │ ├── add │ │ │ │ └── controller.php │ │ │ ├── delete │ │ │ │ └── controller.php │ │ │ └── edit │ │ │ │ └── controller.php │ │ ├── components │ │ │ ├── add │ │ │ │ └── controller.php │ │ │ ├── delete │ │ │ │ └── controller.php │ │ │ ├── edit │ │ │ │ └── controller.php │ │ │ └── load │ │ │ │ └── controller.php │ │ ├── login │ │ │ └── controller.php │ │ ├── logout │ │ │ └── controller.php │ │ └── pages │ │ │ ├── add │ │ │ └── controller.php │ │ │ ├── content │ │ │ ├── add │ │ │ │ └── controller.php │ │ │ ├── delete │ │ │ │ └── controller.php │ │ │ ├── edit │ │ │ │ └── controller.php │ │ │ ├── get │ │ │ │ └── controller.php │ │ │ ├── move │ │ │ │ └── controller.php │ │ │ └── paste │ │ │ │ └── controller.php │ │ │ ├── delete │ │ │ └── controller.php │ │ │ ├── edit │ │ │ └── controller.php │ │ │ └── head │ │ │ └── update │ │ │ └── controller.php │ ├── components │ │ ├── admin_render │ │ │ └── controller.php │ │ ├── controller │ │ │ └── controller.php │ │ └── render │ │ │ └── controller.php │ ├── compress │ │ ├── controller.php │ │ ├── css │ │ │ └── controller.php │ │ └── js │ │ │ └── controller.php │ ├── include.php │ ├── index.php │ └── svg │ │ └── controller.php ├── include │ ├── components │ │ ├── admin_colors_form │ │ │ ├── admin_colors_form.css │ │ │ ├── admin_colors_form.js │ │ │ ├── class.php │ │ │ └── render.php │ │ ├── admin_components_form │ │ │ ├── admin_components_form.css │ │ │ ├── admin_components_form.js │ │ │ ├── class.php │ │ │ └── render.php │ │ ├── admin_header_form │ │ │ ├── admin_header_form.css │ │ │ ├── admin_header_form.js │ │ │ ├── class.php │ │ │ └── render.php │ │ ├── admin_pages_content_form │ │ │ ├── admin_pages_content_form.css │ │ │ ├── admin_pages_content_form.js │ │ │ ├── class.php │ │ │ └── render.php │ │ ├── admin_pages_form │ │ │ ├── admin_pages_form.css │ │ │ ├── admin_pages_form.js │ │ │ ├── class.php │ │ │ └── render.php │ │ ├── article │ │ │ ├── admin │ │ │ │ ├── handler.php │ │ │ │ └── render.php │ │ │ ├── article.css │ │ │ ├── class.php │ │ │ ├── config.json │ │ │ └── render.php │ │ ├── button │ │ │ ├── admin │ │ │ │ ├── button.css │ │ │ │ ├── button.js │ │ │ │ ├── handler.php │ │ │ │ ├── render.php │ │ │ │ └── types │ │ │ │ │ ├── button │ │ │ │ │ └── render.php │ │ │ │ │ ├── dropdown │ │ │ │ │ ├── dropdown.css │ │ │ │ │ ├── dropdown.js │ │ │ │ │ └── render.php │ │ │ │ │ └── link │ │ │ │ │ └── render.php │ │ │ ├── class.php │ │ │ ├── config.json │ │ │ ├── controllers │ │ │ │ └── add_dropdown │ │ │ │ │ └── controller.php │ │ │ ├── render.php │ │ │ └── types │ │ │ │ ├── button │ │ │ │ ├── button.css │ │ │ │ └── render.php │ │ │ │ ├── dropdown │ │ │ │ ├── dropdown.css │ │ │ │ └── render.php │ │ │ │ └── link │ │ │ │ ├── link.css │ │ │ │ └── render.php │ │ ├── caruosel │ │ │ ├── admin │ │ │ │ ├── caruosel.css │ │ │ │ ├── caruosel.js │ │ │ │ ├── handler.php │ │ │ │ └── render.php │ │ │ ├── caruosel.css │ │ │ ├── caruosel.js │ │ │ ├── class.php │ │ │ ├── config.json │ │ │ ├── controllers │ │ │ │ └── add_slide │ │ │ │ │ └── controller.php │ │ │ └── render.php │ │ ├── class.php │ │ ├── files │ │ │ ├── class.php │ │ │ ├── controllers │ │ │ │ ├── create_directory │ │ │ │ │ └── controller.php │ │ │ │ ├── remove_directory │ │ │ │ │ └── controller.php │ │ │ │ ├── remove_file │ │ │ │ │ └── controller.php │ │ │ │ └── upload_file │ │ │ │ │ └── controller.php │ │ │ ├── files.css │ │ │ ├── files.js │ │ │ └── render.php │ │ ├── footer │ │ │ ├── admin │ │ │ │ ├── handler.php │ │ │ │ └── render.php │ │ │ ├── class.php │ │ │ ├── config.json │ │ │ ├── footer.css │ │ │ └── render.php │ │ ├── header │ │ │ ├── admin │ │ │ │ ├── handler.php │ │ │ │ ├── header.css │ │ │ │ ├── header.js │ │ │ │ └── render.php │ │ │ ├── class.php │ │ │ ├── config.json │ │ │ ├── controllers │ │ │ │ └── add_dropdown │ │ │ │ │ └── controller.php │ │ │ ├── header.css │ │ │ └── render.php │ │ ├── image │ │ │ ├── admin │ │ │ │ ├── handler.php │ │ │ │ ├── image.css │ │ │ │ ├── image.js │ │ │ │ └── render.php │ │ │ ├── class.php │ │ │ ├── config.json │ │ │ ├── controllers │ │ │ │ ├── select_image │ │ │ │ │ ├── controller.php │ │ │ │ │ └── style.css │ │ │ │ └── upload_image │ │ │ │ │ └── controller.php │ │ │ └── render.php │ │ ├── include.php │ │ ├── interface.php │ │ ├── text │ │ │ ├── admin │ │ │ │ ├── handler.php │ │ │ │ ├── render.php │ │ │ │ ├── text.css │ │ │ │ └── text.js │ │ │ ├── class.php │ │ │ ├── config.json │ │ │ └── render.php │ │ ├── title │ │ │ ├── admin │ │ │ │ ├── handler.php │ │ │ │ └── render.php │ │ │ ├── class.php │ │ │ ├── config.json │ │ │ ├── render.php │ │ │ └── title.css │ │ └── title_image │ │ │ ├── admin │ │ │ ├── handler.php │ │ │ └── render.php │ │ │ ├── class.php │ │ │ ├── config.json │ │ │ ├── render.php │ │ │ └── title_image.css │ ├── db │ │ ├── basic_functions.php │ │ ├── config.php │ │ ├── functions │ │ │ ├── colors │ │ │ │ └── colors.php │ │ │ ├── components │ │ │ │ └── components.php │ │ │ ├── include.php │ │ │ ├── pages │ │ │ │ ├── content │ │ │ │ │ └── content.php │ │ │ │ ├── head │ │ │ │ │ └── head.php │ │ │ │ └── pages.php │ │ │ ├── sessions │ │ │ │ └── sessions.php │ │ │ └── user │ │ │ │ └── user.php │ │ ├── init.tables.php │ │ └── orm │ │ │ ├── orm.php │ │ │ ├── querys │ │ │ ├── delete.php │ │ │ ├── functions.php │ │ │ ├── index.php │ │ │ ├── insert.php │ │ │ ├── select.php │ │ │ └── update.php │ │ │ └── structure │ │ │ ├── column.php │ │ │ ├── index.php │ │ │ └── table.php │ ├── include.php │ └── lib │ │ ├── auto_admin │ │ ├── auto_admin.php │ │ ├── auto_admin_render.php │ │ └── auto_handle.php │ │ ├── cache │ │ └── cache.php │ │ ├── colors │ │ └── colors.php │ │ ├── component │ │ ├── class.php │ │ ├── component.php │ │ ├── css │ │ │ ├── css.php │ │ │ └── namespace.php │ │ └── interface.php │ │ ├── head │ │ ├── head.php │ │ └── namespace.php │ │ ├── include.php │ │ ├── libretranslate │ │ ├── lib │ │ │ ├── .gitignore │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── composer.json │ │ │ ├── src │ │ │ │ └── LibreTranslate.php │ │ │ └── tests │ │ │ │ ├── Suggest.php │ │ │ │ ├── connectionTest.php │ │ │ │ ├── fileTranslateTest.php │ │ │ │ ├── initialTest.php │ │ │ │ ├── ltmanageTest.php │ │ │ │ ├── test-file1.txt │ │ │ │ └── texttranslateTest.php │ │ └── libretranslate.php │ │ ├── object │ │ └── object.php │ │ ├── object_to_types │ │ └── object_to_types.php │ │ └── utils │ │ └── utils.php ├── index.php └── site │ ├── include.php │ ├── index.php │ ├── lib │ ├── !display_site │ │ ├── !display_site.php │ │ └── functions.php │ └── include.php │ └── pages │ ├── admin │ ├── admin.js │ ├── admin.php │ ├── admin_pages │ │ ├── cms │ │ │ └── files │ │ │ │ └── page.php │ │ ├── frontend │ │ │ ├── colors │ │ │ │ ├── colors.css │ │ │ │ ├── colors.js │ │ │ │ └── page.php │ │ │ ├── components │ │ │ │ ├── components.css │ │ │ │ ├── components.js │ │ │ │ └── page.php │ │ │ └── pages │ │ │ │ ├── page.php │ │ │ │ ├── pages.css │ │ │ │ └── pages.js │ │ ├── index.php │ │ └── main_page │ │ │ ├── main_page.css │ │ │ └── page.php │ ├── admin_wrapper │ │ ├── admin_wrapper.css │ │ ├── admin_wrapper.js │ │ ├── admin_wrapper.php │ │ └── header │ │ │ ├── header.css │ │ │ ├── header.js │ │ │ └── header.php │ ├── include.php │ ├── lib │ │ ├── admin │ │ │ ├── admin.php │ │ │ └── namespace.php │ │ ├── include.php │ │ └── user │ │ │ ├── add.php │ │ │ └── user.php │ └── login │ │ ├── login.css │ │ ├── login.js │ │ └── login.php │ └── menager.php ├── docker ├── deploy │ ├── docker-compose.yml │ └── dockerfile └── dev │ ├── docker-compose.yml │ └── dockerfile ├── env.php.copy ├── index.php ├── readme ├── cms-first-run.webm └── play-btn.svg ├── static ├── ckeditor │ ├── CHANGES.md │ ├── LICENSE.md │ ├── README.md │ ├── SECURITY.md │ ├── adapters │ │ └── jquery.js │ ├── build-config.js │ ├── ckeditor.js │ ├── config.js │ ├── contents.css │ ├── lang │ │ ├── en-au.js │ │ ├── en-ca.js │ │ ├── en-gb.js │ │ ├── en.js │ │ └── pl.js │ ├── plugins │ │ ├── a11yhelp │ │ │ └── dialogs │ │ │ │ ├── a11yhelp.js │ │ │ │ └── lang │ │ │ │ ├── _translationstatus.txt │ │ │ │ ├── af.js │ │ │ │ ├── ar.js │ │ │ │ ├── az.js │ │ │ │ ├── bg.js │ │ │ │ ├── ca.js │ │ │ │ ├── cs.js │ │ │ │ ├── cy.js │ │ │ │ ├── da.js │ │ │ │ ├── de-ch.js │ │ │ │ ├── de.js │ │ │ │ ├── el.js │ │ │ │ ├── en-au.js │ │ │ │ ├── en-gb.js │ │ │ │ ├── en.js │ │ │ │ ├── eo.js │ │ │ │ ├── es-mx.js │ │ │ │ ├── es.js │ │ │ │ ├── et.js │ │ │ │ ├── eu.js │ │ │ │ ├── fa.js │ │ │ │ ├── fi.js │ │ │ │ ├── fo.js │ │ │ │ ├── fr-ca.js │ │ │ │ ├── fr.js │ │ │ │ ├── gl.js │ │ │ │ ├── gu.js │ │ │ │ ├── he.js │ │ │ │ ├── hi.js │ │ │ │ ├── hr.js │ │ │ │ ├── hu.js │ │ │ │ ├── id.js │ │ │ │ ├── it.js │ │ │ │ ├── ja.js │ │ │ │ ├── km.js │ │ │ │ ├── ko.js │ │ │ │ ├── ku.js │ │ │ │ ├── lt.js │ │ │ │ ├── lv.js │ │ │ │ ├── mk.js │ │ │ │ ├── mn.js │ │ │ │ ├── nb.js │ │ │ │ ├── nl.js │ │ │ │ ├── no.js │ │ │ │ ├── oc.js │ │ │ │ ├── pl.js │ │ │ │ ├── pt-br.js │ │ │ │ ├── pt.js │ │ │ │ ├── ro.js │ │ │ │ ├── ru.js │ │ │ │ ├── si.js │ │ │ │ ├── sk.js │ │ │ │ ├── sl.js │ │ │ │ ├── sq.js │ │ │ │ ├── sr-latn.js │ │ │ │ ├── sr.js │ │ │ │ ├── sv.js │ │ │ │ ├── th.js │ │ │ │ ├── tr.js │ │ │ │ ├── tt.js │ │ │ │ ├── ug.js │ │ │ │ ├── uk.js │ │ │ │ ├── vi.js │ │ │ │ ├── zh-cn.js │ │ │ │ └── zh.js │ │ ├── about │ │ │ └── dialogs │ │ │ │ ├── about.js │ │ │ │ ├── hidpi │ │ │ │ └── logo_ckeditor.png │ │ │ │ └── logo_ckeditor.png │ │ ├── clipboard │ │ │ └── dialogs │ │ │ │ └── paste.js │ │ ├── dialog │ │ │ ├── dialogDefinition.js │ │ │ └── styles │ │ │ │ └── dialog.css │ │ ├── icons.png │ │ ├── icons_hidpi.png │ │ ├── image │ │ │ ├── dialogs │ │ │ │ └── image.js │ │ │ └── images │ │ │ │ └── noimage.png │ │ ├── link │ │ │ ├── dialogs │ │ │ │ ├── anchor.js │ │ │ │ └── link.js │ │ │ └── images │ │ │ │ ├── anchor.png │ │ │ │ └── hidpi │ │ │ │ └── anchor.png │ │ ├── magicline │ │ │ └── images │ │ │ │ ├── hidpi │ │ │ │ ├── icon-rtl.png │ │ │ │ └── icon.png │ │ │ │ ├── icon-rtl.png │ │ │ │ └── icon.png │ │ ├── pastefromgdocs │ │ │ └── filter │ │ │ │ └── default.js │ │ ├── pastefromlibreoffice │ │ │ └── filter │ │ │ │ └── default.js │ │ ├── pastefromword │ │ │ └── filter │ │ │ │ └── default.js │ │ ├── pastetools │ │ │ └── filter │ │ │ │ ├── common.js │ │ │ │ └── image.js │ │ ├── scayt │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── dialogs │ │ │ │ ├── dialog.css │ │ │ │ ├── options.js │ │ │ │ └── toolbar.css │ │ │ └── skins │ │ │ │ └── moono-lisa │ │ │ │ └── scayt.css │ │ ├── specialchar │ │ │ └── dialogs │ │ │ │ ├── lang │ │ │ │ ├── _translationstatus.txt │ │ │ │ ├── af.js │ │ │ │ ├── ar.js │ │ │ │ ├── az.js │ │ │ │ ├── bg.js │ │ │ │ ├── ca.js │ │ │ │ ├── cs.js │ │ │ │ ├── cy.js │ │ │ │ ├── da.js │ │ │ │ ├── de-ch.js │ │ │ │ ├── de.js │ │ │ │ ├── el.js │ │ │ │ ├── en-au.js │ │ │ │ ├── en-ca.js │ │ │ │ ├── en-gb.js │ │ │ │ ├── en.js │ │ │ │ ├── eo.js │ │ │ │ ├── es-mx.js │ │ │ │ ├── es.js │ │ │ │ ├── et.js │ │ │ │ ├── eu.js │ │ │ │ ├── fa.js │ │ │ │ ├── fi.js │ │ │ │ ├── fr-ca.js │ │ │ │ ├── fr.js │ │ │ │ ├── gl.js │ │ │ │ ├── he.js │ │ │ │ ├── hr.js │ │ │ │ ├── hu.js │ │ │ │ ├── id.js │ │ │ │ ├── it.js │ │ │ │ ├── ja.js │ │ │ │ ├── km.js │ │ │ │ ├── ko.js │ │ │ │ ├── ku.js │ │ │ │ ├── lt.js │ │ │ │ ├── lv.js │ │ │ │ ├── nb.js │ │ │ │ ├── nl.js │ │ │ │ ├── no.js │ │ │ │ ├── oc.js │ │ │ │ ├── pl.js │ │ │ │ ├── pt-br.js │ │ │ │ ├── pt.js │ │ │ │ ├── ro.js │ │ │ │ ├── ru.js │ │ │ │ ├── si.js │ │ │ │ ├── sk.js │ │ │ │ ├── sl.js │ │ │ │ ├── sq.js │ │ │ │ ├── sr-latn.js │ │ │ │ ├── sr.js │ │ │ │ ├── sv.js │ │ │ │ ├── th.js │ │ │ │ ├── tr.js │ │ │ │ ├── tt.js │ │ │ │ ├── ug.js │ │ │ │ ├── uk.js │ │ │ │ ├── vi.js │ │ │ │ ├── zh-cn.js │ │ │ │ └── zh.js │ │ │ │ └── specialchar.js │ │ ├── table │ │ │ └── dialogs │ │ │ │ └── table.js │ │ ├── tableselection │ │ │ └── styles │ │ │ │ └── tableselection.css │ │ ├── tabletools │ │ │ └── dialogs │ │ │ │ └── tableCell.js │ │ └── widget │ │ │ └── images │ │ │ └── handle.png │ ├── samples │ │ ├── css │ │ │ └── samples.css │ │ ├── img │ │ │ ├── github-top.png │ │ │ ├── header-bg.png │ │ │ ├── header-separator.png │ │ │ ├── logo.png │ │ │ ├── logo.svg │ │ │ └── navigation-tip.png │ │ ├── index.html │ │ ├── js │ │ │ ├── sample.js │ │ │ └── sf.js │ │ ├── old │ │ │ ├── ajax.html │ │ │ ├── api.html │ │ │ ├── appendto.html │ │ │ ├── assets │ │ │ │ ├── inlineall │ │ │ │ │ └── logo.png │ │ │ │ ├── outputxhtml │ │ │ │ │ └── outputxhtml.css │ │ │ │ ├── posteddata.php │ │ │ │ ├── sample.jpg │ │ │ │ └── uilanguages │ │ │ │ │ └── languages.js │ │ │ ├── datafiltering.html │ │ │ ├── dialog │ │ │ │ ├── assets │ │ │ │ │ └── my_dialog.js │ │ │ │ └── dialog.html │ │ │ ├── divreplace.html │ │ │ ├── enterkey │ │ │ │ └── enterkey.html │ │ │ ├── htmlwriter │ │ │ │ └── outputhtml.html │ │ │ ├── index.html │ │ │ ├── inlineall.html │ │ │ ├── inlinebycode.html │ │ │ ├── inlinetextarea.html │ │ │ ├── jquery.html │ │ │ ├── magicline │ │ │ │ └── magicline.html │ │ │ ├── readonly.html │ │ │ ├── replacebyclass.html │ │ │ ├── replacebycode.html │ │ │ ├── sample.css │ │ │ ├── sample.js │ │ │ ├── sample_posteddata.php │ │ │ ├── tabindex.html │ │ │ ├── toolbar │ │ │ │ └── toolbar.html │ │ │ ├── uicolor.html │ │ │ ├── uilanguages.html │ │ │ ├── wysiwygarea │ │ │ │ └── fullpage.html │ │ │ └── xhtmlstyle.html │ │ └── toolbarconfigurator │ │ │ ├── css │ │ │ └── fontello.css │ │ │ ├── font │ │ │ ├── LICENSE.txt │ │ │ ├── config.json │ │ │ ├── fontello.eot │ │ │ ├── fontello.svg │ │ │ ├── fontello.ttf │ │ │ └── fontello.woff │ │ │ ├── index.html │ │ │ ├── js │ │ │ ├── abstracttoolbarmodifier.js │ │ │ ├── fulltoolbareditor.js │ │ │ ├── toolbarmodifier.js │ │ │ └── toolbartextmodifier.js │ │ │ └── lib │ │ │ └── codemirror │ │ │ ├── LICENSE │ │ │ ├── codemirror.css │ │ │ ├── codemirror.js │ │ │ ├── javascript.js │ │ │ ├── neo.css │ │ │ ├── show-hint.css │ │ │ └── show-hint.js │ ├── skins │ │ └── kama │ │ │ ├── dialog.css │ │ │ ├── dialog_ie.css │ │ │ ├── dialog_ie7.css │ │ │ ├── dialog_ie8.css │ │ │ ├── dialog_iequirks.css │ │ │ ├── editor.css │ │ │ ├── editor_ie.css │ │ │ ├── editor_ie7.css │ │ │ ├── editor_ie8.css │ │ │ ├── editor_iequirks.css │ │ │ ├── icons.png │ │ │ ├── icons_hidpi.png │ │ │ ├── images │ │ │ ├── dialog_sides.gif │ │ │ ├── dialog_sides.png │ │ │ ├── dialog_sides_rtl.png │ │ │ ├── mini.gif │ │ │ ├── spinner.gif │ │ │ ├── sprites.png │ │ │ ├── sprites_ie6.png │ │ │ └── toolbar_start.gif │ │ │ └── readme.md │ ├── styles.js │ └── vendor │ │ └── promise.js ├── css │ ├── classes │ │ ├── dialog.css │ │ ├── drag.css │ │ ├── error.css │ │ ├── form.css │ │ ├── input.css │ │ ├── notification.css │ │ └── wrapper.css │ ├── colors │ │ └── default.css │ ├── font.css │ ├── style.css │ └── unset.css ├── fonts │ ├── 1.woff2 │ ├── 2.woff2 │ ├── 3.woff2 │ ├── 4.woff2 │ └── 5.woff2 ├── img │ └── icons │ │ ├── add.svg │ │ ├── aim.svg │ │ ├── arrow_down.svg │ │ ├── arrow_up.svg │ │ ├── close.svg │ │ ├── copy.svg │ │ ├── dropdown.svg │ │ ├── left.svg │ │ ├── logo.svg │ │ ├── logo_icon.svg │ │ ├── logout.svg │ │ ├── menu.svg │ │ ├── move.svg │ │ ├── paste.svg │ │ ├── preview.svg │ │ ├── right.svg │ │ ├── save.svg │ │ ├── settings.svg │ │ ├── trash.svg │ │ └── wait.svg └── js │ ├── component.js │ ├── drag.js │ ├── fetch.js │ ├── form_data.js │ ├── index.js │ ├── notify.js │ └── observer.js └── versions ├── 2024-03-04_21:27.zip ├── 2024-03-08_21:47.zip ├── 2024-03-09_14:57.zip ├── 2024-03-11.zip ├── 2024-03-15.zip ├── 2024-03-19.zip ├── 2024-03-29-contaminated.zip ├── 2024-03-30-contaminated.zip ├── 2024-04-01.zip ├── 2024-04-02.zip ├── 2024-04-03.zip ├── 2024-04-05.zip ├── 2024-04-29.zip ├── 2024-05-10.zip └── 2024-05-31.zip /.dockerignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .git 3 | 4 | old 5 | versions 6 | 7 | docker 8 | 9 | # env.php 10 | env.php.copy -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /tests 2 | env.php 3 | /.vscode 4 | /.sass-cache 5 | 6 | *.cache* -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteRule ^(.*)$ /index.php [L] 5 | 6 | RewriteCond %{REQUEST_URI} !^/static 7 | RewriteRule ^(.*)$ /index.php [L] 8 | -------------------------------------------------------------------------------- /application/controllers/!lib/include.php: -------------------------------------------------------------------------------- 1 | = 400 && $status < 600) $this->isError(); 12 | $this->status = $status; 13 | return $this; 14 | } 15 | 16 | private bool $error = false; 17 | function isError(bool $error = true): self{ 18 | $this->error = $error; 19 | return $this; 20 | } 21 | 22 | private $content = ""; 23 | function setContent($data): self{ 24 | $this->content = $data; 25 | return $this; 26 | } 27 | 28 | private string $header = "Content-Type: application/json"; 29 | function setHeader(string $header): self{ 30 | $this->header = $header; 31 | return $this; 32 | } 33 | 34 | function send_without_exit() { 35 | if(responded()) return; 36 | 37 | http_response_code($this->status); 38 | header($this->header); 39 | 40 | echo json_encode([ 41 | "content" => $this->content, 42 | "error" => $this->error 43 | ]); 44 | } 45 | function send() { 46 | $this->send_without_exit(); 47 | exit(); 48 | } 49 | }; 50 | 51 | function responded(): bool{ 52 | static $responded = false; 53 | if($responded) { 54 | return true; 55 | } 56 | $responded = true; 57 | return false; 58 | } -------------------------------------------------------------------------------- /application/controllers/!lib/request/verify.php: -------------------------------------------------------------------------------- 1 | setStatus(405) 14 | ->setContent("$request_method method is not allowed") 15 | ->send(); 16 | } 17 | return $this; 18 | } 19 | 20 | public function require_params(array $required_params): self { 21 | foreach ($required_params as $param) { 22 | if (!isset($_POST[$param])) { 23 | \request\response() 24 | ->setStatus(400) 25 | ->setContent("'$param' parameter is missing") 26 | ->send(); 27 | } 28 | } 29 | return $this; 30 | } 31 | 32 | public function require_url_params(array $required_params): self { 33 | foreach ($required_params as $param) { 34 | if (!isset($_GET[$param])) { 35 | \request\response() 36 | ->setStatus(400) 37 | ->setContent("'$param' url parameter is missing") 38 | ->send(); 39 | } 40 | } 41 | return $this; 42 | } 43 | 44 | public function require_session_token(): self { 45 | $session_token = $_SESSION['session_token'] ?? null; 46 | if ($session_token == null) { 47 | \request\response() 48 | ->setStatus(401) 49 | ->setContent("Session token is missing") 50 | ->send(); 51 | } 52 | 53 | $user_id = \db\sessions\get_user_id($session_token); 54 | if ($user_id == null) { 55 | \request\response() 56 | ->setStatus(401) 57 | ->setContent("Invalid session token") 58 | ->send(); 59 | } 60 | return $this; 61 | } 62 | }; -------------------------------------------------------------------------------- /application/controllers/admin/colors/add/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods("POST") 5 | ->require_params(["name"]); 6 | 7 | if(!\db\colors\add($_POST['name'])){ 8 | \request\response() 9 | ->setStatus(400) 10 | ->setContent("color already exists") 11 | ->send(); 12 | } 13 | 14 | \request\response() 15 | ->setContent("Successfully added color") 16 | ->send(); -------------------------------------------------------------------------------- /application/controllers/admin/colors/delete/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods("DELETE") 5 | ->require_params(["id"]); 6 | 7 | if(!\db\colors\delete($_POST['id'])){ 8 | \request\response() 9 | ->setStatus(400) 10 | ->setContent("cannot delete color palette") 11 | ->send(); 12 | } 13 | 14 | \request\response() 15 | ->setContent("Successfully deleted color") 16 | ->send(); -------------------------------------------------------------------------------- /application/controllers/admin/colors/edit/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods("POST") 5 | ->require_params(["id", "name", "colors"]); 6 | 7 | if(!\db\colors\edit($_POST['id'], $_POST['name'], $_POST['colors'])){ 8 | \request\response() 9 | ->setStatus(400) 10 | ->setContent("cannot use this name") 11 | ->send(); 12 | } 13 | 14 | \request\response() 15 | ->setContent("Successfully edited color") 16 | ->send(); -------------------------------------------------------------------------------- /application/controllers/admin/components/add/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["POST"]) 5 | ->require_params(["class_name"]); 6 | 7 | if(!\db\components\add($_POST['class_name'])){ 8 | \request\response() 9 | ->setStatus(400) 10 | ->setContent("Component already exists") 11 | ->send(); 12 | } 13 | 14 | \request\response() 15 | ->setContent("success") 16 | ->send(); 17 | -------------------------------------------------------------------------------- /application/controllers/admin/components/delete/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["DELETE"]) 5 | ->require_params(["id"]); 6 | 7 | if(!\db\components\delete($_POST['id'])){ 8 | \request\response() 9 | ->setStatus(400) 10 | ->setContent("page already exists") 11 | ->send(); 12 | } 13 | 14 | \request\response() 15 | ->setContent("success") 16 | ->send(); 17 | -------------------------------------------------------------------------------- /application/controllers/admin/components/edit/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["POST"]) 5 | ->require_params(["id", "class_name"]); 6 | 7 | if(!\db\components\edit($_POST["id"], $_POST["class_name"])) { 8 | \request\response() 9 | ->setStatus(400) 10 | ->setContent("error while updating page") 11 | ->send(); 12 | } 13 | 14 | \request\response() 15 | ->setContent("success") 16 | ->send(); 17 | -------------------------------------------------------------------------------- /application/controllers/admin/components/load/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["POST"]); 5 | 6 | \db\components\autoload(); 7 | 8 | \request\response() 9 | ->setContent("success") 10 | ->send(); 11 | -------------------------------------------------------------------------------- /application/controllers/admin/login/controller.php: -------------------------------------------------------------------------------- 1 | allowed_methods(["POST"]) 4 | ->require_params(["email", "password"]); 5 | 6 | $user_id = \db\user\login($_POST['email'], $_POST['password']); 7 | if($user_id == null) { 8 | \request\response() 9 | ->setStatus(400) 10 | ->setContent("Invalid email or password") 11 | ->send(); 12 | } 13 | 14 | $session_token = \db\sessions\get($user_id); 15 | $_SESSION['session_token'] = $session_token; 16 | \request\response() 17 | ->setContent(["session" => $session_token]) 18 | ->send(); -------------------------------------------------------------------------------- /application/controllers/admin/logout/controller.php: -------------------------------------------------------------------------------- 1 | setContent(["success" => true]) 7 | ->send(); 8 | -------------------------------------------------------------------------------- /application/controllers/admin/pages/add/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["POST"]) 5 | ->require_params(["page", "file", "order"]); 6 | 7 | if(!\db\pages\add($_POST['page'], $_POST['file'], $_POST['order'])){ 8 | \request\response() 9 | ->setStatus(400) 10 | ->setContent("page already exists") 11 | ->send(); 12 | } 13 | 14 | \request\response() 15 | ->setContent("success") 16 | ->send(); 17 | -------------------------------------------------------------------------------- /application/controllers/admin/pages/content/add/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["POST"]) 5 | ->require_params(["page_id", "class_name"]); 6 | 7 | $content = \components()->get_instance($_POST['class_name']); 8 | if(!\db\pages\content\add($_POST['page_id'], serialize($content))){ 9 | \request\response() 10 | ->setStatus(400) 11 | ->setContent("Error while adding content") 12 | ->send(); 13 | } 14 | 15 | \request\response() 16 | ->setContent("Content added") 17 | ->send(); -------------------------------------------------------------------------------- /application/controllers/admin/pages/content/delete/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["DELETE"]) 5 | ->require_params(["id"]); 6 | 7 | if(!\db\pages\content\delete($_POST["id"])){ 8 | \request\response() 9 | ->setStatus(404) 10 | ->setContent("Content not found") 11 | ->send(); 12 | } 13 | 14 | \request\response() 15 | ->setContent("Content deleted") 16 | ->send(); -------------------------------------------------------------------------------- /application/controllers/admin/pages/content/edit/controller.php: -------------------------------------------------------------------------------- 1 | allowed_methods(["POST"]) 4 | ->require_url_params(["id"]); 5 | 6 | $content = \db\pages\content\get_by_id($_GET["id"])[0]["content"]; 7 | $class_name = get_class_of_serialized($content); 8 | try{ 9 | $data = \components()->form_handler($class_name, $_POST); 10 | }catch(\Throwable $e){ 11 | ob_clean(); 12 | \request\response() 13 | ->setStatus(500) 14 | ->setContent($e->getMessage()) 15 | ->send(); 16 | } 17 | 18 | if(is_string($data) || get_class($data) != $class_name){ 19 | \request\response() 20 | ->setStatus(500) 21 | ->setContent("Handler response is not of type $class_name: $data") 22 | ->send(); 23 | } 24 | 25 | \db\pages\content\edit($_GET["id"], serialize($data)); 26 | 27 | \request\response() 28 | ->setContent("Edited successfully!") 29 | ->send(); -------------------------------------------------------------------------------- /application/controllers/admin/pages/content/get/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["GET"]) 5 | ->require_params(["page_id"]); 6 | 7 | ob_start(); 8 | $content = \components()->get_instance("admin_pages_content_form"); 9 | $content->page_id = $_POST["page_id"]; 10 | echo \components()->render($content); 11 | $html = ob_get_clean(); 12 | 13 | \request\response() 14 | ->setContent($html) 15 | ->send(); -------------------------------------------------------------------------------- /application/controllers/admin/pages/content/move/controller.php: -------------------------------------------------------------------------------- 1 | allowed_methods(["POST"]) 4 | ->require_params(["id", "after_id"]); 5 | 6 | $id = $_POST["id"]; 7 | $after_id = $_POST["after_id"]; 8 | \db\pages\content\move_after($id, $after_id); 9 | 10 | \request\response() 11 | ->setContent("Edited successfully!") 12 | ->send(); 13 | -------------------------------------------------------------------------------- /application/controllers/admin/pages/content/paste/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods('POST') 5 | ->require_params(['page_id', 'content_id']); 6 | 7 | $copied_id = $_POST['content_id']; 8 | $element = \db\pages\content\get_by_id($copied_id)[0] ?? null; 9 | if ($element === null) { 10 | \request\response() 11 | ->setStatus(400) 12 | ->setContent("Element do not exists") 13 | ->send(); 14 | } 15 | 16 | $content = $element['content']; 17 | $page_id = $_POST['page_id']; 18 | \db\pages\content\add($page_id, $content); 19 | 20 | \request\response() 21 | ->setContent("Pasted element") 22 | ->send(); -------------------------------------------------------------------------------- /application/controllers/admin/pages/delete/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["DELETE"]) 5 | ->require_params(["id"]); 6 | 7 | if(!\db\pages\delete($_POST['id'])){ 8 | \request\response() 9 | ->setStatus(400) 10 | ->setContent("page do not exists") 11 | ->send(); 12 | } 13 | 14 | \request\response() 15 | ->setContent("success") 16 | ->send(); 17 | -------------------------------------------------------------------------------- /application/controllers/admin/pages/edit/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["POST"]) 5 | ->require_params(["id", "page", "file", "order"]); 6 | 7 | if(!\db\pages\update($_POST['id'], $_POST['page'], $_POST['file'], $_POST['order'])){ 8 | \request\response() 9 | ->setStatus(400) 10 | ->setContent("error while updating page") 11 | ->send(); 12 | } 13 | 14 | \request\response() 15 | ->setContent([ 16 | "message" => "success", 17 | "new_link" => format_link($_POST['page']) 18 | ]) 19 | ->send(); 20 | -------------------------------------------------------------------------------- /application/controllers/admin/pages/head/update/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods("PUT") 5 | ->require_params(["page_id", "color_palette", "description", "icon", "image", "keywords", "title"]); 6 | 7 | $head = (new \head\IHead()) 8 | ->description($_POST['description']) 9 | // ->icon($_POST['icon']) 10 | ->icon(\components()->form_handler("image", $_POST['icon'])->get_src()) 11 | // ->image($_POST['image']) 12 | ->image(\components()->form_handler("image", $_POST['image'])->get_src()) 13 | ->keywords($_POST['keywords']) 14 | ->title($_POST['title']); 15 | $head = new \db\pages\head\IHead($head, $_POST['color_palette']); 16 | \db\pages\head\update($_POST['page_id'], $head); 17 | 18 | \request\response() 19 | ->setContent("Successfully updated page head.") 20 | ->send(); -------------------------------------------------------------------------------- /application/controllers/components/admin_render/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->allowed_methods(["GET"]) 5 | ->require_params(["class_name"]); 6 | 7 | ob_start(); 8 | if(isset($_GET['initializer'])){ 9 | $content = \components()->get_instance($_GET["class_name"], $_GET['initializer']); 10 | }else{ 11 | $content = \components()->get_instance($_GET["class_name"]); 12 | } 13 | 14 | echo \components()->admin_render($content); 15 | $html = ob_get_clean(); 16 | 17 | \request\response() 18 | ->setContent($html) 19 | ->send(); -------------------------------------------------------------------------------- /application/controllers/components/controller/controller.php: -------------------------------------------------------------------------------- 1 | allowed_methods(["POST"]) 4 | ->require_url_params(["component", "action"]); 5 | 6 | $response = \components()->use_controller($_GET["component"], $_GET["action"]); 7 | 8 | \request\response() 9 | ->setContent($response) 10 | ->send(); -------------------------------------------------------------------------------- /application/controllers/components/render/controller.php: -------------------------------------------------------------------------------- 1 | allowed_methods(["GET"]) 4 | ->require_params(["class_name"]); 5 | 6 | ob_start(); 7 | if(isset($_GET['initializer'])){ 8 | $content = \components()->get_instance($_GET["class_name"], $_GET['initializer']); 9 | }else{ 10 | $content = \components()->get_instance($_GET["class_name"]); 11 | // if(!isset($_GET['id'])) $content = \components()->get_instance($_GET["class_name"]); 12 | // else $content = unserialize(\db\pages\content\get_by_id($_GET['id'])['content']); 13 | } 14 | echo \components()->render($content); 15 | $html = ob_get_clean(); 16 | 17 | \request\response() 18 | ->setContent($html) 19 | ->send(); -------------------------------------------------------------------------------- /application/controllers/compress/controller.php: -------------------------------------------------------------------------------- 1 | allowed_methods(["GET"]) 4 | ->require_url_params(["url"]); 5 | 6 | $file = $_ENV['STATIC'].urldecode($_GET['url']??""); 7 | if(file_exists($file)){ 8 | $file_extension = pathinfo($file, PATHINFO_EXTENSION); 9 | if($file_extension === "js") $file_extension = "javascript"; 10 | header("Content-Type: text/$file_extension"); 11 | echo file_get_contents($file); 12 | }else{ 13 | header("HTTP/1.0 404 Not Found"); 14 | } 15 | -------------------------------------------------------------------------------- /application/controllers/compress/css/controller.php: -------------------------------------------------------------------------------- 1 | allowed_methods(["GET"]); 4 | 5 | header("Content-Type: text/css;"); 6 | echo $_SESSION["css"]; 7 | -------------------------------------------------------------------------------- /application/controllers/compress/js/controller.php: -------------------------------------------------------------------------------- 1 | allowed_methods(["GET"]); 4 | 5 | header("Content-Type: text/javascript;"); 6 | echo $_SESSION["js"]; 7 | -------------------------------------------------------------------------------- /application/controllers/include.php: -------------------------------------------------------------------------------- 1 | setStatus(404) 10 | ->setContent($_SERVER['REQUEST_URI'] . " not found") 11 | ->send(); 12 | } 13 | 14 | $success = @require_once $file; 15 | if(!$success) 16 | request\response() 17 | ->setStatus(500) 18 | ->setContent("Error: " . error_get_last()['message']) 19 | ->send(); 20 | 21 | // try{ 22 | // @require_once $file; 23 | // }catch(Throwable $e){ 24 | // request\response() 25 | // ->setStatus(500) 26 | // ->setContent("Error: " . $e->getMessage()) 27 | // ->send(); 28 | // } -------------------------------------------------------------------------------- /application/controllers/svg/controller.php: -------------------------------------------------------------------------------- 1 | require_url_params(["url", "color"]); 4 | 5 | function is_svg($file) { 6 | return preg_match('/\.svg$/i', $file); 7 | } 8 | 9 | $file = $_ENV['STATIC'].$_GET['url']; 10 | if(!file_exists($file)){ 11 | header("HTTP/1.0 404 Not Found"); 12 | exit(); 13 | } 14 | // if not svg just send it 15 | if(!is_svg($file)){ 16 | $extension = pathinfo($file, PATHINFO_EXTENSION); 17 | header("Content-Type: image/$extension"); 18 | echo file_get_contents($file); 19 | exit(); 20 | } 21 | $svg = @file_get_contents($file); 22 | header("Content-Type: image/svg+xml"); 23 | $color = $_GET['color']; 24 | if($color !== ""){ 25 | $svg = str_replace("#ffffff", $_GET['color'], $svg); 26 | $svg = str_replace("#000000", $_GET['color'], $svg); 27 | } 28 | echo $svg; 29 | exit(); -------------------------------------------------------------------------------- /application/include/components/admin_colors_form/admin_colors_form.css: -------------------------------------------------------------------------------- 1 | :wrap(.edit-form){ 2 | margin: 2rem 0; 3 | width: 100%; 4 | padding: 1.5rem; 5 | 6 | border-radius: 0.5rem; 7 | border: 1px solid var(--color-border-primary); 8 | box-sizing: border-box; 9 | 10 | display: flex; 11 | flex-direction: row; 12 | flex-wrap: wrap; 13 | } 14 | 15 | :wrap(h3){ 16 | margin: 0; 17 | margin-right: auto; 18 | } 19 | 20 | :wrap(.edit-form .button){ 21 | margin-left: auto; 22 | margin-top: auto; 23 | max-width: 100%; 24 | width: min-content; 25 | gap: 1rem; 26 | flex-direction: row; 27 | justify-content: end; 28 | } 29 | 30 | :wrap(.edit-form .button button){ 31 | max-width: 100%; 32 | } 33 | 34 | :wrap(.colors){ 35 | margin-top: 1rem; 36 | width: 100%; 37 | display: flex; 38 | justify-content: center; 39 | align-items: center; 40 | flex-direction: row; 41 | flex-wrap: wrap; 42 | gap: 1rem; 43 | } 44 | 45 | :wrap(.color){ 46 | width: 200px; 47 | padding: 0.5rem; 48 | box-sizing: border-box; 49 | border: 1px solid var(--color-border-primary); 50 | border-radius: 0.5rem; 51 | 52 | position: relative; 53 | display: flex; 54 | justify-content: center; 55 | align-items: center; 56 | flex-direction: row; 57 | flex-wrap: wrap; 58 | gap: 1rem; 59 | } 60 | 61 | :wrap(.color label){ 62 | 63 | font-size: 1rem; 64 | font-weight: 900; 65 | margin: 0; 66 | 67 | background-color: rgba(0, 0, 0, 0.5); 68 | height: 1rem; 69 | overflow: hidden; 70 | box-sizing: content-box; 71 | padding: 0.5rem; 72 | border-radius: 0.5rem; 73 | } 74 | 75 | :wrap(.color input){ 76 | margin: 0; 77 | width: 100%; 78 | height: 100%; 79 | 80 | position: absolute; 81 | top: 0; 82 | left: 0; 83 | right: 0; 84 | bottom: 0; 85 | z-index: 1; 86 | 87 | opacity: 0; 88 | } -------------------------------------------------------------------------------- /application/include/components/admin_colors_form/admin_colors_form.js: -------------------------------------------------------------------------------- 1 | function update_color(element){ 2 | const parent = element.parentElement; 3 | parent.style.backgroundColor = element.value; 4 | parent.setAttribute('data-color', element.value); 5 | return; 6 | } 7 | 8 | function remove_color_palette(id){ 9 | fetch_handle('/api/admin/colors/delete', { 10 | method: 'DELETE', 11 | body: JSON.stringify({ 12 | 'id': id 13 | }) 14 | }).then((response)=>{ 15 | notify(response, 'success'); 16 | document.querySelector(`.color-palette[data-id="${id}"]`).remove(); 17 | }); 18 | } 19 | 20 | function edit_color_palette(id){ 21 | const element = document.querySelector(`.color-palette[data-id="${id}"]`); 22 | const form_data = get_form_data(element); 23 | form_data['id'] = id; 24 | fetch_handle("/api/admin/colors/edit", { 25 | method: 'POST', 26 | body: JSON.stringify(form_data) 27 | }).then((response)=>{ 28 | notify(response, 'success'); 29 | }); 30 | } -------------------------------------------------------------------------------- /application/include/components/admin_colors_form/class.php: -------------------------------------------------------------------------------- 1 | { 8 | notify('Component deleted!', 'success'); 9 | const element = document.querySelector(`.${component_id} [data-id="${id}"]`); 10 | element.parentElement.remove(); 11 | }); 12 | } 13 | 14 | function edit_component(id){ 15 | const form = document.querySelector(`.edit-form[data-id="${id}"]`); 16 | const class_name = form.querySelector('[name=class_name]'); 17 | 18 | fetch_handle('/api/admin/components/edit', { 19 | method: 'POST', 20 | body: JSON.stringify({ 21 | 'id': id, 22 | 'class_name': class_name.value 23 | }) 24 | }).then(()=>{ 25 | notify('Page updated!', 'success'); 26 | }); 27 | } -------------------------------------------------------------------------------- /application/include/components/admin_components_form/class.php: -------------------------------------------------------------------------------- 1 | css_file("admin_components_form.css") 4 | ->js_file("admin_components_form.js"); 5 | 6 | $components = \db\components\get(); ?> 7 | -------------------------------------------------------------------------------- /application/include/components/admin_header_form/admin_header_form.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | max-width: 100%; 3 | } 4 | 5 | :wrap(.edit-form){ 6 | margin: 2rem 0; 7 | width: 100%; 8 | padding: 1.5rem; 9 | 10 | border-radius: 0.5rem; 11 | border: 1px solid var(--color-border-primary); 12 | box-sizing: border-box; 13 | 14 | display: flex; 15 | flex-direction: row; 16 | flex-wrap: wrap; 17 | } 18 | 19 | :wrap(.edit-form .button){ 20 | margin-left: auto; 21 | margin-top: auto; 22 | max-width: 100%; 23 | width: min-content; 24 | gap: 1rem; 25 | flex-direction: row; 26 | justify-content: end; 27 | } -------------------------------------------------------------------------------- /application/include/components/admin_header_form/admin_header_form.js: -------------------------------------------------------------------------------- 1 | function edit_head(id){ 2 | const element = document.getElementById(`edit-head-form-${id}`); 3 | const form_data = get_form_data(element); 4 | form_data['page_id'] = id; 5 | fetch_handle("/api/admin/pages/head/update", { 6 | method: 'PUT', 7 | body: JSON.stringify(form_data) 8 | }).then((response)=>{ 9 | notify(response, 'success'); 10 | }); 11 | } -------------------------------------------------------------------------------- /application/include/components/admin_header_form/class.php: -------------------------------------------------------------------------------- 1 | page_id = $page_id; 7 | } 8 | }; -------------------------------------------------------------------------------- /application/include/components/admin_pages_content_form/class.php: -------------------------------------------------------------------------------- 1 | page_id = $page_id; 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /application/include/components/admin_pages_form/class.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \components()->get_instance("article"); 4 | 5 | $component->text = \components()->form_handler("text", $content["text"] ?? []); 6 | 7 | return $component; -------------------------------------------------------------------------------- /application/include/components/article/admin/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__); 4 | ?> 5 | 6 |
7 |
8 | admin_render($content->text ?? \components()->get_instance("text")) ?> 9 |
10 | 18 |
-------------------------------------------------------------------------------- /application/include/components/article/article.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | max-width: 100%; 3 | width: 70rem; 4 | margin-left: auto; 5 | margin-right: auto; 6 | margin-top: 1rem; 7 | margin-bottom: 1rem; 8 | padding-left: 1rem; 9 | padding-right: 1rem; 10 | } 11 | 12 | :wrap(p), 13 | :wrap(h2){ 14 | margin: 0; 15 | color: var(--color-text-primary); 16 | text-wrap: wrap; 17 | overflow-wrap: break-word; 18 | } 19 | 20 | :wrap(h2){ 21 | font-size: 2rem; 22 | font-weight: 600; 23 | margin-bottom: 0.5rem; 24 | } 25 | 26 | :wrap(p){ 27 | font-size: 1.5rem; 28 | font-weight: 100; 29 | } -------------------------------------------------------------------------------- /application/include/components/article/class.php: -------------------------------------------------------------------------------- 1 | load_class("text"); 5 | class article{ 6 | public object $text; 7 | public function __construct(){ 8 | $this->text = \components()->get_instance("text"); 9 | } 10 | }; -------------------------------------------------------------------------------- /application/include/components/article/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoload": true, 3 | "test": true 4 | } -------------------------------------------------------------------------------- /application/include/components/article/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("article.css"); 5 | ?> 6 | 7 |
8 | render($content->text ?? \components()->get_instance("text")) ?> 9 |
-------------------------------------------------------------------------------- /application/include/components/button/admin/button.css: -------------------------------------------------------------------------------- 1 | #id>.type>*>.types, 2 | :wrap(.types){ 3 | display: none; 4 | } 5 | 6 | #id>.type>*>.types.show{ 7 | display: block!important; 8 | } 9 | -------------------------------------------------------------------------------- /application/include/components/button/admin/button.js: -------------------------------------------------------------------------------- 1 | function admin_button_select_type(element){ 2 | const parent = select_parent_component(element); 3 | const all_types = [...parent.querySelectorAll('.types')]; 4 | const except_types = all_types.map(e => [...e.querySelectorAll('.types')]).flat(); 5 | const types = all_types.filter(e => !except_types.includes(e)); 6 | types.map(e => 7 | e.getAttribute('data-name') === element.value ? 8 | e.classList.add('show'): 9 | e.classList.remove('show')); 10 | } 11 | -------------------------------------------------------------------------------- /application/include/components/button/admin/handler.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \components()->get_instance("button"); 4 | 5 | $component->set_text(\components()->form_handler("text", $content["text"] ?? [])); 6 | $content_type = $content["type"] ?? "button"; 7 | $component->set_type($content_type); 8 | 9 | $handlers = [ 10 | "link" => function (array $data){ 11 | return $data; 12 | }, 13 | "button" => function (array $data){ 14 | return $data; 15 | }, 16 | "dropdown" => function (array $data){ 17 | $new_data = ["children" => []]; 18 | $children = $data["children[]"] ?? []; 19 | foreach($children as $child){ 20 | $new_data["children"][] = \components()->form_handler("button", $child); 21 | } 22 | return $new_data; 23 | } 24 | ]; 25 | 26 | $component->set_type_data($handlers[$content_type]($content["types"][$content_type] ?? [])); 27 | 28 | return $component; -------------------------------------------------------------------------------- /application/include/components/button/admin/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("button.css") 5 | ->js_file("button.js"); 6 | ?> 7 | 8 |
9 |
10 | admin_render($content->get_text())?> 11 |
12 |
13 | 14 |
15 | 16 | 21 |
22 |
23 | set_content($content)?> 24 | 25 |
" data-name=""> 26 | 27 |
28 | 29 |
30 |
31 |
32 | -------------------------------------------------------------------------------- /application/include/components/button/admin/types/button/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $data = $content->get_type_data(); 4 | // onclick 5 | ?> 6 |
7 | 8 | " aria-label="onclick"> 9 |
-------------------------------------------------------------------------------- /application/include/components/button/admin/types/dropdown/dropdown.css: -------------------------------------------------------------------------------- 1 | #id .li{ 2 | border: 1px solid var(--color-border-primary); 3 | padding: 0.5rem; 4 | border-radius: 1rem; 5 | } 6 | 7 | #id .li:not(.show)>.content{ 8 | display: none; 9 | } 10 | 11 | #id .buttons{ 12 | display: flex; 13 | justify-content: center; 14 | align-items: center; 15 | flex-direction: row; 16 | gap: 1rem; 17 | } 18 | 19 | #id .toggle{ 20 | outline: 1px solid var(--color-info); 21 | } -------------------------------------------------------------------------------- /application/include/components/button/admin/types/dropdown/dropdown.js: -------------------------------------------------------------------------------- 1 | function admin_button_add_dropdown(button) { 2 | const ul = select_parent_component(button).querySelector('ul'); 3 | fetch_controller('button', 'add_dropdown').then(html => 4 | ul.insertAdjacentHTML('beforeend', format_html(html))); 5 | } -------------------------------------------------------------------------------- /application/include/components/button/admin/types/dropdown/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("dropdown.css") 5 | ->js_file("dropdown.js"); 6 | $data = $content->get_type_data(); 7 | // children 8 | ?> 9 | 10 |
11 |
12 | 13 |
14 | 36 |
-------------------------------------------------------------------------------- /application/include/components/button/admin/types/link/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $data = $content->get_type_data(); 4 | // href 5 | ?> 6 |
7 | 8 | 15 | 17 |
-------------------------------------------------------------------------------- /application/include/components/button/class.php: -------------------------------------------------------------------------------- 1 | load_class("text"); 14 | class button{ 15 | private object $text; 16 | public function get_text(): object { 17 | return $this->text ?? \components()->get_instance("text"); 18 | } 19 | public function set_text(mixed $text): self{ 20 | $this->text = is_string($text) ? 21 | \components()->get_instance("text")->set_text($text) : 22 | $text; 23 | return $this; 24 | } 25 | public function render_text(){ 26 | return \components()->render($this->get_text()); 27 | 28 | } 29 | 30 | private button_type $type = button_type::link; 31 | private array $data = []; 32 | 33 | public function get_type(): button_type { 34 | return $this->type; 35 | } 36 | public function set_type(string $type, array $data = []): self{ 37 | $this->type = button_type::from($type); 38 | $this->data = $data; 39 | return $this; 40 | } 41 | public function get_type_data(): array { 42 | return $this->data; 43 | } 44 | public function set_type_data(array $data): self{ 45 | $this->data = $data; 46 | return $this; 47 | } 48 | 49 | public function __construct() { 50 | $this->text = \components()->get_instance("text"); 51 | } 52 | }; -------------------------------------------------------------------------------- /application/include/components/button/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoload": false, 3 | "test": true 4 | } -------------------------------------------------------------------------------- /application/include/components/button/controllers/add_dropdown/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token(); 4 | ?> 5 |
  • 6 |
    7 | 12 | 17 |
    18 |
    19 | admin_render(\components()->get_instance("button"))?> 20 |
    21 |
  • -------------------------------------------------------------------------------- /application/include/components/button/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $type = $content->get_type()->value; 4 | require "types/$type/render.php"; 5 | -------------------------------------------------------------------------------- /application/include/components/button/types/button/button.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | transition: var(--transition); 3 | margin-top: 0.25rem!important; 4 | margin-bottom: 0.25rem!important; 5 | } 6 | 7 | #id:hover{ 8 | opacity: .6; 9 | } 10 | 11 | #id, 12 | #id *{ 13 | margin: 0; 14 | text-wrap: nowrap; 15 | font-weight: 900; 16 | font-size: 1rem; 17 | } -------------------------------------------------------------------------------- /application/include/components/button/types/button/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("button.css"); 5 | $data = $content->get_type_data() ?? []; 6 | ?> 7 | 8 | -------------------------------------------------------------------------------- /application/include/components/button/types/dropdown/dropdown.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | width: max-content; 3 | position: relative; 4 | } 5 | 6 | #id>.dropdown{ 7 | position: absolute; 8 | left: 50%; 9 | bottom: 0; 10 | transform: translateY(100%) translateX(-50%); 11 | 12 | padding: 1rem; 13 | border-radius: 0.5rem; 14 | background-color: var(--color-bg-primary); 15 | border: 1px solid var(--color-border-primary); 16 | transition: var(--transition); 17 | transition-delay: 0.1s; 18 | } 19 | 20 | #id:hover>.dropdown-button, 21 | #id:has(:focus)>.dropdown-button{ 22 | opacity: 0.6; 23 | } 24 | 25 | #id>.dropdown{ 26 | opacity: 0; 27 | z-index: -1; 28 | transform: translateY(calc(100% - 1rem)) translateX(-50%); 29 | pointer-events: none; 30 | } 31 | 32 | #id:hover>.dropdown, 33 | #id:has(:focus)>.dropdown{ 34 | opacity: 1; 35 | z-index: unset; 36 | transform: translateY(calc(100%)) translateX(-50%); 37 | pointer-events: all; 38 | } 39 | 40 | #id>.dropdown-button{ 41 | transition: var(--transition); 42 | transition-delay: 0; 43 | display: flex; 44 | justify-content: center; 45 | align-items: center; 46 | flex-direction: row; 47 | padding: 2px 0px; 48 | } 49 | 50 | #id>.dropdown-button>.dropdown-text, 51 | #id>.dropdown-button>.dropdown-text *{ 52 | margin: 0; 53 | text-wrap: nowrap; 54 | font-weight: 900; 55 | font-size: 1rem; 56 | } 57 | 58 | #id>.dropdown-button>.dropdown-icon{ 59 | margin: 0; 60 | margin-left: 5px; 61 | margin-top: auto; 62 | height: 1rem; 63 | } -------------------------------------------------------------------------------- /application/include/components/button/types/dropdown/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("dropdown.css"); 5 | $data = $content->get_type_data() ?? []; 6 | ?> 7 | 8 |
    9 | 17 | 25 |
    -------------------------------------------------------------------------------- /application/include/components/button/types/link/link.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | transition: var(--transition); 3 | margin-top: 0.25rem!important; 4 | margin-bottom: 0.25rem!important; 5 | } 6 | 7 | #id:hover{ 8 | opacity: .6; 9 | } 10 | 11 | #id, 12 | #id *{ 13 | margin: 0; 14 | text-wrap: nowrap; 15 | font-weight: 900; 16 | font-size: 1rem; 17 | } -------------------------------------------------------------------------------- /application/include/components/button/types/link/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("link.css"); 5 | $data = $content->get_type_data() ?? []; 6 | if(isset($data["href"])){ 7 | $link = $data["href"]; 8 | } else if(isset($data["page-id"])){ 9 | $pages = \db\pages\get_by_id($data["page-id"]); 10 | $link = $pages[0]["page"] ?? "#"; 11 | }else{ 12 | $link = "#"; 13 | } 14 | ?> 15 | 16 | 17 | 18 | render_text()?> 19 | -------------------------------------------------------------------------------- /application/include/components/caruosel/admin/caruosel.css: -------------------------------------------------------------------------------- 1 | :wrap(.li){ 2 | position: relative; 3 | padding: 1rem; 4 | border-radius: 0.5rem; 5 | border: 1px solid var(--color-border-primary); 6 | } 7 | 8 | :wrap(.buttons){ 9 | position: absolute; 10 | top: 1rem; 11 | right: 1rem; 12 | width: max-content; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /application/include/components/caruosel/admin/caruosel.js: -------------------------------------------------------------------------------- 1 | function caruosel_admin_add_slide(form) { 2 | const parent = select_parent_component(form); 3 | const ul = parent.querySelector('ul'); 4 | fetch_controller('caruosel', 'add_slide').then(html => 5 | ul.insertAdjacentHTML('beforeend', format_html(html)) 6 | ); 7 | } 8 | -------------------------------------------------------------------------------- /application/include/components/caruosel/admin/handler.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \components()->get_instance("caruosel"); 4 | 5 | foreach(($content["slides[]"]??[]) as $slide) { 6 | $component->slides[] = [ 7 | "text" => \components()->form_handler("text", $slide["text"] ?? []), 8 | "image" => \components()->form_handler("image", $slide["image"] ?? []) 9 | ]; 10 | } 11 | 12 | return $component; -------------------------------------------------------------------------------- /application/include/components/caruosel/admin/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("caruosel.css") 5 | ->js_file("caruosel.js"); 6 | ?> 7 | 8 |
    9 |
    10 |
    11 | 12 |
    13 |
    14 | 33 |
    -------------------------------------------------------------------------------- /application/include/components/caruosel/class.php: -------------------------------------------------------------------------------- 1 | load_class("text"); 5 | \components()->load_class("image"); 6 | class caruosel{ 7 | public array $slides = []; 8 | } -------------------------------------------------------------------------------- /application/include/components/caruosel/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoload": true, 3 | "test": true 4 | } -------------------------------------------------------------------------------- /application/include/components/caruosel/controllers/add_slide/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token(); 4 | ?> 5 | 6 |
  • 7 |
    8 | 13 |
    14 |
    15 | admin_render(\components()->get_instance("image"))?> 16 |
    17 |
    18 | admin_render(\components()->get_instance("text"))?> 19 |
    20 |
  • -------------------------------------------------------------------------------- /application/include/components/caruosel/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("caruosel.css") 5 | ->js_file("caruosel.js"); 6 | ?> 7 | 8 |
    9 | 29 |
    -------------------------------------------------------------------------------- /application/include/components/files/class.php: -------------------------------------------------------------------------------- 1 | dir = $dir; 7 | } 8 | }; -------------------------------------------------------------------------------- /application/include/components/files/controllers/create_directory/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->require_params(["path", "directory_name"]); 5 | 6 | $file = $_ENV['STATIC']; 7 | $file .= $_POST['path']."/".$_POST['directory_name']; 8 | mkdir($file); 9 | 10 | echo "success"; -------------------------------------------------------------------------------- /application/include/components/files/controllers/remove_directory/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->require_params(["path"]); 5 | 6 | $file = $_ENV['STATIC'].$_POST['path']; 7 | $thrown_error = !@rmdir($file); 8 | 9 | echo $thrown_error ? "directory is not empty" : "success"; 10 | 11 | -------------------------------------------------------------------------------- /application/include/components/files/controllers/remove_file/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->require_params(["path"]); 5 | 6 | $file = $_ENV['STATIC'].$_POST['path']; 7 | unlink($file); 8 | 9 | echo "success"; 10 | -------------------------------------------------------------------------------- /application/include/components/files/controllers/upload_file/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token() 4 | ->require_params(["file_name", "content"]); 5 | 6 | $file_name = $_ENV['STATIC'].$_POST["file_name"]; 7 | $file_content_as_dataUrl = $_POST["content"]; 8 | list($type, $data) = explode(';', $file_content_as_dataUrl); 9 | list(, $data) = explode(',', $data); 10 | $file_content = base64_decode($data); 11 | file_put_contents($file_name, $file_content); 12 | 13 | echo "success"; -------------------------------------------------------------------------------- /application/include/components/files/files.css: -------------------------------------------------------------------------------- 1 | :wrap(h3), 2 | :wrap(h4) { 3 | margin: 0; 4 | } 5 | 6 | :wrap(.form){ 7 | margin-left: auto; 8 | margin-right: auto; 9 | } 10 | 11 | :wrap(.file), 12 | :wrap(.directory){ 13 | display: flex; 14 | justify-content: center; 15 | align-items: center; 16 | flex-direction: row; 17 | } 18 | 19 | :wrap(.file .redirect), 20 | :wrap(.directory .redirect){ 21 | width: 100%; 22 | } -------------------------------------------------------------------------------- /application/include/components/footer/admin/handler.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \components()->get_instance("footer"); 4 | 5 | $component->icon = \components()->form_handler("image", $content["icon"] ?? []); 6 | $component->text = \components()->form_handler("text", $content["text"] ?? []); 7 | 8 | return $component; -------------------------------------------------------------------------------- /application/include/components/footer/admin/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__); 4 | ?> 5 | 6 |
    7 |
    8 | admin_render($content->icon)?> 9 |
    10 |
    11 | admin_render($content->text)?> 12 |
    13 |
    -------------------------------------------------------------------------------- /application/include/components/footer/class.php: -------------------------------------------------------------------------------- 1 | load_class("image") 5 | ->load_class("text"); 6 | class footer { 7 | public object $icon; 8 | public object $text; 9 | 10 | public function __construct() { 11 | $this->icon = \components()->get_instance("image"); 12 | $this->text = \components()->get_instance("text"); 13 | } 14 | } -------------------------------------------------------------------------------- /application/include/components/footer/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoload": true, 3 | "test": true 4 | } -------------------------------------------------------------------------------- /application/include/components/footer/footer.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | display: flex; 3 | justify-content: space-between; 4 | align-items: center; 5 | flex-direction: row; 6 | 7 | padding: 1rem; 8 | width: 100%; 9 | background-color: var(--color-bg-primary); 10 | 11 | border: 1px solid var(--color-border-primary); 12 | } 13 | 14 | :wrap(.icon){ 15 | width: 6rem; 16 | height: 3rem; 17 | margin-bottom: auto; 18 | } 19 | 20 | :wrap(.text){ 21 | max-width: calc(100% - 15rem); 22 | } 23 | 24 | #id .text p{ 25 | opacity: 0.7; 26 | } 27 | 28 | :wrap(.link){ 29 | margin-bottom: auto; 30 | width: 6rem; 31 | opacity: 0.7; 32 | } 33 | 34 | :wrap(.link a){ 35 | text-decoration: underline; 36 | } -------------------------------------------------------------------------------- /application/include/components/footer/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("footer.css"); 5 | ?> 6 | 7 | -------------------------------------------------------------------------------- /application/include/components/header/admin/handler.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \components()->get_instance("header"); 4 | 5 | $image = \components()->form_handler("image", $content["logo"]); 6 | $component->logo = $image->get_src(); 7 | $component->dropdowns = []; 8 | foreach ($content["dropdown[]"] as $dropdown) { 9 | $component->dropdowns[] = serialize(\components()->form_handler("button", $dropdown)); 10 | } 11 | 12 | return $component; -------------------------------------------------------------------------------- /application/include/components/header/admin/header.css: -------------------------------------------------------------------------------- 1 | :wrap([data-name="dropdown[]"]) { 2 | border-radius: 1rem; 3 | padding: 1rem; 4 | border: 1px solid var(--color-border-primary); 5 | margin-bottom: 1rem; 6 | } 7 | 8 | :wrap(.hidden){ 9 | max-height: 0; 10 | overflow-y: hidden; 11 | } 12 | 13 | :wrap(.toggle){ 14 | outline: 1px solid var(--color-info); 15 | } -------------------------------------------------------------------------------- /application/include/components/header/admin/header.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {HTMLElement} element 3 | */ 4 | function add_to_header_component_dropdown(element){ 5 | const parent = select_parent_component(element); 6 | const ul = parent.querySelector('[data-refresh=header] > ul'); 7 | fetch_controller("header", "add_dropdown") 8 | .then(html => { 9 | console.log(ul) 10 | ul.insertAdjacentHTML('beforeend', format_html(html)) 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /application/include/components/header/admin/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->js_file("header.js") 5 | ->css_file("header.css"); 6 | ?> 7 | 8 |
    9 |
    10 | 11 | admin_render(\components()->get_instance("image")->set_src($content->logo))?> 12 |
    13 |

    dropdowns

    14 |
    15 | 16 |
    17 | 39 |
    -------------------------------------------------------------------------------- /application/include/components/header/class.php: -------------------------------------------------------------------------------- 1 | require_session_token(); 4 | ?> 5 |
  • 6 |
    7 | 13 | 18 |
    19 | 22 |
  • -------------------------------------------------------------------------------- /application/include/components/header/header.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | display: flex; 3 | flex-direction: row; 4 | justify-content: space-between; 5 | align-items: center; 6 | width: 100%; 7 | padding: 1rem; 8 | background-color: var(--color-bg-primary); 9 | filter: brightness(120%); 10 | 11 | position: sticky; 12 | top: 0; 13 | z-index: 3; 14 | } 15 | 16 | :wrap(.dropdowns){ 17 | display: flex; 18 | flex-direction: row; 19 | justify-content: space-around; 20 | align-items: center; 21 | width: 100%; 22 | margin-left: 2rem; 23 | gap: 2rem; 24 | } 25 | 26 | :wrap(.icon-parent){ 27 | height: 1.5rem; 28 | } 29 | 30 | @media screen and (max-width: 576px) { 31 | :wrap(.dropdowns.hide){ 32 | opacity: 0; 33 | z-index: -1; 34 | margin-bottom: 1rem; 35 | } 36 | 37 | :wrap(.dropdowns){ 38 | transition: var(--transition); 39 | z-index: 9; 40 | margin: 0; 41 | 42 | transform: translateY(100%); 43 | position: absolute; 44 | bottom: 0; 45 | left: 0; 46 | 47 | background-color: var(--color-bg-primary); 48 | flex-direction: column; 49 | padding: 1rem; 50 | width: 100vw; 51 | } 52 | } 53 | 54 | @media screen and (min-width: 576px) { 55 | :wrap(.toggle_dropdowns){ 56 | opacity: 0; 57 | z-index: -1; 58 | } 59 | } -------------------------------------------------------------------------------- /application/include/components/header/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("header.css"); 5 | ?> 6 | 7 |
    8 |
    9 | render(\components()->get_instance("image")->set_src("/".$content->logo)->set_alt("logo"))?> 10 |
    11 | 16 | 19 |
    -------------------------------------------------------------------------------- /application/include/components/image/admin/handler.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \components()->get_instance('image'); 4 | 5 | $component->set_src($content['image'] ?? $component->get_src()); 6 | $component->set_alt($content['alt'] ?? $component->get_alt()); 7 | $component->set_style(array_flat(array_merge(array_map(function ($e){ 8 | if(!is_array($e)) return []; 9 | $e = array_flat($e); 10 | $e = array_filter($e, function($e) { return is_string($e); }); 11 | return [key($e) => $e[key($e)]] ?? []; 12 | }, $content['style[]'] ?? $component->get_style())))); 13 | 14 | return $component; -------------------------------------------------------------------------------- /application/include/components/image/admin/image.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | padding: 0; 3 | width: max-content; 4 | height: max-content; 5 | max-width: 100%; 6 | max-height: 100%; 7 | } 8 | 9 | :wrap(.image-button input){ 10 | display: none; 11 | } 12 | 13 | :wrap(.image-button){ 14 | background-color: transparent; 15 | border: none; 16 | box-shadow: none; 17 | -webkit-box-shadow: none; 18 | -moz-box-shadow: none; 19 | box-shadow: none; 20 | 21 | width: max-content; 22 | height: max-content; 23 | max-width: 100%; 24 | max-height: 100%; 25 | display: flex; 26 | } 27 | 28 | :wrap(.image-button img){ 29 | flex-grow: 1; 30 | object-fit: contain; 31 | min-width: 3rem; 32 | min-height: 3rem; 33 | width: 100%; 34 | height: 100%; 35 | max-width: 100%; 36 | max-height: 70vh; 37 | z-index: 1; 38 | } 39 | 40 | :wrap(.extra-button){ 41 | outline: 1px solid var(--color-info); 42 | } 43 | 44 | :wrap(.settings-btn){ 45 | width: 2rem; 46 | outline: 1px solid var(--color-success); 47 | } 48 | 49 | #id .settings-btn>*{ 50 | transition: var(--transition); 51 | } 52 | 53 | #id .settings-btn:hover>*{ 54 | rotate: 180deg; 55 | } -------------------------------------------------------------------------------- /application/include/components/image/class.php: -------------------------------------------------------------------------------- 1 | show_settings; 8 | } 9 | public function set_show_settings(bool $show_settings){ 10 | $this->show_settings = $show_settings; 11 | return $this; 12 | } 13 | 14 | public string $image = ''; 15 | public function get_src(){ 16 | return $this->image??""; 17 | } 18 | 19 | public function set_src($image){ 20 | $this->image = $image; 21 | return $this; 22 | } 23 | 24 | private string $alt = 'image cannot load'; 25 | public function get_alt(){ 26 | return $this->alt?? 'image cannot load'; 27 | } 28 | public function set_alt(string $alt){ 29 | $this->alt = $alt; 30 | return $this; 31 | } 32 | 33 | private array $style = []; 34 | public function get_style(){ 35 | return $this->style; 36 | } 37 | public function set_style(array $style){ 38 | $this->style = $style; 39 | return $this; 40 | } 41 | public function add_style(string $key, string $value){ 42 | $this->style[$key] = $value; 43 | return $this; 44 | } 45 | 46 | public function __construct(){ 47 | $this->image = ""; 48 | $this->alt = 'image cannot load'; 49 | } 50 | }; -------------------------------------------------------------------------------- /application/include/components/image/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoload": false, 3 | "test": true 4 | } -------------------------------------------------------------------------------- /application/include/components/image/controllers/select_image/style.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | position: fixed; 3 | top: 0; 4 | left: 0; 5 | width: 100vw; 6 | height: 100vh; 7 | background-color: var(--color-bg-primary); 8 | z-index: 2; 9 | overflow-y: auto; 10 | } 11 | 12 | :wrap(ul){ 13 | max-height: 100%; 14 | overflow-y: auto; 15 | } 16 | 17 | :wrap(.directorys li), 18 | :wrap(.images li){ 19 | border: 1px solid var(--color-border-primary); 20 | margin: 0.5rem; 21 | border-radius: 1rem; 22 | background-color: rgb(0, 0, 0, 0.1); 23 | } 24 | 25 | :wrap(.directorys li button){ 26 | width: 100%; 27 | padding: 0.5rem; 28 | height: 100%; 29 | font-size: 2rem; 30 | font-weight: 500; 31 | text-align: start; 32 | } 33 | 34 | 35 | :wrap(.images){ 36 | overflow-y: visible; 37 | display: flex; 38 | flex-direction: row; 39 | flex-wrap: wrap; 40 | justify-content: center; 41 | align-items: center; 42 | } 43 | 44 | :wrap(.images li){ 45 | padding: 1rem; 46 | } 47 | 48 | :wrap(.images img){ 49 | height: 5rem; 50 | max-width: 100%; 51 | } 52 | -------------------------------------------------------------------------------- /application/include/components/image/controllers/upload_image/controller.php: -------------------------------------------------------------------------------- 1 | require_session_token(); 4 | // TODO -------------------------------------------------------------------------------- /application/include/components/image/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | 4 | $page_id = $_SESSION['page_id'] ?? -1; 5 | if($page_id != -1){ 6 | $pallete = @\db\colors\get_by_page_id($page_id); 7 | $color = $pallete->colors["text-primary"]; 8 | }else{ 9 | $color = "#000000"; 10 | } 11 | $resouce_exists = file_exists($_ENV['STATIC'].$content->get_src()); 12 | $url_params = "url=".urlencode("/".$content->get_src())."&color=".urlencode($color); 13 | $alt = $content->get_alt(); 14 | $alt = str_replace('"', "'", $alt); 15 | 16 | $style = $content->get_style(); 17 | $style["height"] ??= "100%"; 18 | $style["width"] ??= "100%"; 19 | $style["object-fit"] ??= "contain"; 20 | $style = implode(";", array_map(function ($key, $value) { 21 | return "$key: $value"; 22 | }, array_keys($style), array_values($style))); 23 | ?> 24 | 25 | 27 | src="/api/svg?" 28 | 29 | alt="" 30 | style=""/> 31 | -------------------------------------------------------------------------------- /application/include/components/include.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \components()->get_instance("text"); 4 | 5 | $component->set_html($content["html"] ?? $component->get_html()); 6 | 7 | return $component; -------------------------------------------------------------------------------- /application/include/components/text/admin/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->js_file("text.js") 5 | ->css_file("text.css"); 6 | ?> 7 |
    8 | 9 |
    -------------------------------------------------------------------------------- /application/include/components/text/admin/text.css: -------------------------------------------------------------------------------- 1 | #id>div { 2 | padding: 0; 3 | border: 0; 4 | } -------------------------------------------------------------------------------- /application/include/components/text/admin/text.js: -------------------------------------------------------------------------------- 1 | setTimeout(() => { 2 | const textareas = [...document.querySelectorAll('.rtf-textarea')]; 3 | textareas.map((textarea) => { 4 | if(textarea.hasAttribute('data-rtf-name')) return; 5 | const rtf_textarea = CKEDITOR.replace(textarea); 6 | const instance_key = rtf_textarea.name; 7 | textarea.setAttribute('data-rtf-name', instance_key); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /application/include/components/text/class.php: -------------------------------------------------------------------------------- 1 | text; 8 | } 9 | public function set_html(string $text){ 10 | $this->text = $text; 11 | return $this; 12 | } 13 | public function set_text(string $text){ 14 | $this->text = $text; 15 | return $this; 16 | } 17 | }; -------------------------------------------------------------------------------- /application/include/components/text/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoload": false, 3 | "test": true 4 | } -------------------------------------------------------------------------------- /application/include/components/text/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $html = $content->get_html(); 4 | ?> 5 | -------------------------------------------------------------------------------- /application/include/components/title/admin/handler.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \components()->get_instance("title"); 4 | 5 | $component->title = $content["title"] ?? $component->title; 6 | 7 | return $component; -------------------------------------------------------------------------------- /application/include/components/title/admin/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__); 4 | ?> 5 | 6 |
    7 |
    8 | 9 | 10 |
    11 |
    -------------------------------------------------------------------------------- /application/include/components/title/class.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("title.css"); 5 | ?> 6 | 7 |

    title?>

    -------------------------------------------------------------------------------- /application/include/components/title/title.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | max-width: 100%; 3 | width: 70rem; 4 | margin-left: auto; 5 | margin-right: auto; 6 | margin-top: 1rem; 7 | margin-bottom: 1rem; 8 | 9 | color: var(--color-text-primary); 10 | text-wrap: wrap; 11 | overflow-wrap: break-word; 12 | 13 | font-size: 3rem; 14 | font-weight: 600; 15 | margin-bottom: 0.5rem; 16 | padding-left: 2rem; 17 | padding-right: 2rem; 18 | } -------------------------------------------------------------------------------- /application/include/components/title_image/admin/handler.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \components()->get_instance("title_image"); 4 | 5 | $component->image = \components()->form_handler("image", $content['image']??[]); 6 | $component->text = \components()->form_handler("text", $content['text']??[]); 7 | 8 | return $component; -------------------------------------------------------------------------------- /application/include/components/title_image/admin/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__); 4 | ?> 5 | 6 |
    7 |
    8 | admin_render($content->image ?? \components()->get_instance("image"));?> 9 |
    10 |
    11 | admin_render($content->text ?? \components()->get_instance("text"));?> 12 |
    13 |
    -------------------------------------------------------------------------------- /application/include/components/title_image/class.php: -------------------------------------------------------------------------------- 1 | load_class("image"); 5 | \components()->load_class("text"); 6 | class title_image{ 7 | public object $image; 8 | public object $text; 9 | 10 | public function __construct(){ 11 | $this->image = \components()->get_instance('image'); 12 | $this->text = \components()->get_instance('text'); 13 | } 14 | }; -------------------------------------------------------------------------------- /application/include/components/title_image/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoload": true, 3 | "test": true 4 | } -------------------------------------------------------------------------------- /application/include/components/title_image/render.php: -------------------------------------------------------------------------------- 1 | get_content(); 3 | $component = \component(__DIR__) 4 | ->css_file("title_image.css"); 5 | ?> 6 | 7 |
    8 | render($content->image ?? \components()->get_instance("image")) ?> 9 | text || $content->title) { ?> 10 |
    11 | render($content->text ?? \components()->get_instance("text"))?> 12 |
    13 | 14 |
    -------------------------------------------------------------------------------- /application/include/components/title_image/title_image.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | width: 100%; 3 | height: 95vh; 4 | max-height: 150vw; 5 | position: relative; 6 | /* background-color: var(--color-shadow-primary); */ 7 | } 8 | 9 | :wrap(img){ 10 | width: 100%; 11 | height: 100%; 12 | object-fit: cover; 13 | } 14 | 15 | :wrap(.container){ 16 | position: absolute; 17 | max-width: 50%; 18 | bottom: 1rem; 19 | left: 1rem; 20 | padding: 1rem; 21 | border-radius: 1rem; 22 | background-color: var(--color-bg-primary); 23 | opacity: 0.7; 24 | } 25 | 26 | :wrap(.container h3), 27 | :wrap(.container p){ 28 | margin: 0; 29 | color: var(--color-text-primary); 30 | } 31 | 32 | :wrap(.container h3){ 33 | font-size: 2rem; 34 | font-weight: 600; 35 | } 36 | 37 | :wrap(.container p){ 38 | font-size: 1rem; 39 | } -------------------------------------------------------------------------------- /application/include/db/basic_functions.php: -------------------------------------------------------------------------------- 1 | prepare($query); 5 | $stmt->execute($params); 6 | $result = $stmt->get_result(); 7 | return $result->fetch_all(MYSQLI_ASSOC); 8 | } 9 | 10 | function query(string $query, array $params = []) { 11 | $success = true; 12 | try{ 13 | $stmt = $GLOBALS["db"]->prepare($query); 14 | $stmt->execute($params); 15 | } catch(\Exception $e) { 16 | // echo $e->getMessage(); 17 | $success = false; 18 | } 19 | return $success; 20 | } -------------------------------------------------------------------------------- /application/include/db/config.php: -------------------------------------------------------------------------------- 1 | "; 11 | echo mysqli_connect_error(); 12 | exit(1); 13 | } 14 | mysqli_set_charset($db, "utf8"); 15 | $GLOBALS["db"] = &$db; 16 | 17 | require_once "basic_functions.php"; 18 | require_once "orm/orm.php"; 19 | require_once "functions/include.php"; 20 | 21 | // load tables 22 | require_once "init.tables.php"; -------------------------------------------------------------------------------- /application/include/db/functions/colors/colors.php: -------------------------------------------------------------------------------- 1 | id = $id; 11 | $this->name = $name; 12 | $this->colors = $colors->colors; 13 | } 14 | }; 15 | 16 | function add(string $name) { 17 | $default_colors = new \colors\IColors(); 18 | return \db\query("INSERT INTO `color_paletts` (`name`, `colors`) VALUES (?, ?)", [$name, serialize($default_colors)]); 19 | } 20 | 21 | function delete(int $id) { 22 | return \db\query("DELETE FROM `color_paletts` WHERE `id` = ?", [$id]); 23 | } 24 | 25 | function edit(int $id, string $name, array $colors) { 26 | $colors = new \colors\IColors($colors); 27 | return \db\query("UPDATE `color_paletts` SET `name` = ?, `colors` = ? WHERE `id` = ?", [$name, serialize($colors), $id]); 28 | } 29 | 30 | function get() { 31 | $result = \db\select("SELECT `id`, `name`, `colors` FROM `color_paletts`"); 32 | $result = array_map(function($row) { 33 | $row = new \db\colors\IColor($row['id'], $row['name'], unserialize($row['colors'])); 34 | return $row; 35 | }, $result); 36 | return $result; 37 | } 38 | 39 | function get_by_id(int $id) { 40 | $result = \db\select("SELECT `id`, `name`, `colors` FROM `color_paletts` WHERE `id` = ?", [$id]); 41 | $result = array_map(function($row) { 42 | $row = new \db\colors\IColor($row['id'], $row['name'], unserialize($row['colors'])); 43 | return $row; 44 | }, $result); 45 | return $result; 46 | } 47 | 48 | function get_by_page_id(int $page_id) { 49 | $head = \db\pages\head\get_by_page_id($page_id); 50 | $result = $head->get_colors(); 51 | return $result; 52 | } -------------------------------------------------------------------------------- /application/include/db/functions/components/components.php: -------------------------------------------------------------------------------- 1 | list_components(); 7 | foreach($elements as $element) { 8 | add($element); 9 | } 10 | } 11 | 12 | function add(string $class_name) { 13 | return \db\query("INSERT INTO `components` (`class_name`) VALUES (?)", [$class_name]); 14 | } 15 | 16 | function delete(int $id = -1) { 17 | if ($id == -1) return \db\query("DELETE FROM `components`"); 18 | return \db\query("DELETE FROM `components` WHERE `id` = ?", [$id]); 19 | } 20 | 21 | function edit(int $id, string $class_name) { 22 | return \db\query("UPDATE `components` SET `class_name` = ? WHERE `id` = ?", [$class_name, $id]); 23 | } 24 | 25 | function get() { 26 | return \db\select("SELECT `id`, `class_name` FROM `components`"); 27 | } 28 | 29 | function get_by_id(int $id) { 30 | return \db\select("SELECT `id`, `class_name` FROM `components` WHERE `id` = ?", [$id]); 31 | } 32 | -------------------------------------------------------------------------------- /application/include/db/functions/include.php: -------------------------------------------------------------------------------- 1 | color_palette_id); 10 | if(count($colors) === 0) $colors = \db\colors\get(); 11 | if(count($colors) === 0) { 12 | \db\colors\add("admin"); 13 | $colors = \db\colors\get(); 14 | } 15 | return $colors[0]; 16 | } 17 | 18 | function __construct(\head\IHead $head = null, int $color_palette_id = null) { 19 | $this->head = $head?? new \head\IHead(); 20 | $this->color_palette_id = $color_palette_id == null ? -1 : $color_palette_id; 21 | } 22 | } 23 | 24 | function add(int $page_id) { 25 | $content = serialize(new IHead()); 26 | return \db\query("INSERT INTO `pages_head` (`page_id`, `content`) VALUES (?, ?)", [$page_id, $content]); 27 | } 28 | 29 | function delete(int $page_id) { 30 | return \db\query("DELETE FROM `pages_head` WHERE `page_id` = ?", [$page_id]); 31 | } 32 | 33 | function update(int $page_id, IHead $content) { 34 | $content = serialize($content); 35 | add($page_id); 36 | return \db\query("UPDATE `pages_head` SET `content` = ? WHERE `page_id` = ?", [$content, $page_id]); 37 | } 38 | 39 | function get(){ 40 | $heads = \db\select("SELECT `page_id`, `content` FROM `pages_head`"); 41 | foreach($heads as &$head) $head['content'] = unserialize($head['content']); 42 | return $heads; 43 | } 44 | 45 | function get_by_page_id(int $page_id): IHead { 46 | $content = \db\select("SELECT `content` FROM `pages_head` WHERE `page_id` = ?", [$page_id]); 47 | $element = $content[0]['content'] ?? null; 48 | $default_head = new IHead(); 49 | return $element ? unserialize($element) : $default_head; 50 | } 51 | -------------------------------------------------------------------------------- /application/include/db/functions/pages/pages.php: -------------------------------------------------------------------------------- 1 | NOW() - INTERVAL 48 HOUR 15 | ORDER BY `session_start` DESC 16 | LIMIT 1", [$user_id])[0]['uuid'] ?? null; 17 | } 18 | 19 | function create(int $user_id) { 20 | \db\query("INSERT INTO `users_sessions` (`user_id`) VALUES (?)", [$user_id]); 21 | $uuid = select($user_id); 22 | return $uuid; 23 | } 24 | 25 | function get(int $user_id) { 26 | $uuid = select($user_id) ?? create($user_id); 27 | return $uuid; 28 | } 29 | 30 | function get_user_id(string $uuid) { 31 | return \db\select("SELECT `user_id` FROM `users_sessions` WHERE `uuid` = ?", [$uuid])[0]['user_id'] ?? null; 32 | } -------------------------------------------------------------------------------- /application/include/db/functions/user/user.php: -------------------------------------------------------------------------------- 1 | table = $table; 8 | } 9 | 10 | private array $where = []; 11 | private array $where_arguments = []; 12 | public function where(array ...$args) { 13 | $this->where = []; 14 | $this->where_arguments = []; 15 | foreach($args as $value) { 16 | if(count($value) === 0 || count($value) > 2) continue; 17 | if(!is_string($value[0])) continue; 18 | $this->where[] = $value[0]; 19 | if(count($value) === 1) continue; 20 | if(!is_array($value[1])) continue; 21 | $this->where_arguments = array_merge($this->where_arguments, $value[1]); 22 | } 23 | return $this; 24 | } 25 | 26 | private int $limit = 0; 27 | public function limit(int $limit): self { 28 | $this->limit = $limit; 29 | return $this; 30 | } 31 | private int $offset = 0; 32 | public function offset(int $offset): self { 33 | $this->offset = $offset; 34 | return $this; 35 | } 36 | 37 | public function run() { 38 | $table = $this->table; 39 | 40 | $where = implode(" AND ", $this->where); 41 | $where = empty($where) ? "" : " WHERE $where"; 42 | 43 | $limit = $this->limit > 0 ? " LIMIT $this->limit" : ""; 44 | $offset = $this->offset > 0 ? " OFFSET $this->offset" : ""; 45 | 46 | $query = "DELETE FROM $table $where $limit $offset;"; 47 | $arguments = $this->where_arguments; 48 | $is_error = !\db\query($query, $arguments); 49 | return $is_error; 50 | } 51 | }; 52 | 53 | -------------------------------------------------------------------------------- /application/include/db/orm/querys/functions.php: -------------------------------------------------------------------------------- 1 | 2) continue; 30 | $query[] = $arg[0]; 31 | } 32 | $query = implode(" AND ", $query); 33 | $arguments = []; 34 | foreach($args as $arg) { 35 | if(!is_array($arg)) continue; 36 | if(count($arg) !== 2) continue; 37 | if(!is_array($arg[1])) continue; 38 | $arguments = array_merge($arguments, $arg[1]); 39 | } 40 | return ["($query)", $arguments]; 41 | } 42 | 43 | function join_or(array ...$args) { 44 | $query = []; 45 | foreach($args as $arg) { 46 | if(!is_array($arg)) continue; 47 | if(count($arg) === 0 || count($arg) > 2) continue; 48 | $query[] = $arg[0]; 49 | } 50 | $query = implode(" OR ", $query); 51 | $arguments = []; 52 | foreach($args as $arg) { 53 | if(!is_array($arg)) continue; 54 | if(count($arg) !== 2) continue; 55 | if(!is_array($arg[1])) continue; 56 | $arguments = array_merge($arguments, $arg[1]); 57 | } 58 | return ["($query)", $arguments]; 59 | } -------------------------------------------------------------------------------- /application/include/db/orm/querys/index.php: -------------------------------------------------------------------------------- 1 | columns = $args; 9 | if(count($args) == 0) return; 10 | $this->table = explode(".", $args[0])[0]; 11 | } 12 | 13 | private array $values; 14 | public function values(string ...$args) { 15 | if(count($args) != count($this->columns)) 16 | throw new \Exception("Number of values must be equal to number of columns"); 17 | $this->values = $args; 18 | return $this; 19 | } 20 | 21 | public function run() { 22 | $table = $this->table; 23 | $columns = implode(",", $this->columns); 24 | 25 | $question_mark_array = array_fill(0, count($this->values), "?"); 26 | $question_marks = implode(", ", $question_mark_array); 27 | $query = "INSERT INTO $table($columns) VALUES ($question_marks);"; 28 | $is_error = !\db\query($query, $this->values); 29 | return $is_error; 30 | } 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /application/include/db/orm/structure/index.php: -------------------------------------------------------------------------------- 1 | get_instance($class_name, $content); 6 | $class_vars = class_to_vars_types($instance); 7 | 8 | foreach($class_vars as $key => $type){ 9 | $value = $content[$key] ?? null; 10 | // "array", 11 | // "object", 12 | // "resource", 13 | // "NULL", 14 | $default_types = [ 15 | "string", 16 | "integer", 17 | "double", 18 | "float", 19 | "boolean", 20 | ]; 21 | if(!in_array($type, $default_types) && is_string($type)){ 22 | $instance->{$key} = $value; 23 | continue; 24 | } 25 | if(!is_array($type)){ 26 | $instance->{$key} = \components()->form_handler($type, $instance->{$key}); 27 | continue; 28 | } 29 | if(is_array($type)){ 30 | // foreach($type as $i => $single_type){ // WRONG 31 | // $instance->{$key}[] = \components()->form_handler($single_type, $value[$i] ?? null); 32 | // } 33 | continue; 34 | } 35 | } 36 | 37 | return $instance; 38 | } 39 | -------------------------------------------------------------------------------- /application/include/lib/auto_admin/auto_handle.php: -------------------------------------------------------------------------------- 1 | 8 |
    9 | 10 |
    11 | colors = $colors; 10 | static $default_colors = [ 11 | "bg-primary" => "#1c1e23", 12 | "shadow-primary" => "#222234", 13 | "btn-primary" => "#222234", 14 | "text-primary" => "#fffeee", 15 | "border-primary" => "#303841", 16 | "success" => "#28a745", 17 | "warning" => "#ffc107", 18 | "error" => "#dc3545", 19 | "info" => "#17a2b8", 20 | ]; 21 | 22 | foreach ($default_colors as $key => $value) { 23 | $this->colors[$key] ??= $value; 24 | } 25 | } 26 | }; -------------------------------------------------------------------------------- /application/include/lib/component/class.php: -------------------------------------------------------------------------------- 1 | shown_js)) return $this; 21 | $this->shown_js[] = $path; 22 | 23 | $path = $this->parent_dir . $path; 24 | $js = file_get_contents($path); 25 | echo ""; 26 | return $this; 27 | } 28 | 29 | function css_id(): string { 30 | global $component_unique_class; 31 | return $component_unique_class . $this->id; 32 | } 33 | 34 | function css_file(string $path): self { 35 | global $component_class; 36 | $path = $this->parent_dir . $path; 37 | $this->css 38 | ->load_css_from_path($path) 39 | ->format($this->css_id(), $component_class) 40 | ->echo(); 41 | return $this; 42 | } 43 | 44 | function identifiers(): string { 45 | global $component_class; 46 | $class = "$component_class"; 47 | $id = $this->css_id(); 48 | return "$class $id"; 49 | } 50 | 51 | function __construct(string $dir) { 52 | $this->parent_dir = $dir; 53 | $id = $dir; 54 | $id = remove_shared_part_of_string($id, __DIR__); 55 | $id = ceasar_cipher($id, 13); 56 | $this->id = str_replace("/", "-", $id); // $this->id = $dir; 57 | $this->css = \css(); 58 | } 59 | } -------------------------------------------------------------------------------- /application/include/lib/component/component.php: -------------------------------------------------------------------------------- 1 | title("start?") 10 | // \head()->{'title'}("start?") // this does the same as line above 11 | // get_class_methods('\head\head'); // this shows all methods of \head\head -------------------------------------------------------------------------------- /application/include/lib/head/namespace.php: -------------------------------------------------------------------------------- 1 | icon); 8 | if(!empty($icon_as_datauri)){ 9 | $head .= ""; 10 | $head .= ""; 11 | $head .= ""; 12 | } 13 | $image_as_datauri = \image_to_datauri($_ENV["STATIC"].$this->image); 14 | if(!empty($image_as_datauri)){ 15 | $head .= ""; 16 | } 17 | $head .= "title\">"; 18 | $head .= "$this->title"; 19 | $head .= "description\">"; 20 | $head .= "description\">"; 21 | $head .= "keywords\">"; 22 | 23 | echo "$head"; 24 | } 25 | 26 | public string $icon = "-"; 27 | public function icon(string $icon): self { 28 | $this->icon = $icon; 29 | return $this; 30 | } 31 | 32 | public string $image = "-"; 33 | public function image(string $image): self { 34 | $this->image = $image; 35 | return $this; 36 | } 37 | 38 | public string $title = "-"; 39 | public function title(string $title): self { 40 | $this->title = $title; 41 | return $this; 42 | } 43 | 44 | public string $description = "-"; 45 | public function description(string $description): self { 46 | $this->description = $description; 47 | return $this; 48 | } 49 | 50 | public string $keywords = "-"; 51 | public function keywords(string $keywords): self { 52 | $this->keywords = $keywords; 53 | return $this; 54 | } 55 | } -------------------------------------------------------------------------------- /application/include/lib/include.php: -------------------------------------------------------------------------------- 1 | assertInstanceOf(LibreTranslate::class, $translate); 12 | } 13 | public function testCannotConnectToServer() : void 14 | { 15 | $this->expectException(\Exception::class); 16 | $translate = new LibreTranslate('translate.fortytwo-it.com','5005'); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /application/include/lib/libretranslate/lib/tests/fileTranslateTest.php: -------------------------------------------------------------------------------- 1 | translateFiles($file); 14 | print $translatedFileText; 15 | $this->assertIsString($translatedFileText); 16 | } 17 | 18 | public function testTranslateFile_InvalidFile():void{ 19 | $translate = new LibreTranslate('translate.fortytwo-it.com', 5000); 20 | 21 | $this->expectException(\Exception::class); 22 | $file = __DIR__ . "/test-file42.txt"; 23 | $translatedFileText = $translate->translateFiles($file); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /application/include/lib/libretranslate/lib/tests/initialTest.php: -------------------------------------------------------------------------------- 1 | serverSettings = $translate->Settings(); 16 | $this->assertIsArray($this->serverSettings, "Server settings unavailable"); 17 | } 18 | public function testRetrieveAvailableLanguages():void 19 | { 20 | $translate = new LibreTranslate('translate.fortytwo-it.com', 5000); 21 | $this->serverSettings = $translate->Languages(); 22 | $this->assertIsArray($this->serverSettings, "Server languages unavailable"); 23 | } 24 | 25 | 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /application/include/lib/libretranslate/lib/tests/ltmanageTest.php: -------------------------------------------------------------------------------- 1 | assertTrue($translate->canManage); 12 | } 13 | } -------------------------------------------------------------------------------- /application/include/lib/libretranslate/lib/tests/texttranslateTest.php: -------------------------------------------------------------------------------- 1 | detect("Mi nombre es Jefs42"); 12 | $this->assertEquals('es', $detect); 13 | } 14 | public function testTranslateText_AvailableLanguages():void 15 | { 16 | $translate = new LibreTranslate('translate.fortytwo-it.com', 5000); 17 | $text = $translate->translate("My name is Jefs42"); 18 | $this->assertEquals('Mi nombre es Jefs42', $text); 19 | } 20 | public function testTranslateMultipeTexts():void 21 | { 22 | $translate = new LibreTranslate('translate.fortytwo-it.com', 5000); 23 | $text = $translate->translate(["My name is Jefs42","Where is the bathroom"]); 24 | $this->assertIsArray($text, "Response is not an array"); 25 | 26 | } 27 | public function testTranslateText_UnsupportedLanguage():void 28 | { 29 | $this->expectException(\Exception::class); 30 | $translate = new LibreTranslate('translate.fortytwo-it.com', 5000); 31 | $text = $translate->translate("My name is Jefs42",'en','da'); 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /application/include/lib/libretranslate/libretranslate.php: -------------------------------------------------------------------------------- 1 | data[$name])){ 7 | return $this->data[$name]; 8 | } 9 | } 10 | 11 | public function __set($name, $value){ 12 | $this->data[$name] = $value; 13 | } 14 | public function __construct() {} 15 | } -------------------------------------------------------------------------------- /application/include/lib/object_to_types/object_to_types.php: -------------------------------------------------------------------------------- 1 | 0) 21 | return $empty_response; 22 | } 23 | return [$key => $type]; 24 | }, array_keys($vars), array_values($vars)); 25 | $types = array_merge(...$types); 26 | return $types; 27 | } -------------------------------------------------------------------------------- /application/index.php: -------------------------------------------------------------------------------- 1 | console.log($args)"; 9 | } 10 | ob_start(); 11 | require_once __DIR__ . "/index.php"; 12 | $html = ob_get_clean(); 13 | $html = \display_site($html); 14 | 15 | echo $html; 16 | -------------------------------------------------------------------------------- /application/site/lib/!display_site/!display_site.php: -------------------------------------------------------------------------------- 1 | admin_mode(); 4 | \component(__DIR__) 5 | ->js_file("admin.js"); 6 | 7 | \head() 8 | ->title("admin") 9 | ->description("admin panel") 10 | ->icon("/static/img/icons/logo_icon.svg") 11 | ->image("/static/img/icons/logo_icon.svg") 12 | ->echo(); 13 | 14 | if($_SESSION['route'] == "/admin/login"){ 15 | require_once "login/login.php"; 16 | return; 17 | } 18 | \admin()->auth(); 19 | ob_start(); 20 | require_once "admin_pages/index.php"; 21 | $content = ob_get_clean(); 22 | wrap_admin($content); 23 | -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/cms/files/page.php: -------------------------------------------------------------------------------- 1 | 4 |
    5 |

    Files

    6 | render(\components()->get_instance("files"))?> 7 |
    8 | -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/frontend/colors/colors.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | width: 100%; 3 | } 4 | 5 | :wrap(.create-form){ 6 | border-radius: 0.5rem; 7 | border: 1px solid var(--color-border-primary); 8 | 9 | max-width: 100%; 10 | padding: 1rem; 11 | width: min-content; 12 | 13 | margin-left: auto; 14 | margin-right: auto; 15 | 16 | display: flex; 17 | flex-direction: column; 18 | justify-content: center; 19 | align-items: center; 20 | } 21 | 22 | :wrap(h2){ 23 | font-size: 1.5rem; 24 | font-weight: 600; 25 | 26 | color: var(--color-text-primary); 27 | width: 100%; 28 | } 29 | -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/frontend/colors/colors.js: -------------------------------------------------------------------------------- 1 | function add_color(id){ 2 | const form = document.getElementById(`create-color-${id}`); 3 | const name = form.querySelector('[name=name]'); 4 | 5 | fetch_handle('/api/admin/colors/add', { 6 | method: 'POST', 7 | body: JSON.stringify({ 8 | 'name': name.value 9 | }) 10 | }).then((response)=> { 11 | name.value = ''; 12 | notify(response, 'success'); 13 | fetch_refresh("admin_colors_form"); 14 | }); 15 | } -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/frontend/colors/page.php: -------------------------------------------------------------------------------- 1 | css_file("colors.css") 4 | ->js_file("colors.js"); 5 | ?> 6 | 7 |
    8 |
    9 |
    10 |

    Create color palette

    11 |
    12 |
    13 | 15 |
    16 |
    17 | 18 |
    19 |
    20 | render(\components()->get_instance("admin_colors_form"));?> 21 |
    -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/frontend/components/components.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | width: 100%; 3 | } 4 | 5 | :wrap(.create-form){ 6 | border-radius: 0.5rem; 7 | border: 1px solid var(--color-border-primary); 8 | 9 | max-width: 100%; 10 | padding: 1rem; 11 | width: min-content; 12 | 13 | margin-left: auto; 14 | margin-right: auto; 15 | 16 | display: flex; 17 | flex-direction: column; 18 | justify-content: center; 19 | align-items: center; 20 | } 21 | 22 | :wrap(h2){ 23 | font-size: 1.5rem; 24 | font-weight: 600; 25 | 26 | color: var(--color-text-primary); 27 | width: 100%; 28 | } 29 | 30 | :wrap(.info){ 31 | margin-top: 0.5rem; 32 | border-color: var(--color-info)!important; 33 | } -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/frontend/components/components.js: -------------------------------------------------------------------------------- 1 | function add_component(id){ 2 | const form = document.getElementById(`create-component-${id}`); 3 | const class_name = form.querySelector('[name=class_name]'); 4 | 5 | fetch_handle('/api/admin/components/add', { 6 | method: 'POST', 7 | body: JSON.stringify({ 8 | 'class_name': class_name.value 9 | }) 10 | }).then(()=> { 11 | class_name.value = ''; 12 | notify('Components added!', 'success'); 13 | fetch_refresh("admin_components_form"); 14 | }); 15 | } 16 | 17 | function auto_load_components(){ 18 | fetch_format("/api/admin/components/load", { 19 | method: 'POST', 20 | }).then((data) => notify(data, 'success')) 21 | .then(()=> fetch_refresh("admin_components_form")); 22 | } -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/frontend/components/page.php: -------------------------------------------------------------------------------- 1 | css_file("components.css") 4 | ->js_file("components.js"); 5 | ?> 6 | 7 |
    8 |
    9 |
    10 |

    Create Component

    11 |

    17 | IMPORTANT 18 |
    19 | if you dont know what you are doing click "Auto load" and do not add or edit any components manually 20 | 21 |

    22 |
    23 |
    24 | 26 |
    27 |
    28 | 29 | 30 |
    31 |
    32 | render(\components()->get_instance("admin_components_form"));?> 33 |
    -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/frontend/pages/page.php: -------------------------------------------------------------------------------- 1 | css_file("pages.css") 4 | ->js_file("pages.js"); 5 | echo ""; 6 | ?> 7 | 8 |
    9 |
    10 |
    11 |

    Create Page

    12 |
    13 |
    14 | 16 |
    17 | 21 | 25 |
    26 | 27 |
    28 |
    29 | render(\components()->get_instance("admin_pages_form"))?> 30 |
    -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/frontend/pages/pages.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | width: 100%; 3 | } 4 | 5 | :wrap(.create-form){ 6 | border-radius: 0.5rem; 7 | border: 1px solid var(--color-border-primary); 8 | 9 | max-width: 100%; 10 | padding: 1rem; 11 | width: min-content; 12 | 13 | margin-left: auto; 14 | margin-right: auto; 15 | 16 | display: flex; 17 | flex-direction: column; 18 | justify-content: center; 19 | align-items: center; 20 | } 21 | 22 | :wrap(h2){ 23 | font-size: 1.5rem; 24 | font-weight: 600; 25 | 26 | color: var(--color-text-primary); 27 | width: 100%; 28 | } -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/frontend/pages/pages.js: -------------------------------------------------------------------------------- 1 | function add_page(id){ 2 | const form = document.getElementById(`create-page-${id}`); 3 | const page = form.getElementsByClassName('page-name')[0]; 4 | const file = form.getElementsByClassName('page-file')[0]; 5 | const order = form.getElementsByClassName('page-order')[0]; 6 | 7 | fetch_handle('/api/admin/pages/add', { 8 | method: 'POST', 9 | body: JSON.stringify({ 10 | 'page': page.value, 11 | 'file': file.value, 12 | 'order': order.value 13 | }) 14 | }).then(()=> { 15 | page.value = ''; 16 | notify('Page created!', 'success'); 17 | fetch_refresh("admin_pages_form"); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /application/site/pages/admin/admin_pages/index.php: -------------------------------------------------------------------------------- 1 | css_file("main_page.css"); 4 | ?> 5 | 6 |
    7 |

    Welcome to CMS

    8 |
    -------------------------------------------------------------------------------- /application/site/pages/admin/admin_wrapper/admin_wrapper.css: -------------------------------------------------------------------------------- 1 | #id{ 2 | width: 100vw; 3 | min-height: 100vh; 4 | max-height: 100vh; 5 | display: flex; 6 | flex-direction: column; 7 | 8 | background-color: var(--color-bg-primary); 9 | } 10 | 11 | /* header */ 12 | :wrap(.header){ 13 | background-color: #00000005; 14 | border-bottom: 1px solid var(--color-border-primary); 15 | } 16 | 17 | /* content */ 18 | :wrap(.content) { 19 | background-color: #ffffff05; 20 | width: 100%; 21 | height: 100%; 22 | flex-grow: 1; 23 | overflow-y: auto; 24 | 25 | padding: 40px; 26 | } 27 | 28 | @media screen and (max-width: 576px) { 29 | :wrap(.content) { 30 | padding: 10px; 31 | } 32 | } -------------------------------------------------------------------------------- /application/site/pages/admin/admin_wrapper/admin_wrapper.js: -------------------------------------------------------------------------------- 1 | function toggle_sidebar() { 2 | document.getElementById("sidebar").classList.toggle("hidden"); 3 | } -------------------------------------------------------------------------------- /application/site/pages/admin/admin_wrapper/header/header.css: -------------------------------------------------------------------------------- 1 | #id { 2 | width: 100vw; 3 | padding: 1rem; 4 | 5 | -webkit-box-shadow: 0px 0px 5rem 1rem var(--color-shadow-primary); 6 | -moz-box-shadow: 0px 0px 5rem 1rem var(--color-shadow-primary); 7 | box-shadow: 0px 0px 5rem 1rem var(--color-shadow-primary); 8 | } 9 | 10 | :wrap(nav){ 11 | width: 100%; 12 | } 13 | 14 | :wrap(.row){ 15 | width: 100%; 16 | display: flex; 17 | } 18 | 19 | :wrap(.row.top){ 20 | position: relative; 21 | justify-content: space-between; 22 | } 23 | 24 | :wrap(.logo img), 25 | :wrap(.logout img){ 26 | height: 2rem; 27 | max-width: 100%; 28 | } 29 | 30 | :wrap(.logo), 31 | :wrap(.logout){ 32 | position: absolute; 33 | } 34 | 35 | :wrap(.logo){ 36 | left: 0; 37 | } 38 | 39 | :wrap(.logout){ 40 | right: 0; 41 | transition: var(--transition); 42 | } 43 | 44 | :wrap(.logout:hover){ 45 | scale: 1.05; 46 | } 47 | 48 | :wrap(.title){ 49 | color: var(--color-text-primary); 50 | font-size: 1.5rem; 51 | font-weight: 900; 52 | text-align: center; 53 | text-transform: uppercase; 54 | 55 | margin-left: auto; 56 | margin-right: auto; 57 | } 58 | 59 | :wrap(.logout){ 60 | position: absolute; 61 | right: 0; 62 | } 63 | 64 | :wrap(.row.dropdowns){ 65 | justify-content: center; 66 | flex-direction: row; 67 | gap: 2rem; 68 | } 69 | 70 | :wrap(.row.dropdowns li){ 71 | flex-basis: 100px; 72 | 73 | display: flex; 74 | justify-content: center; 75 | align-items: center; 76 | } -------------------------------------------------------------------------------- /application/site/pages/admin/admin_wrapper/header/header.js: -------------------------------------------------------------------------------- 1 | ; -------------------------------------------------------------------------------- /application/site/pages/admin/include.php: -------------------------------------------------------------------------------- 1 | auth_require_session_token(); 29 | } 30 | 31 | public function logout(): self { 32 | unset($_SESSION['session_token']); 33 | return $this; 34 | } 35 | } -------------------------------------------------------------------------------- /application/site/pages/admin/lib/include.php: -------------------------------------------------------------------------------- 1 | 0){ 17 | return "user already exists"; 18 | } 19 | 20 | db\query("INSERT INTO waiting_users (email) VALUES (?)", [$email]); 21 | $user_uuid = db\select("SELECT uuid FROM waiting_users WHERE email = ?", [$email])[0]['uuid']; 22 | 23 | send_mail($email, "php cms - email verification", $_SERVER['SERVER_NAME'] . "/admin/?page=confirm_user&uuid=$user_uuid"); 24 | 25 | return "success"; 26 | } 27 | -------------------------------------------------------------------------------- /application/site/pages/admin/lib/user/user.php: -------------------------------------------------------------------------------- 1 | { 13 | window.location = "/admin"; 14 | }) 15 | .catch((content)=>{ 16 | const elements = [email, password]; 17 | elements.map((element) => { 18 | element.value = ""; 19 | element.blur(); 20 | element.classList.add("invalid"); 21 | element.addEventListener("focus", () => email.classList.remove("invalid")); 22 | }); 23 | return; 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /application/site/pages/admin/login/login.php: -------------------------------------------------------------------------------- 1 | logout(); 3 | 4 | $component = \component(__DIR__) 5 | ->css_file("login.css") 6 | ->js_file("login.js"); 7 | ?> 8 | 9 |
    10 |
    11 |
    12 |

    Login to cms

    13 |
    14 |
    15 | 17 |
    18 |
    19 | 21 |
    22 |
    23 | 24 |
    25 |
    26 |
    27 | -------------------------------------------------------------------------------- /application/site/pages/menager.php: -------------------------------------------------------------------------------- 1 | render($page_content['content']); 8 | } 9 | 10 | // use Jefs42\LibreTranslate; 11 | // $translator = new LibreTranslate(); 12 | // echo $translator->translate("Hello World", "en", "es"); -------------------------------------------------------------------------------- /docker/deploy/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | services: 3 | front: 4 | build: 5 | context: ${PWD} 6 | dockerfile: docker/deploy/dockerfile 7 | ports: 8 | - "${PORT}:80" 9 | depends_on: 10 | - db 11 | environment: 12 | - ENABLE_ADMIN=true 13 | - DEBUG=true 14 | - LOAD_DEFAULT_DATABASE_CONFIG=true 15 | 16 | - DB_ADDRESS=db:3306 17 | - DB_DATABASE=cms 18 | - DB_USER=cms 19 | - DB_PASSWORD=cms 20 | 21 | - ROOT_EMAIL=root@gmail.com 22 | - ROOT_PASSWORD=root 23 | db: 24 | image: mysql:8.0.27 25 | environment: 26 | - MYSQL_ROOT_PASSWORD=root 27 | - MYSQL_DATABASE=cms 28 | - MYSQL_USER=cms 29 | - MYSQL_PASSWORD=cms 30 | - MYSQL_PORT=3306 31 | -------------------------------------------------------------------------------- /docker/deploy/dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-cli 2 | 3 | WORKDIR /app 4 | 5 | COPY . . 6 | 7 | EXPOSE 80 8 | 9 | RUN docker-php-ext-install mysqli 10 | 11 | CMD ["php", "-S", "0.0.0.0:80"] -------------------------------------------------------------------------------- /docker/dev/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | services: 3 | front: 4 | build: 5 | context: ${PWD} 6 | dockerfile: docker/dev/dockerfile 7 | ports: 8 | - "${PORT}:80" 9 | depends_on: 10 | - db 11 | environment: 12 | - ENABLE_ADMIN=true 13 | - DEBUG=true 14 | - LOAD_DEFAULT_DATABASE_CONFIG=true 15 | 16 | - DB_ADDRESS=db:3306 17 | - DB_DATABASE=cms 18 | - DB_USER=cms 19 | - DB_PASSWORD=cms 20 | 21 | - ROOT_EMAIL=root@gmail.com 22 | - ROOT_PASSWORD=root 23 | volumes: 24 | - type: bind 25 | source: ${PWD} 26 | target: /app 27 | db: 28 | image: mysql:8.0.27 29 | environment: 30 | - MYSQL_ROOT_PASSWORD=root 31 | - MYSQL_DATABASE=cms 32 | - MYSQL_USER=cms 33 | - MYSQL_PASSWORD=cms 34 | - MYSQL_PORT=3306 35 | -------------------------------------------------------------------------------- /docker/dev/dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-cli 2 | 3 | WORKDIR /app 4 | 5 | EXPOSE 80 6 | 7 | RUN docker-php-ext-install mysqli 8 | 9 | CMD ["php", "-S", "0.0.0.0:80"] -------------------------------------------------------------------------------- /env.php.copy: -------------------------------------------------------------------------------- 1 | = 8.1 3 | if(file_exists(__DIR__."/env.php")) 4 | include "env.php"; 5 | $_ENV["STATIC"] = __DIR__."/static/"; 6 | require_once "application/index.php"; 7 | 8 | 9 | // create root account 10 | if(isset($_ENV["ROOT_EMAIL"]) && 11 | isset($_ENV["ROOT_PASSWORD"])) 12 | \db\user\create_account( 13 | $_ENV["ROOT_EMAIL"], 14 | $_ENV["ROOT_PASSWORD"] 15 | ); -------------------------------------------------------------------------------- /readme/cms-first-run.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/readme/cms-first-run.webm -------------------------------------------------------------------------------- /readme/play-btn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/ckeditor/README.md: -------------------------------------------------------------------------------- 1 | CKEditor 4 2 | ========== 3 | 4 | Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. 5 | https://ckeditor.com - See https://ckeditor.com/legal/ckeditor-oss-license for license information. 6 | 7 | CKEditor 4 is a text editor to be used inside web pages. It's not a replacement 8 | for desktop text editors like Word or OpenOffice, but a component to be used as 9 | part of web applications and websites. 10 | 11 | ## Documentation 12 | 13 | The full editor documentation is available online at the following address: 14 | https://ckeditor.com/docs/ 15 | 16 | ## Installation 17 | 18 | Installing CKEditor is an easy task. Just follow these simple steps: 19 | 20 | 1. **Download** the latest version from the CKEditor website: 21 | https://ckeditor.com. You should have already completed this step, but be 22 | sure you have the very latest version. 23 | 2. **Extract** (decompress) the downloaded file into the root of your website. 24 | 25 | **Note:** CKEditor is by default installed in the `ckeditor` folder. You can 26 | place the files in whichever you want though. 27 | 28 | ## Checking Your Installation 29 | 30 | The editor comes with a few sample pages that can be used to verify that 31 | installation proceeded properly. Take a look at the `samples` directory. 32 | 33 | To test your installation, just call the following page at your website: 34 | 35 | http:////samples/index.html 36 | 37 | For example: 38 | 39 | http://www.example.com/ckeditor/samples/index.html 40 | -------------------------------------------------------------------------------- /static/ckeditor/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting a security issues 2 | 3 | If you believe you have found a security issue in the CKEditor 4 software, please contact us immediately. 4 | 5 | When reporting a potential security problem, please bear this in mind: 6 | 7 | * Make sure to provide as many details as possible about the vulnerability. 8 | * Please do not disclose publicly any security issues until we fix them and publish security releases. 9 | 10 | Contact the security team at security@cksource.com. As soon as we receive the security report, we will work promptly to confirm the issue and then to provide a security fix. 11 | -------------------------------------------------------------------------------- /static/ckeditor/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. 3 | * For licensing, see https://ckeditor.com/legal/ckeditor-oss-license 4 | */ 5 | 6 | CKEDITOR.editorConfig = function( config ) { 7 | // Define changes to default configuration here. 8 | // For complete reference see: 9 | // https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html 10 | 11 | // The toolbar groups arrangement, optimized for two toolbar rows. 12 | config.toolbarGroups = [ 13 | { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, 14 | { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] }, 15 | { name: 'links' }, 16 | { name: 'insert' }, 17 | { name: 'forms' }, 18 | { name: 'tools' }, 19 | { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, 20 | { name: 'others' }, 21 | '/', 22 | { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, 23 | { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, 24 | { name: 'styles' }, 25 | { name: 'colors' }, 26 | { name: 'about' } 27 | ]; 28 | 29 | // Remove some buttons provided by the standard plugins, which are 30 | // not needed in the Standard(s) toolbar. 31 | config.removeButtons = 'Underline,Subscript,Superscript'; 32 | 33 | // Set the most common block elements. 34 | config.format_tags = 'p;h1;h2;h3;pre'; 35 | 36 | // Simplify the dialog windows. 37 | config.removeDialogTabs = 'image:advanced;link:advanced'; 38 | }; 39 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. 2 | CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model. 3 | 4 | cs.js Found: 30 Missing: 0 5 | cy.js Found: 30 Missing: 0 6 | da.js Found: 12 Missing: 18 7 | de.js Found: 30 Missing: 0 8 | el.js Found: 25 Missing: 5 9 | eo.js Found: 30 Missing: 0 10 | fa.js Found: 30 Missing: 0 11 | fi.js Found: 30 Missing: 0 12 | fr.js Found: 30 Missing: 0 13 | gu.js Found: 12 Missing: 18 14 | he.js Found: 30 Missing: 0 15 | it.js Found: 30 Missing: 0 16 | mk.js Found: 5 Missing: 25 17 | nb.js Found: 30 Missing: 0 18 | nl.js Found: 30 Missing: 0 19 | no.js Found: 30 Missing: 0 20 | pt-br.js Found: 30 Missing: 0 21 | ro.js Found: 6 Missing: 24 22 | tr.js Found: 30 Missing: 0 23 | ug.js Found: 27 Missing: 3 24 | vi.js Found: 6 Missing: 24 25 | zh-cn.js Found: 30 Missing: 0 26 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/about/dialogs/logo_ckeditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/about/dialogs/logo_ckeditor.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/dialog/dialogDefinition.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. 3 | CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model. 4 | */ 5 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/dialog/styles/dialog.css: -------------------------------------------------------------------------------- 1 | .cke_dialog_open { 2 | overflow: hidden; 3 | } 4 | 5 | .cke_dialog_container { 6 | position: fixed; 7 | overflow-y: auto; 8 | overflow-x: auto; 9 | width: 100%; 10 | height: 100%; 11 | top: 0; 12 | left: 0; 13 | z-index: 10010; 14 | } 15 | 16 | .cke_dialog_body { 17 | position: relative; 18 | } 19 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/icons.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/icons_hidpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/icons_hidpi.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/image/images/noimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/image/images/noimage.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/link/images/anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/link/images/anchor.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/link/images/hidpi/anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/link/images/hidpi/anchor.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/magicline/images/hidpi/icon-rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/magicline/images/hidpi/icon-rtl.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/magicline/images/hidpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/magicline/images/hidpi/icon.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/magicline/images/icon-rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/magicline/images/icon-rtl.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/magicline/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/magicline/images/icon.png -------------------------------------------------------------------------------- /static/ckeditor/plugins/scayt/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | SCAYT plugin for CKEditor 4 Changelog 2 | ==================== 3 | 4 | The full changelog of the SCAYT plugin for CKEditor 4 can be found on our website under the [release notes](https://webspellchecker.com/release-notes/) section. 5 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/scayt/LICENSE.md: -------------------------------------------------------------------------------- 1 | Software License Agreement 2 | ========================== 3 | 4 | **CKEditor SCAYT Plugin** 5 | Copyright © 2012, [CKSource](http://cksource.com) - Frederico Knabben. All rights reserved. 6 | 7 | Licensed under the terms of any of the following licenses at your choice: 8 | 9 | * GNU General Public License Version 2 or later (the "GPL"): 10 | http://www.gnu.org/licenses/gpl.html 11 | 12 | * GNU Lesser General Public License Version 2.1 or later (the "LGPL"): 13 | http://www.gnu.org/licenses/lgpl.html 14 | 15 | * Mozilla Public License Version 1.1 or later (the "MPL"): 16 | http://www.mozilla.org/MPL/MPL-1.1.html 17 | 18 | You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. 19 | 20 | Sources of Intellectual Property Included in this plugin 21 | -------------------------------------------------------- 22 | 23 | Where not otherwise indicated, all plugin content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, the plugin will incorporate work done by developers outside of CKSource with their express permission. 24 | 25 | Trademarks 26 | ---------- 27 | 28 | CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. 29 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/scayt/dialogs/dialog.css: -------------------------------------------------------------------------------- 1 | div.cke_dialog_ui_scaytItemList { 2 | border: 1px solid #c9cccf; 3 | } 4 | 5 | .cke_scaytItemList-child { 6 | position: relative; 7 | padding: 6px 30px 6px 5px; 8 | overflow: hidden; 9 | text-overflow: ellipsis; 10 | white-space: nowrap; 11 | } 12 | 13 | .cke_scaytItemList-child:hover { 14 | background: #ebebeb; 15 | } 16 | 17 | .cke_scaytItemList-child .cke_scaytItemList_remove { 18 | position: absolute; 19 | top: 0; 20 | right: 5px; 21 | width: 26px; 22 | height: 26px; 23 | } 24 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/scayt/dialogs/toolbar.css: -------------------------------------------------------------------------------- 1 | a 2 | { 3 | text-decoration:none; 4 | padding: 2px 4px 4px 6px; 5 | display : block; 6 | border-width: 1px; 7 | border-style: solid; 8 | margin : 0px; 9 | } 10 | 11 | a.cke_scayt_toogle:hover, 12 | a.cke_scayt_toogle:focus, 13 | a.cke_scayt_toogle:active 14 | { 15 | border-color: #316ac5; 16 | background-color: #dff1ff; 17 | color : #000; 18 | cursor: pointer; 19 | margin : 0px; 20 | } 21 | a.cke_scayt_toogle { 22 | color : #316ac5; 23 | border-color: #fff; 24 | } 25 | .scayt_enabled a.cke_scayt_item { 26 | color : #316ac5; 27 | border-color: #fff; 28 | margin : 0px; 29 | } 30 | .scayt_disabled a.cke_scayt_item { 31 | color : gray; 32 | border-color : #fff; 33 | } 34 | .scayt_enabled a.cke_scayt_item:hover, 35 | .scayt_enabled a.cke_scayt_item:focus, 36 | .scayt_enabled a.cke_scayt_item:active 37 | { 38 | border-color: #316ac5; 39 | background-color: #dff1ff; 40 | color : #000; 41 | cursor: pointer; 42 | } 43 | .scayt_disabled a.cke_scayt_item:hover, 44 | .scayt_disabled a.cke_scayt_item:focus, 45 | .scayt_disabled a.cke_scayt_item:active 46 | { 47 | border-color: gray; 48 | background-color: #dff1ff; 49 | color : gray; 50 | cursor: no-drop; 51 | } 52 | .cke_scayt_set_on, .cke_scayt_set_off 53 | { 54 | display: none; 55 | } 56 | .scayt_enabled .cke_scayt_set_on 57 | { 58 | display: none; 59 | } 60 | .scayt_disabled .cke_scayt_set_on 61 | { 62 | display: inline; 63 | } 64 | .scayt_disabled .cke_scayt_set_off 65 | { 66 | display: none; 67 | } 68 | .scayt_enabled .cke_scayt_set_off 69 | { 70 | display: inline; 71 | } 72 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css: -------------------------------------------------------------------------------- 1 | .scayt-lang-list > div 2 | { 3 | padding-bottom: 6px !important; 4 | } 5 | 6 | .scayt-lang-list > div input 7 | { 8 | margin-right: 4px; 9 | } 10 | 11 | #scayt_about_ 12 | { 13 | margin: 30px auto 0 auto; 14 | } 15 | 16 | #scayt_about_ p 17 | { 18 | text-align: center; 19 | margin-bottom: 10px; 20 | } 21 | 22 | .cke_dialog_contents_body div[name=dictionaries] .cke_dialog_ui_hbox_last > a.cke_dialog_ui_button 23 | { 24 | margin-top: 0; 25 | } 26 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. 2 | CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model. 3 | 4 | cs.js Found: 118 Missing: 0 5 | cy.js Found: 118 Missing: 0 6 | de.js Found: 118 Missing: 0 7 | el.js Found: 16 Missing: 102 8 | eo.js Found: 118 Missing: 0 9 | et.js Found: 31 Missing: 87 10 | fa.js Found: 24 Missing: 94 11 | fi.js Found: 23 Missing: 95 12 | fr.js Found: 118 Missing: 0 13 | hr.js Found: 23 Missing: 95 14 | it.js Found: 118 Missing: 0 15 | nb.js Found: 118 Missing: 0 16 | nl.js Found: 118 Missing: 0 17 | no.js Found: 118 Missing: 0 18 | tr.js Found: 118 Missing: 0 19 | ug.js Found: 39 Missing: 79 20 | zh-cn.js Found: 118 Missing: 0 21 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/tableselection/styles/tableselection.css: -------------------------------------------------------------------------------- 1 | .cke_table-faked-selection-editor *::selection, table[data-cke-table-faked-selection-table] *::selection { 2 | background: transparent; 3 | } 4 | 5 | .cke_table-faked-selection { 6 | background: darkgray !important; 7 | color: black; 8 | } 9 | .cke_table-faked-selection a { 10 | color: black; 11 | } 12 | .cke_editable:focus .cke_table-faked-selection { 13 | /* We have to use !important here, as td might specify it's own background, thus table selection 14 | would not be visible. */ 15 | background: #0076cb !important; 16 | color: white; 17 | } 18 | .cke_editable:focus .cke_table-faked-selection a { 19 | color: white; 20 | } 21 | .cke_table-faked-selection::-moz-selection, .cke_table-faked-selection ::-moz-selection { 22 | background: transparent; 23 | } 24 | .cke_table-faked-selection::selection, .cke_table-faked-selection ::selection { 25 | background: transparent; 26 | } 27 | 28 | /* Change the cursor when selecting cells (#706). 29 | * 30 | * This solution does not work in IE, Edge and Safari due to upstream isues: 31 | * https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/3419602/ 32 | * https://bugs.webkit.org/show_bug.cgi?id=53341 33 | */ 34 | table[data-cke-table-faked-selection-table] { 35 | cursor: cell; 36 | } 37 | -------------------------------------------------------------------------------- /static/ckeditor/plugins/widget/images/handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/plugins/widget/images/handle.png -------------------------------------------------------------------------------- /static/ckeditor/samples/img/github-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/samples/img/github-top.png -------------------------------------------------------------------------------- /static/ckeditor/samples/img/header-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/samples/img/header-bg.png -------------------------------------------------------------------------------- /static/ckeditor/samples/img/header-separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/samples/img/header-separator.png -------------------------------------------------------------------------------- /static/ckeditor/samples/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/samples/img/logo.png -------------------------------------------------------------------------------- /static/ckeditor/samples/img/navigation-tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/samples/img/navigation-tip.png -------------------------------------------------------------------------------- /static/ckeditor/samples/js/sample.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. 3 | * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license 4 | */ 5 | 6 | /* exported initSample */ 7 | 8 | if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) 9 | CKEDITOR.tools.enableHtml5Elements( document ); 10 | 11 | // The trick to keep the editor in the sample quite small 12 | // unless user specified own height. 13 | CKEDITOR.config.height = 150; 14 | CKEDITOR.config.width = 'auto'; 15 | 16 | var initSample = ( function() { 17 | var wysiwygareaAvailable = isWysiwygareaAvailable(), 18 | isBBCodeBuiltIn = !!CKEDITOR.plugins.get( 'bbcode' ); 19 | 20 | return function() { 21 | var editorElement = CKEDITOR.document.getById( 'editor' ); 22 | 23 | // :((( 24 | if ( isBBCodeBuiltIn ) { 25 | editorElement.setHtml( 26 | 'Hello world!\n\n' + 27 | 'I\'m an instance of [url=https://ckeditor.com]CKEditor[/url].' 28 | ); 29 | } 30 | 31 | // Depending on the wysiwygarea plugin availability initialize classic or inline editor. 32 | if ( wysiwygareaAvailable ) { 33 | CKEDITOR.replace( 'editor' ); 34 | } else { 35 | editorElement.setAttribute( 'contenteditable', 'true' ); 36 | CKEDITOR.inline( 'editor' ); 37 | 38 | // TODO we can consider displaying some info box that 39 | // without wysiwygarea the classic editor may not work. 40 | } 41 | }; 42 | 43 | function isWysiwygareaAvailable() { 44 | // If in development mode, then the wysiwygarea must be available. 45 | // Split REV into two strings so builder does not replace it :D. 46 | if ( CKEDITOR.revision == ( '%RE' + 'V%' ) ) { 47 | return true; 48 | } 49 | 50 | return !!CKEDITOR.plugins.get( 'wysiwygarea' ); 51 | } 52 | } )(); 53 | 54 | -------------------------------------------------------------------------------- /static/ckeditor/samples/old/assets/inlineall/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/samples/old/assets/inlineall/logo.png -------------------------------------------------------------------------------- /static/ckeditor/samples/old/assets/posteddata.php: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | Sample — CKEditor 12 | 13 | 14 | 15 | 16 |

    17 | CKEditor — Posted Data 18 |

    19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | $value ) 32 | { 33 | if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) 34 | continue; 35 | 36 | if ( get_magic_quotes_gpc() ) 37 | $value = htmlspecialchars( stripslashes((string)$value) ); 38 | else 39 | $value = htmlspecialchars( (string)$value ); 40 | ?> 41 | 42 | 43 | 44 | 45 | 49 |
    Field NameValue
    50 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /static/ckeditor/samples/old/assets/sample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/samples/old/assets/sample.jpg -------------------------------------------------------------------------------- /static/ckeditor/samples/old/assets/uilanguages/languages.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. 3 | For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license 4 | */ 5 | var CKEDITOR_LANGS=function(){var c={af:"Afrikaans",ar:"Arabic",az:"Azerbaijani",bg:"Bulgarian",bn:"Bengali/Bangla",bs:"Bosnian",ca:"Catalan",cs:"Czech",cy:"Welsh",da:"Danish",de:"German","de-ch":"German (Switzerland)",el:"Greek",en:"English","en-au":"English (Australia)","en-ca":"English (Canadian)","en-gb":"English (United Kingdom)",eo:"Esperanto",es:"Spanish","es-mx":"Spanish (Mexico)",et:"Estonian",eu:"Basque",fa:"Persian",fi:"Finnish",fo:"Faroese",fr:"French","fr-ca":"French (Canada)",gl:"Galician", 6 | gu:"Gujarati",he:"Hebrew",hi:"Hindi",hr:"Croatian",hu:"Hungarian",id:"Indonesian",is:"Icelandic",it:"Italian",ja:"Japanese",ka:"Georgian",km:"Khmer",ko:"Korean",ku:"Kurdish",lt:"Lithuanian",lv:"Latvian",mk:"Macedonian",mn:"Mongolian",ms:"Malay",nb:"Norwegian Bokmal",nl:"Dutch",no:"Norwegian",oc:"Occitan",pl:"Polish",pt:"Portuguese (Portugal)","pt-br":"Portuguese (Brazil)",ro:"Romanian",ru:"Russian",si:"Sinhala",sk:"Slovak",sq:"Albanian",sl:"Slovenian",sr:"Serbian (Cyrillic)","sr-latn":"Serbian (Latin)", 7 | sv:"Swedish",th:"Thai",tr:"Turkish",tt:"Tatar",ug:"Uighur",uk:"Ukrainian",vi:"Vietnamese",zh:"Chinese Traditional","zh-cn":"Chinese Simplified"},b=[],a;for(a in CKEDITOR.lang.languages)b.push({code:a,name:c[a]||a});b.sort(function(a,b){return a.name' + requires[ i ] + '' ); 22 | } 23 | 24 | if ( missing.length ) { 25 | var warn = CKEDITOR.dom.element.createFromHtml( 26 | '
    ' + 27 | 'To fully experience this demo, the ' + missing.join( ', ' ) + ' plugin' + ( missing.length > 1 ? 's are' : ' is' ) + ' required.' + 28 | '
    ' 29 | ); 30 | warn.insertBefore( editor.container ); 31 | } 32 | } 33 | 34 | // Set icons. 35 | var doc = new CKEDITOR.dom.document( document ), 36 | icons = doc.find( '.button_icon' ); 37 | 38 | for ( i = 0; i < icons.count(); i++ ) { 39 | var icon = icons.getItem( i ), 40 | name = icon.getAttribute( 'data-icon' ), 41 | style = CKEDITOR.skin.getIconStyle( name, ( CKEDITOR.lang.dir == 'rtl' ) ); 42 | 43 | icon.addClass( 'cke_button_icon' ); 44 | icon.addClass( 'cke_button__' + name + '_icon' ); 45 | icon.setAttribute( 'style', style ); 46 | icon.setStyle( 'float', 'none' ); 47 | 48 | } 49 | } ); 50 | } )(); 51 | -------------------------------------------------------------------------------- /static/ckeditor/samples/old/sample_posteddata.php: -------------------------------------------------------------------------------- 1 |
     2 | 
     3 | -------------------------------------------------------------------------------------------
     4 |   CKEditor - Posted Data
     5 | 
     6 |   We are sorry, but your Web server does not support the PHP language used in this script.
     7 | 
     8 |   Please note that CKEditor can be used with any other server-side language than just PHP.
     9 |   To save the content created with CKEditor you need to read the POST data on the server
    10 |   side and write it to a file or the database.
    11 | 
    12 |   Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
    13 |   For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
    14 | -------------------------------------------------------------------------------------------
    15 | 
    16 | 
    */ include "assets/posteddata.php"; ?> 17 | -------------------------------------------------------------------------------- /static/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Font license info 2 | 3 | 4 | ## Font Awesome 5 | 6 | Copyright (C) 2012 by Dave Gandy 7 | 8 | Author: Dave Gandy 9 | License: SIL () 10 | Homepage: http://fortawesome.github.com/Font-Awesome/ 11 | -------------------------------------------------------------------------------- /static/ckeditor/samples/toolbarconfigurator/font/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "css_prefix_text": "icon-", 4 | "css_use_suffix": false, 5 | "hinting": true, 6 | "units_per_em": 1000, 7 | "ascent": 850, 8 | "glyphs": [ 9 | { 10 | "uid": "f48ae54adfb27d8ada53d0fd9e34ee10", 11 | "css": "trash-empty", 12 | "code": 59392, 13 | "src": "fontawesome" 14 | }, 15 | { 16 | "uid": "1c4068ed75209e21af36017df8871802", 17 | "css": "down-big", 18 | "code": 59393, 19 | "src": "fontawesome" 20 | }, 21 | { 22 | "uid": "95376bf082bfec6ce06ea1cda7bd7ead", 23 | "css": "up-big", 24 | "code": 59394, 25 | "src": "fontawesome" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /static/ckeditor/samples/toolbarconfigurator/font/fontello.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/samples/toolbarconfigurator/font/fontello.eot -------------------------------------------------------------------------------- /static/ckeditor/samples/toolbarconfigurator/font/fontello.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Copyright (C) 2014 by original authors @ fontello.com 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /static/ckeditor/samples/toolbarconfigurator/font/fontello.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/samples/toolbarconfigurator/font/fontello.ttf -------------------------------------------------------------------------------- /static/ckeditor/samples/toolbarconfigurator/font/fontello.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/samples/toolbarconfigurator/font/fontello.woff -------------------------------------------------------------------------------- /static/ckeditor/samples/toolbarconfigurator/lib/codemirror/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 by Marijn Haverbeke and others 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /static/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css: -------------------------------------------------------------------------------- 1 | /* neo theme for codemirror */ 2 | 3 | /* Color scheme */ 4 | 5 | .cm-s-neo.CodeMirror { 6 | background-color:#ffffff; 7 | color:#2e383c; 8 | line-height:1.4375; 9 | } 10 | .cm-s-neo .cm-comment {color:#75787b} 11 | .cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3} 12 | .cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a} 13 | .cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328} 14 | .cm-s-neo .cm-string {color:#b35e14} 15 | .cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65} 16 | 17 | 18 | /* Editor styling */ 19 | 20 | .cm-s-neo pre { 21 | padding:0; 22 | } 23 | 24 | .cm-s-neo .CodeMirror-gutters { 25 | border:none; 26 | border-right:10px solid transparent; 27 | background-color:transparent; 28 | } 29 | 30 | .cm-s-neo .CodeMirror-linenumber { 31 | padding:0; 32 | color:#e0e2e5; 33 | } 34 | 35 | .cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; } 36 | .cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; } 37 | -------------------------------------------------------------------------------- /static/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | max-width: 19em; 29 | overflow: hidden; 30 | white-space: pre; 31 | color: black; 32 | cursor: pointer; 33 | } 34 | 35 | li.CodeMirror-hint-active { 36 | background: #08f; 37 | color: white; 38 | } 39 | -------------------------------------------------------------------------------- /static/ckeditor/skins/kama/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/skins/kama/icons.png -------------------------------------------------------------------------------- /static/ckeditor/skins/kama/icons_hidpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/skins/kama/icons_hidpi.png -------------------------------------------------------------------------------- /static/ckeditor/skins/kama/images/dialog_sides.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/skins/kama/images/dialog_sides.gif -------------------------------------------------------------------------------- /static/ckeditor/skins/kama/images/dialog_sides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/skins/kama/images/dialog_sides.png -------------------------------------------------------------------------------- /static/ckeditor/skins/kama/images/dialog_sides_rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/skins/kama/images/dialog_sides_rtl.png -------------------------------------------------------------------------------- /static/ckeditor/skins/kama/images/mini.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/skins/kama/images/mini.gif -------------------------------------------------------------------------------- /static/ckeditor/skins/kama/images/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/skins/kama/images/spinner.gif -------------------------------------------------------------------------------- /static/ckeditor/skins/kama/images/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/skins/kama/images/sprites.png -------------------------------------------------------------------------------- /static/ckeditor/skins/kama/images/sprites_ie6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/skins/kama/images/sprites_ie6.png -------------------------------------------------------------------------------- /static/ckeditor/skins/kama/images/toolbar_start.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/ckeditor/skins/kama/images/toolbar_start.gif -------------------------------------------------------------------------------- /static/css/classes/dialog.css: -------------------------------------------------------------------------------- 1 | .dialog{ 2 | display: none; 3 | position: fixed; 4 | top: 0; 5 | left: 0; 6 | width: 100vw; 7 | height: 100vh; 8 | padding: 0; 9 | margin: 0; 10 | z-index: 3; 11 | } 12 | 13 | .dialog.show{ 14 | display: block; 15 | } 16 | 17 | .dialog>.dialog-bg{ 18 | position: absolute; 19 | width: 100%; 20 | height: 100%; 21 | background-color: black; 22 | opacity: 0.5; 23 | 24 | z-index: 1; 25 | } 26 | 27 | .dialog>.dialog-content{ 28 | z-index: 2; 29 | position: absolute; 30 | top: 50%; 31 | left: 50%; 32 | transform: translate(-50%, -50%); 33 | padding: 1rem; 34 | border-radius: 0.5rem; 35 | background-color: var(--color-bg-primary); 36 | 37 | -webkit-box-shadow: 0px 0px 5rem 1rem var(--color-shadow-primary); 38 | -moz-box-shadow: 0px 0px 5rem 1rem var(--color-shadow-primary); 39 | box-shadow: 0px 0px 5rem 1rem var(--color-shadow-primary); 40 | } -------------------------------------------------------------------------------- /static/css/classes/drag.css: -------------------------------------------------------------------------------- 1 | .placeholder { 2 | opacity: 0; 3 | } 4 | 5 | .draggable.dragging:not(.placeholder) { 6 | position: fixed!important; 7 | opacity: .8; 8 | } -------------------------------------------------------------------------------- /static/css/classes/error.css: -------------------------------------------------------------------------------- 1 | .error{ 2 | color: var(--color-error)!important; 3 | } 4 | 5 | .remove{ 6 | border-color: var(--color-error)!important; 7 | } 8 | 9 | .success{ 10 | color: var(--color-success)!important; 11 | } 12 | 13 | .add{ 14 | border-color: var(--color-success)!important; 15 | } -------------------------------------------------------------------------------- /static/css/classes/form.css: -------------------------------------------------------------------------------- 1 | .form{ 2 | border-radius: 0.5rem; 3 | border: 1px solid var(--color-border-primary); 4 | 5 | max-width: 100%; 6 | padding: 1rem; 7 | 8 | margin-bottom: 3rem; 9 | 10 | display: flex; 11 | flex-direction: column; 12 | 13 | 14 | padding: 1rem; 15 | border-radius: 0.5rem; 16 | 17 | background-color: rgba(0, 0, 0, 0.05); 18 | -webkit-box-shadow: 0px 0px 5rem 0px var(--color-shadow-primary); 19 | -moz-box-shadow: 0px 0px 5rem 0px var(--color-shadow-primary); 20 | box-shadow: 0px 0px 5rem 0px var(--color-shadow-primary); 21 | } 22 | 23 | .above-shadow{ 24 | z-index: 1; 25 | } -------------------------------------------------------------------------------- /static/css/classes/notification.css: -------------------------------------------------------------------------------- 1 | .notifications{ 2 | z-index: 9; 3 | max-height: 400px; 4 | overflow-y: hidden; 5 | overflow-x: hidden; 6 | 7 | position: fixed; 8 | top: 3rem; 9 | right: 3rem; 10 | gap: 1rem; 11 | 12 | display: flex; 13 | justify-content: start; 14 | align-items: start; 15 | flex-direction: column-reverse; 16 | } 17 | 18 | .notification{ 19 | --width: 15rem; 20 | width: var(--width); 21 | 22 | padding: 1rem 0.5rem; 23 | margin-left: auto; 24 | border-radius: 0.5rem; 25 | /* border: 1px solid var(--color-border-primary); */ 26 | user-select: none; 27 | 28 | color: rgba(0, 0, 0, 0.6); 29 | font-size: 1rem; 30 | font-weight: 500; 31 | 32 | -webkit-box-shadow: 0px 0px 5rem 0px var(--color-shadow-primary); 33 | -moz-box-shadow: 0px 0px 5rem 0px var(--color-shadow-primary); 34 | box-shadow: 0px 0px 5rem 0px var(--color-shadow-primary); 35 | 36 | animation: notification_append var(--transition) forwards; 37 | } 38 | 39 | @keyframes notification_append { 40 | 0%{ 41 | margin-right: calc(0px - var(--width) * 2); 42 | opacity: 0; 43 | } 44 | 45 | 92.5%, 95%{ 46 | margin-right: 0.5rem; 47 | } 48 | 49 | 100%{ 50 | margin-right: 0; 51 | } 52 | } 53 | 54 | .notification.remove{ 55 | animation: notification_remove var(--transition) forwards; 56 | } 57 | 58 | @keyframes notification_remove { 59 | 0%{ 60 | margin-right: 0rem; 61 | } 62 | 63 | 5%, 7.5%{ 64 | margin-right: 0.5rem; 65 | } 66 | 67 | 100%{ 68 | opacity: 0; 69 | margin-right: calc(0px - var(--width) * 2); 70 | } 71 | } -------------------------------------------------------------------------------- /static/css/classes/wrapper.css: -------------------------------------------------------------------------------- 1 | .dark-wrapper{ 2 | border-radius: 0.5rem; 3 | border: 1px solid var(--color-border-primary); 4 | 5 | max-width: 100%; 6 | padding: 1rem; 7 | 8 | margin-bottom: 1rem; 9 | 10 | display: flex; 11 | flex-direction: column; 12 | 13 | padding: 1rem; 14 | border-radius: 0.5rem; 15 | 16 | background-color: rgba(0, 0, 0, 0.05); 17 | -webkit-box-shadow: 0px 0px 5rem 0px var(--color-shadow-primary); 18 | -moz-box-shadow: 0px 0px 5rem 0px var(--color-shadow-primary); 19 | box-shadow: 0px 0px 5rem 0px var(--color-shadow-primary); 20 | } -------------------------------------------------------------------------------- /static/css/colors/default.css: -------------------------------------------------------------------------------- 1 | /* color names */ 2 | :root { 3 | --blue: #007bff; 4 | --indigo: #6610f2; 5 | --purple: #6f42c1; 6 | --pink: #e83e8c; 7 | --red: #dc3545; 8 | --orange: #fd7e14; 9 | --yellow: #ffc107; 10 | --green: #28a745; 11 | --teal: #20c997; 12 | --cyan: #17a2b8; 13 | --white: #fff; 14 | --gray: #6c757d; 15 | --gray-dark: #343a40; 16 | --primary: #007bff; 17 | --secondary: #6c757d; 18 | --success: #28a745; 19 | --info: #17a2b8; 20 | --warning: #ffc107; 21 | --danger: #dc3545; 22 | --light: #f8f9fa; 23 | --dark: #343a40; 24 | } -------------------------------------------------------------------------------- /static/css/style.css: -------------------------------------------------------------------------------- 1 | /* @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&display=swap'); */ 2 | 3 | :root { 4 | --transition: 0.3s; 5 | font-size: 16px; 6 | 7 | /* to change this in the future use ctrl + f and replace */ 8 | --small-device: 576px; 9 | --big-device: 1280px; 10 | } 11 | 12 | @media screen and (max-width: 576px) { 13 | :root { 14 | font-size: 13px; 15 | } 16 | } 17 | 18 | * { 19 | font-family: 'Montserrat', sans-serif; 20 | color: var(--color-text-primary); 21 | box-sizing: border-box; 22 | } 23 | 24 | body { 25 | margin: 0; 26 | overflow-x: hidden; 27 | background-color: var(--color-bg-primary); 28 | min-height: 100vh; 29 | } 30 | -------------------------------------------------------------------------------- /static/css/unset.css: -------------------------------------------------------------------------------- 1 | ul{ 2 | list-style: none; 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | button{ 8 | background-color: transparent; 9 | border: 0; 10 | } 11 | 12 | a{ 13 | display: block; 14 | text-decoration: none; 15 | } 16 | 17 | hr { 18 | width: 100%; 19 | margin: 1rem 0; 20 | border: 0; 21 | border-top: 1px solid var(--color-border-primary); 22 | opacity: 0.5; 23 | } -------------------------------------------------------------------------------- /static/fonts/1.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/fonts/1.woff2 -------------------------------------------------------------------------------- /static/fonts/2.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/fonts/2.woff2 -------------------------------------------------------------------------------- /static/fonts/3.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/fonts/3.woff2 -------------------------------------------------------------------------------- /static/fonts/4.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/fonts/4.woff2 -------------------------------------------------------------------------------- /static/fonts/5.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/static/fonts/5.woff2 -------------------------------------------------------------------------------- /static/img/icons/add.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/aim.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/arrow_down.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/arrow_up.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /static/img/icons/copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/dropdown.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Layer 1 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/left.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/logout.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/move.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/paste.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/preview.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/right.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/save.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/settings.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/trash.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/icons/wait.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /static/js/component.js: -------------------------------------------------------------------------------- 1 | /** 2 | * returns parent element with 'data-refresh' 3 | * @param {HTMLElement} element 4 | * @returns {HTMLElement} 5 | */ 6 | function select_parent_component(element){ 7 | return select_parent_with_attr(element, 'data-refresh'); 8 | } 9 | 10 | /** 11 | * returns parent element with 'attr' 12 | * @param {HTMLElement} element 13 | * @param {string} attr 14 | * @returns {HTMLElement} 15 | */ 16 | function select_parent_with_attr(element, attr){ 17 | return select_parent_where(element, (e) => e.hasAttribute(attr)); 18 | // const selectParent = (e) => e.hasAttribute(attr) ? e : selectParent(e.parentElement); 19 | // return selectParent(element); 20 | } 21 | 22 | /** 23 | * @param {HTMLElement} element 24 | * @param {(HTMLElement) => boolean} filter_func 25 | * @returns {HTMLElement} 26 | */ 27 | function select_parent_where(element, filter_func){ 28 | if(!element) return; 29 | return filter_func(element) ? 30 | element : 31 | select_parent_where(element.parentElement, filter_func); 32 | } -------------------------------------------------------------------------------- /static/js/form_data.js: -------------------------------------------------------------------------------- 1 | /** 2 | * returns form data 3 | * @param {HTMLElement} element 4 | * @returns {object} - form data 5 | */ 6 | function get_form_data(element){ 7 | const empty_array_regex = /.*\[\].*/; 8 | const array_regex = /.*\[.*\].*/; 9 | const attr_name = "data-name"; 10 | const ready_data = {}; 11 | 12 | const elements_to_diff = [...element.querySelectorAll(`[${attr_name}]`)].map(e => [...e.querySelectorAll(`[${attr_name}]`)]).flat(); 13 | const elements = [...element.querySelectorAll(`[${attr_name}]`)]; 14 | const elements_filtered = elements.filter(e => !elements_to_diff.includes(e)); 15 | elements_filtered.map(e => { 16 | const get_value = () => { 17 | const types = ["input", "select", "textarea", "button"]; 18 | if(!types.includes(e.tagName.toLocaleLowerCase())) return null; 19 | if(e.tagName.toLocaleLowerCase() === "textarea" && e.classList.contains("rtf-textarea") && e.getAttribute("data-rtf-name")) 20 | return CKEDITOR.instances[e.getAttribute("data-rtf-name")]?.getData(); 21 | const input_type = e.getAttribute("type"); 22 | if(input_type === "checkbox") 23 | return e.checked ? "1" : "0"; 24 | return e.value; 25 | }; 26 | const attr = e.getAttribute(attr_name); 27 | const has_extra_name = !empty_array_regex.test(attr) && array_regex.test(attr) 28 | const extra_name = !has_extra_name ? null : attr.slice(attr.indexOf('[') + 1, attr.indexOf(']')); 29 | const name = !has_extra_name ? attr : attr.slice(0, attr.indexOf('[')) + '[]'; 30 | 31 | const data = get_value() ?? get_form_data(e); 32 | const to_add = has_extra_name ? {[extra_name]: data} : data; 33 | const is_array = array_regex.test(name); 34 | if(is_array){ 35 | ready_data[name] ??= []; 36 | ready_data[name].push(to_add); 37 | }else{ 38 | ready_data[name] = to_add; 39 | } 40 | }); 41 | return ready_data; 42 | } -------------------------------------------------------------------------------- /static/js/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2024 ogius 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | -------------------------------------------------------------------------------- /static/js/notify.js: -------------------------------------------------------------------------------- 1 | function notify(message, type = "error") { 2 | const types = { 3 | success: "--color-success", 4 | error: "--color-error", 5 | warning: "--color-warning", 6 | info: "--color-info" 7 | }; 8 | function getWrapper(){ 9 | const existing_wrapper = document.getElementsByClassName("notifications"); 10 | if(existing_wrapper.length > 0) 11 | return existing_wrapper[0]; 12 | const wrapper = document.createElement("div"); 13 | wrapper.className = "notifications"; 14 | document.body.appendChild(wrapper); 15 | return wrapper; 16 | } 17 | 18 | const existing_wrappers = getWrapper(); 19 | const notification_wrapper = document.createElement("div"); 20 | notification_wrapper.className = "notification"; 21 | notification_wrapper.style.backgroundColor = `var(${types[type]})`; 22 | notification_wrapper.innerHTML = message; 23 | existing_wrappers.appendChild(notification_wrapper); 24 | 25 | const removeNotification = () => { 26 | notification_wrapper.classList.add("remove"); 27 | 28 | setTimeout(() => 29 | notification_wrapper.remove(), 300); 30 | }; 31 | 32 | notification_wrapper.addEventListener("click", () => removeNotification()); 33 | setTimeout(removeNotification, 10000); 34 | } 35 | 36 | function show_tadam(data) { 37 | console.log('not yet implemented tadam: ', data); 38 | } -------------------------------------------------------------------------------- /static/js/observer.js: -------------------------------------------------------------------------------- 1 | class Observer { 2 | constructor() { 3 | this.observers = []; 4 | } 5 | 6 | subscribe(callback) { 7 | this.observers.push(callback); 8 | } 9 | 10 | unsubscribe(callback) { 11 | this.observers = this.observers.filter(observer => observer !== callback); 12 | } 13 | 14 | notify(data) { 15 | this.observers.forEach(observer => observer(data)); 16 | } 17 | }; -------------------------------------------------------------------------------- /versions/2024-03-04_21:27.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-03-04_21:27.zip -------------------------------------------------------------------------------- /versions/2024-03-08_21:47.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-03-08_21:47.zip -------------------------------------------------------------------------------- /versions/2024-03-09_14:57.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-03-09_14:57.zip -------------------------------------------------------------------------------- /versions/2024-03-11.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-03-11.zip -------------------------------------------------------------------------------- /versions/2024-03-15.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-03-15.zip -------------------------------------------------------------------------------- /versions/2024-03-19.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-03-19.zip -------------------------------------------------------------------------------- /versions/2024-03-29-contaminated.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-03-29-contaminated.zip -------------------------------------------------------------------------------- /versions/2024-03-30-contaminated.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-03-30-contaminated.zip -------------------------------------------------------------------------------- /versions/2024-04-01.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-04-01.zip -------------------------------------------------------------------------------- /versions/2024-04-02.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-04-02.zip -------------------------------------------------------------------------------- /versions/2024-04-03.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-04-03.zip -------------------------------------------------------------------------------- /versions/2024-04-05.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-04-05.zip -------------------------------------------------------------------------------- /versions/2024-04-29.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-04-29.zip -------------------------------------------------------------------------------- /versions/2024-05-10.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-05-10.zip -------------------------------------------------------------------------------- /versions/2024-05-31.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ogiusek/php_cms/517a7fc837ee96f251582bc635923a6904d07eb8/versions/2024-05-31.zip --------------------------------------------------------------------------------