├── lib └── Bricky │ ├── Brick │ ├── Headline │ │ ├── readme.md │ │ ├── fragments │ │ │ ├── brick_headline_frontend_output.php │ │ │ └── brick_headline_backend_output.php │ │ └── Headline.php │ ├── Text │ │ ├── fragments │ │ │ ├── brick_text_frontend_output.php │ │ │ └── brick_text_backend_output.php │ │ └── Text.php │ ├── Card │ │ ├── fragments │ │ │ └── brick_card_backend_output.php │ │ └── Card.php │ └── Image │ │ └── Image.php │ ├── Brick.php │ ├── Bricky.php │ └── Module.php ├── plugins └── docs │ ├── docs │ ├── de_de │ │ ├── main_ausgaben_anpassen.md │ │ ├── was_ist_ein_brick.md │ │ ├── main_navi.md │ │ ├── main_funktionsweise.md │ │ ├── main_intro.md │ │ └── _vorlage.md │ └── README.md │ ├── boot.php │ ├── lang │ └── de_de.lang │ ├── package.yml │ ├── pages │ └── index.php │ └── assets │ └── docs.css ├── CHANGELOG.md ├── update.php ├── pages ├── index.php ├── info.php └── module.php ├── package.yml ├── lang └── de_de.lang ├── install.php ├── LICENSE.md ├── README.md ├── boot.php ├── fragments ├── bricky_module_input.php └── bricky_grid_output.php └── assets ├── bricky.js └── bricky.css /lib/Bricky/Brick/Headline/readme.md: -------------------------------------------------------------------------------- 1 |
Textfeld + Auswahl von H1-H6
4 | -------------------------------------------------------------------------------- /plugins/docs/docs/de_de/main_ausgaben_anpassen.md: -------------------------------------------------------------------------------- 1 | # Ausgaben anpassen 2 | 3 | * eigene Fragmente erstellen und bestehende Fragmente überschreiben -------------------------------------------------------------------------------- /plugins/docs/boot.php: -------------------------------------------------------------------------------- 1 | getAssetsUrl('docs.css')); 5 | } 6 | -------------------------------------------------------------------------------- /lib/Bricky/Brick/Text/fragments/brick_text_frontend_output.php: -------------------------------------------------------------------------------- 1 | getVar('SHOW', '') == 'true') { 4 | 5 | if ($this->getVar('TEXT', '') != '') { 6 | echo $this->getVar('TEXT', ''); 7 | } 8 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | Bricky - Changelog 3 | ================================================================================ 4 | 5 | 0.0.0 (00.00.0000) 6 | -------------------------------------------------------------------------------- 7 | -------------------------------------------------------------------------------- /plugins/docs/lang/de_de.lang: -------------------------------------------------------------------------------- 1 | bricky_docs = Dokumentation 2 | bricky_docs_filenotfound = Datei wurde nicht gefunden. Inhalt existiert (noch) nicht.= nl2br($this->getVar('TEXT')) ?>
18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /plugins/docs/docs/de_de/main_funktionsweise.md: -------------------------------------------------------------------------------- 1 | # Funktionsweise 2 | 3 | 4 | ## Bezeichnungen 5 | 6 | | Name | Beschreibung | 7 | | - | - | 8 | | Bricky | AddOn Name | 9 | | Brick | Ein Baustein/Element welches man dem Modul zuführen kann (Headline, Image etc.) | 10 | | Ctypes | Sind bei Bricky die Tabs bzw. deren Inhalte (könnten theoretisch auch anders als Tabs dargestellt werden) | 11 | | Darstellung Normal | Alle Bricks/Bausteine sind in einem MBlock zu sehen | 12 | | Darstellung Slices | Man wählt zuvor für den MBlock einen Brick/Baustein aus. Man erhält somit ein Modul, welches vom Prinzip wie ein REDAXO-Artikel mit Slices arbeitet | 13 | | Grid | Raster, Auswahl der Spalten und deren Breiten | 14 | | Modul | normales REDAXO Modul, welches bei Bricky aber über die AddOn-Seite gepflegt wird. | 15 | -------------------------------------------------------------------------------- /lang/de_de.lang: -------------------------------------------------------------------------------- 1 | bricks_select_notice = Wird ein Brick abgewählt, kann es passieren das bisher angelegte Slices beim nächsten Speichern ihre Daten verlieren. 2 | bricky_bricks_registered = registrierte Bricks 3 | bricky_bricks_saved = bisher zugewiesene Brikcs 4 | bricky_grid = Raster 5 | bricky_module = Bricky-Module 6 | bricky_module_exists = Dieses Modul existiert bereits 7 | bricky_module_id = REDAXO Modul ID 8 | bricky_module_name = REDAXO Modulname 9 | bricky_bricks = Bricks 10 | bricky_module_not_exists = ACHTUNG: Das Modul existiert nicht mehr 11 | bricky_title = Bricky 12 | bricky_view = Darstellung 13 | 14 | bricky_info = Info 15 | 16 | bricky_module_input_ctype_settings = Einstellungen 17 | bricky_module_input_ctype_settings_grid = Raster 18 | bricky_module_input_ctype_settings_select = Auswahl 19 | -------------------------------------------------------------------------------- /plugins/docs/docs/de_de/main_intro.md: -------------------------------------------------------------------------------- 1 | # Bricky für REDAXO 5 2 | 3 | Diese Addon ermöglicht die Erstellung von individuellen Modulen auf Basis von voher entwickelten Elementen (Klassen und Framenten). 4 | 5 | Bei der Modulerstellung können die Elemente (_Bricks_) sowie die Bereiche (_das Grid_), die für dieses Modul zur Auswahl stehen sollen gewählt werden. 6 | 7 | Die _Bricks_ können im Project / Theme Addon verwaltet werden (die Verwaltung in einem eigenem AddOn ist natürlich auch möglich). 8 | 9 | In dem der erstellten Modulen können die Inhalte innerhalb eines Bereiches oder auch ganze Bereiche verschoben werden. 10 | 11 | 12 | ## Voraussetzungen 13 | 14 | * REDAXO ab Version 5.6.x 15 | * mBlock 3.0 16 | 17 | 18 | ## Was ist enthalten? 19 | 20 | Das Addon liefert einige Beispiel-Bricks, deren Ausgabe das Bootstrap 4 Framework berücksichtigt, mit. 21 | 22 | Diese sind: 23 | 24 | * Überschrift 25 | * Text (ohne Editor) -------------------------------------------------------------------------------- /lib/Bricky/Brick.php: -------------------------------------------------------------------------------- 1 | getShortName(); 29 | } 30 | 31 | public function getPrefixedName() 32 | { 33 | return strtoupper($this->getClassName()).self::PREFIX; 34 | } 35 | 36 | public function getFragmentDir() 37 | { 38 | return __DIR__.'/Brick/'.$this->getClassName().'/fragments/'; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /install.php: -------------------------------------------------------------------------------- 1 | ensurePrimaryIdColumn() 15 | ->ensureColumn(new \rex_sql_column('module_name', 'VARCHAR(255)')) 16 | ->ensureColumn(new \rex_sql_column('module_id', 'INT(11)')) 17 | ->ensureColumn(new \rex_sql_column('bricks', 'TEXT', true)) 18 | ->ensureColumn(new \rex_sql_column('grids', 'TEXT', true)) 19 | ->ensureColumn(new \rex_sql_column('view', 'ENUM("NORMAL","SLICES")')) 20 | ->ensureColumn(new \rex_sql_column('createdate', 'DATETIME')) 21 | ->ensureColumn(new \rex_sql_column('createuser', 'VARCHAR(255)')) 22 | ->ensureColumn(new \rex_sql_column('updatedate', 'DATETIME')) 23 | ->ensureColumn(new \rex_sql_column('updateuser', 'VARCHAR(255)')) 24 | 25 | ->ensureIndex(new \rex_sql_index('module', ['module_id'], \rex_sql_index::UNIQUE)) 26 | ->ensure(); 27 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Friends Of REDAXO 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/Bricky/Brick/Headline/fragments/brick_headline_backend_output.php: -------------------------------------------------------------------------------- 1 | getVar('SHOW', '') == 'true') { 5 | 6 | if ($this->getVar('TEXT', '') != '') { 7 | $headline = $this->getVar('TEXT', ''); 8 | } else { 9 | $headline = 'Bitte eine Überschrift angeben!'; 10 | } 11 | 12 | echo ' 13 |%s
', nl2br($brickValues['TEXT'])); 68 | } 69 | if ($article = \rex_article::get($brickValues['LINK_1'])) { 70 | $return = sprintf('%s', $article->getUrl(), $return); 71 | } 72 | 73 | 74 | return $return; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /plugins/docs/assets/docs.css: -------------------------------------------------------------------------------- 1 | .rex-bricky-docs h1 { 2 | font-size: 22px; 3 | margin-top: 5px; 4 | margin-bottom: 20px; 5 | } 6 | .rex-bricky-docs h2 { 7 | font-size: 16px; 8 | margin-top: 40px; 9 | text-transform: uppercase; 10 | margin-bottom: 20px; 11 | letter-spacing: 0.02em; 12 | border-bottom: 1px solid #ccc; 13 | padding: 13px 15px 10px; 14 | background: #eee; 15 | } 16 | .rex-bricky-docs h3 { 17 | margin-top: 40px; 18 | margin-bottom: 5px; 19 | } 20 | 21 | .rex-bricky-docs blockquote { 22 | margin: 20px 0; 23 | background: #f3f6fb; 24 | } 25 | .rex-bricky-docs blockquote h2 { 26 | margin: -10px -20px 20px; 27 | background: transparent; 28 | border-top: 1px #ccc; 29 | } 30 | 31 | .rex-bricky-docs ol { 32 | padding-left: 18px; 33 | } 34 | 35 | .rex-bricky-docs ul { 36 | margin-bottom: 10px; 37 | padding-bottom: 5px;; 38 | padding-left: 16px; 39 | } 40 | .rex-bricky-docs ul li { 41 | list-style-type: square; 42 | list-style-position: outside; 43 | } 44 | .rex-bricky-docs ul ul { 45 | padding-top: 5px; 46 | } 47 | .rex-bricky-docs ul ul li { 48 | list-style-type: circle; 49 | list-style-position: outside; 50 | padding-bottom: 0; 51 | } 52 | 53 | .rex-bricky-docs p, 54 | .rex-bricky-docs li { 55 | font-size: 14px; 56 | line-height: 1.6; 57 | } 58 | 59 | .rex-bricky-docs hr { 60 | margin-top: 40px; 61 | border-top: 1px solid #ddd; 62 | } 63 | 64 | .rex-bricky-docs table { 65 | width: 100%; 66 | max-width: 100%; 67 | border-top: 1px solid #ddd; 68 | border-bottom: 1px solid #ddd; 69 | margin: 20px 0 30px; 70 | } 71 | .rex-bricky-docs th { 72 | background: #f7f7f7; 73 | border-bottom: 2px solid #ddd; 74 | border-collapse: separate; 75 | } 76 | .rex-bricky-docs th, 77 | .rex-bricky-docs td { 78 | border-top: 1px solid #ddd; 79 | padding: 8px; 80 | line-height: 1.42857143; 81 | vertical-align: top; 82 | font-size: 13px; 83 | } 84 | 85 | 86 | .rex-bricky-docs .bricky-docs-navi ul { 87 | margin-bottom: 10px; 88 | padding-left: 0; 89 | } 90 | .rex-bricky-docs .bricky-docs-navi ul li { 91 | list-style-type: none; 92 | background: #eee; 93 | padding: 0 15px; 94 | line-height: 40px; 95 | } 96 | .rex-bricky-docs .bricky-docs-navi ul { 97 | background: #fff; 98 | margin-left: -15px; 99 | margin-right: -15px; 100 | } 101 | .rex-bricky-docs .bricky-docs-navi ul li li { 102 | list-style-type: none; 103 | background: #fff; 104 | line-height: 30px; 105 | } 106 | .rex-bricky-docs .bricky-docs-navi ul li li:before { 107 | font-family: FontAwesome; 108 | content: '\f0a9'; 109 | margin-right: 10px; 110 | } 111 | .rex-bricky-docs .bricky-docs-navi ul sup { 112 | display: none; 113 | } 114 | -------------------------------------------------------------------------------- /boot.php: -------------------------------------------------------------------------------- 1 | addBrick(new Headline()); 21 | Bricky::getInstance()->addBrick(new Text()); 22 | 23 | // Bricky::getInstance()->addBrick(new Image()); 24 | // Bricky::getInstance()->addBrick(new Card()); 25 | 26 | \rex_fragment::addDirectory(\rex_path::addon('project', 'fragments/')); 27 | 28 | if (rex::isBackend() && rex::getUser()) { 29 | 30 | if (rex_be_controller::getCurrentPage() == 'content/edit') { 31 | \rex_view::addCssFile($this->getAssetsUrl('bricky.css')); 32 | \rex_view::addJsFile($this->getAssetsUrl('bricky.js')); 33 | } 34 | 35 | rex_extension::register('REX_FORM_SAVED', function (rex_extension_point $ep) { 36 | $params = $ep->getParams(); 37 | 38 | /* @var rex_form $form */ 39 | $form = $params['form']; 40 | 41 | if ($form->getParam('page') != 'bricky/module') { 42 | return; 43 | } 44 | 45 | if ($form->getParam('func') == 'add') { 46 | $sql = rex_sql::factory(); 47 | $brickModules = $sql->getArray('SELECT id, module_name FROM '.rex::getTable(Module::TABLE_NAME).' WHERE module_id = "0"'); 48 | if (!count($brickModules)) { 49 | return; 50 | } 51 | foreach ($brickModules as $brickModule) { 52 | $moduleSql = rex_sql::factory(); 53 | $moduleSql->setTable(rex::getTable('module')); 54 | $moduleSql->setValue('input', Bricky::getModuleInput()); 55 | $moduleSql->setValue('output', Bricky::getModuleOutput()); 56 | $moduleSql->setValue('name', $brickModule['module_name']); 57 | $moduleSql->insert(); 58 | $lastInsertModuleId = (int)$moduleSql->getLastId(); 59 | 60 | $sql = rex_sql::factory(); 61 | $sql->setTable(rex::getTable('bricky_module')); 62 | $sql->setWhere('id = :id', ['id' => $brickModule['id']]); 63 | $sql->setValue('module_id', $lastInsertModuleId); 64 | $sql->setValue('module_name', ''); 65 | $sql->addGlobalUpdateFields(); 66 | $sql->update(); 67 | } 68 | } 69 | 70 | if ($form->getParam('func') == 'edit') { 71 | $query = ' SELECT `b`.`id`, 72 | `b`.`module_id`, 73 | `m`.`name` 74 | FROM '.rex::getTable(Module::TABLE_NAME) .' AS b 75 | LEFT JOIN '.rex::getTable('module').' AS m 76 | ON `b`.`module_id` = `m`.`id` 77 | WHERE `b`.`id` = :id 78 | LIMIT 2 79 | '; 80 | $sql = rex_sql::factory(); 81 | $brickModules = $sql->getArray($query, ['id' => $form->getParam('id')]); 82 | if (count($brickModules) != 1) { 83 | return; 84 | } 85 | 86 | $brickModule = $brickModules[0]; 87 | } 88 | }); 89 | } 90 | -------------------------------------------------------------------------------- /fragments/bricky_module_input.php: -------------------------------------------------------------------------------- 1 |