21 |
22 | |
23 |
24 |
42 | |
43 | |
44 |
45 |
46 |
65 |
66 |
67 | endPage() ?>
--------------------------------------------------------------------------------
/messages/nl/app.php:
--------------------------------------------------------------------------------
1 | '"{item}" en onderliggende zijn verwijderd',
5 | '"{item}" has been created' => '"{item}" is toegevoegd',
6 | '"{item}" has been deleted' => '"{item}" is verwijderd',
7 | '"{item}" has been updated' => '"{item}" is gewijzigd',
8 | '-- Choose a {item} --' => '-- Selecteer een {item} --',
9 | '-- Choose an {item} --' => '-- Selecteer een {item} --',
10 | '-- Choose the {items} --' => '-- Selecteer de {items} --',
11 | 'Account' => 'Account',
12 | 'Actions' => 'Acties',
13 | 'Active' => 'Actief',
14 | 'Add {modelClass}' => 'Voeg {modelClass} toe',
15 | 'Alt' => 'Alt-tekst',
16 | 'Are you sure you want to delete "{modelName}" and all related {modelClass}?' => '',
17 | 'Are you sure you want to delete this item(s)' => '',
18 | 'Are you sure you want to delete this item(s)?' => 'Ben je zeker dat je deze item(s) wilt verwijderen?',
19 | 'Are you sure you want to delete this item?' => 'Ben je zeker dat je dit item wilt verwijderen?',
20 | 'Are you sure you want to delete {n, plural, =1{this image} other{# images}}?' => 'Ben je zeker dat je deze {n, plural, =1{afbeelding} other{# afbeeldingen}} wilt verwijderen?',
21 | 'Assigments' => 'Toewijzingen',
22 | 'Attached to' => 'Gekoppeld aan',
23 | 'Brief description' => 'Korte beschrijving',
24 | 'Browse' => 'Bladeren',
25 | 'Cancel' => 'Annuleren',
26 | 'Category' => 'Categorie',
27 | 'Choose a category' => 'Kies een categorie',
28 | 'Choose a type' => 'Selecteer een type',
29 | 'Choose a {item}' => 'Kies een {item}',
30 | 'Choose the amount of {item}' => 'Kies het aantal {item}',
31 | 'Close' => 'Sluiten',
32 | 'Collapse all' => 'Verberg alles',
33 | 'Company' => 'Bedrijf',
34 | 'Content' => 'Inhoud',
35 | 'Copy to all languages' => '',
36 | 'Create' => 'Aanmaken',
37 | 'Create & close' => 'Aanmaken en sluiten',
38 | 'Create & new' => 'Aanmaken en toevoegen',
39 | 'Create {modelClass}' => '{modelClass} toevoegen',
40 | 'Created At' => 'Toegevoegd op',
41 | 'Dashboard' => 'Dashboard',
42 | 'Data' => 'Data',
43 | 'Date' => 'Datum',
44 | 'Delete' => 'Verwijderen',
45 | 'Delete {modelClass}' => 'Verwijder {modelClass}',
46 | 'Description' => 'Beschrijving',
47 | 'Drag & drop files here ...' => 'Sleep hier je bestanden naartoe ...',
48 | 'Drag and drop the images to change the sort order' => 'Sleep de afbeeldingen om de sorteervolgorde aan te passen',
49 | 'Edit {modelClass}' => 'Wijzig {modelClass}',
50 | 'Email' => 'E-mail',
51 | 'Entity' => 'Gekoppeld aan',
52 | 'Entity ID' => 'Koppeling',
53 | 'Example' => '',
54 | 'Expand all' => 'Toon alles',
55 | 'File' => 'Bestand',
56 | 'File Path' => 'Bestandslocatie',
57 | 'Firstname' => 'Voornaam',
58 | 'General' => 'Algemeen',
59 | 'ID' => 'ID',
60 | 'Image' => 'Afbeelding',
61 | 'Image is required' => 'Afbeelding is verplicht',
62 | 'Images' => 'Afbeeldingen',
63 | 'Images successfully uploaded' => 'Afbeeldingen met succes toegevoegd',
64 | 'Item ID' => 'Item',
65 | 'Key' => '',
66 | 'Label' => '',
67 | 'Language' => 'Taal',
68 | 'Logout' => 'Uitloggen',
69 | 'Main image' => 'Hoofdafbeelding',
70 | 'Media' => 'Media',
71 | 'Modules' => 'Modules',
72 | 'My profile' => 'Mijn profiel',
73 | 'Name' => 'Naam',
74 | 'No' => 'Nee',
75 | 'Not uploaded yet' => 'Nog niet ge-upload',
76 | 'PDF' => '',
77 | 'Pdf' => '',
78 | 'Permissions' => 'Permissies',
79 | 'Phone' => 'Telefoon',
80 | 'Picture' => 'Afbeelding',
81 | 'Position' => 'Positie',
82 | 'Remove' => 'Verwijderen',
83 | 'Remove file' => 'Verwijder bestand',
84 | 'Remove selected files' => 'Verwijder de geselecteerde bestanden',
85 | 'Rights' => 'Rechten',
86 | 'Role' => 'Rol',
87 | 'Roles' => 'Rollen',
88 | 'Routes' => 'Routes',
89 | 'Rules' => 'Regels',
90 | 'SKU' => 'Artikelnummer',
91 | 'Select a slider' => '',
92 | 'Select a {item}' => 'Selecteer een {item}',
93 | 'Select an {item}' => 'Selecteer een {item}',
94 | 'Set as main image' => 'Instellen als hoofdafbeelding',
95 | 'Show on homepage' => 'Tonen op homepagina',
96 | 'Show on homepage from' => 'Tonen op homepagina van',
97 | 'Show on homepage until' => 'Tonen op homepagina tot',
98 | 'Sort' => 'Sorteren',
99 | 'Sort {modelClass}' => 'Sorteren',
100 | 'Subtitle' => 'Subtitel',
101 | 'System' => 'Systeem',
102 | 'System name' => 'Systeemnaam',
103 | 'Template' => 'Template',
104 | 'The combination of Attribute ID and Language has already been taken.' => '',
105 | 'The combination of Entity and Entity ID has already been taken.' => 'Er bestaat al een alias voor deze combinatie',
106 | 'The item has been deleted' => 'Het item werd verwijderd',
107 | 'The sorting was successfully updated' => 'De sortering is gewijzigd',
108 | 'Title' => 'Titel',
109 | 'Toggle' => '',
110 | 'Toggle active' => 'Activeren / deactiveren',
111 | 'Toggle navigation' => 'Toon / verberg de navigatie',
112 | 'Translateable' => '',
113 | 'Translations' => 'Vertalingen',
114 | 'Type' => 'Type',
115 | 'Update' => 'Wijzigen',
116 | 'Update & close' => 'Wijzigen en sluiten',
117 | 'Update & new' => 'Wijzigen en toevoegen',
118 | 'Update {modelClass}' => '{modelClass} wijzigen',
119 | 'Update {modelClass}: ' => '{modelClass} wijzigen',
120 | 'Updated At' => 'Gewijzigd op',
121 | 'Updated at' => '',
122 | 'Upload' => 'Uploaden',
123 | 'Upload Error' => '',
124 | 'Upload file' => '',
125 | 'Upload selected files' => 'Upload de geselecteerde bestanden',
126 | 'Uploaded' => 'Ge-upload',
127 | 'Uploading ...' => 'Uploading ...',
128 | 'Url' => 'Url',
129 | 'Url alias' => 'Url alias',
130 | 'User' => 'Gebruiker',
131 | 'User defined' => 'Gebruiker',
132 | 'Users' => 'Gebruikers',
133 | 'View' => 'Bekijken',
134 | 'View attached file' => 'Bekijk het gekoppelde bestand',
135 | 'View {modelClass}' => 'Bekijk {modelClass}',
136 | 'Website' => 'Website',
137 | 'Welcome' => 'Welkom',
138 | 'Wijzigen' => '',
139 | 'Yes' => 'Ja',
140 | 'You do not have the right permissions to delete this item' => 'Je beschikt niet over voldoende rechten om dit item te verwijderen',
141 | 'field_id' => 'Expertise',
142 | '{item} has been deleted' => '{item} is verwijderd',
143 | '{item} has been updated' => '{item} is gewijzigd',
144 | '{item} successfully created' => '{item} succesvol toegevoegd',
145 | '{item} successfully updated' => '{item} succesvol gewijzigd',
146 | '{n, plural, =1{Image} other{# Images}} successfully deleted' => '{n, plural, =1{Afbeelding} other{# Afbeeldingen}} met succes verwijderd',
147 | '{n, plural, =1{Image} other{# images}} successfully uploaded' => '{n, plural, =1{Afbeelding} other{# afbeeldingen}} met success geupload',
148 | ];
149 |
--------------------------------------------------------------------------------
/messages/nl/infoweb/cms.php:
--------------------------------------------------------------------------------
1 | '"{item}" is toegevoegd',
5 | '"{item}" has been updated' => '"{item}" is gewijzigd',
6 | '-- Choose a {item} --' => '-- Selecteer een {item} --',
7 | '-- Choose an {item} --' => '-- Selecteer een {item} --',
8 | '-- Choose the {items} --' => '-- Selecteer de {items} --',
9 | 'Active' => 'Actief',
10 | 'Add {modelClass}' => 'Voeg {modelClass} toe',
11 | 'Alt' => 'Alt-tekst',
12 | 'Assigments' => 'Toewijzingen',
13 | 'Category' => 'Categorie',
14 | 'Choose a category' => 'Kies een categorie',
15 | 'Choose a type' => 'Selecteer een type',
16 | 'Choose a {item}' => 'Kies een {item}',
17 | 'Close' => 'Sluiten',
18 | 'Content' => 'Inhoud',
19 | 'Create' => 'Aanmaken',
20 | 'Create & close' => 'Aanmaken en sluiten',
21 | 'Create & new' => 'Aanmaken en toevoegen',
22 | 'Create {modelClass}' => '{modelClass} toevoegen',
23 | 'Created At' => 'Toegevoegd op',
24 | 'Dashboard' => 'Dashboard',
25 | 'Delete' => 'Verwijderen',
26 | 'Description' => 'Beschrijving',
27 | 'Duplicate' => 'Dupliceren',
28 | 'Duplicate content' => 'Content dupliceren',
29 | 'Duplicate empty fields' => 'Lege velden dupliceren',
30 | 'Edit {modelClass}' => 'Wijzig {modelClass}',
31 | 'Entity' => 'Gekoppeld aan',
32 | 'Entity ID' => 'Koppeling',
33 | 'Function' => 'Functie',
34 | 'General' => 'Algemeen',
35 | 'ID' => 'ID',
36 | 'Image' => 'Afbeelding',
37 | 'Language' => 'Taal',
38 | 'Languages' => 'Talen',
39 | 'Logout' => 'Uitloggen',
40 | 'Modules' => 'Modules',
41 | 'My profile' => 'Mijn profiel',
42 | 'Name' => 'Naam',
43 | 'No' => 'Nee',
44 | 'Options' => 'Opties',
45 | 'Overwrite populated fields' => 'Ingevulde velden overschrijven',
46 | 'Permissions' => 'Permissies',
47 | 'Picture' => 'Afbeelding',
48 | 'Position' => 'Positie',
49 | 'Rights' => 'Rechten',
50 | 'Roles' => 'Rollen',
51 | 'Routes' => 'Routes',
52 | 'Rules' => 'Regels',
53 | 'Show on homepage' => 'Weergeven op de homepagina',
54 | 'Show on homepage from' => 'Weergeven op de homepagina van',
55 | 'Show on homepage until' => 'Weergeven op de homepagina tot',
56 | 'Sort' => 'Sorteren',
57 | 'Sort {modelClass}' => 'Sorteren',
58 | 'System' => 'Systeem',
59 | 'Template' => 'Template',
60 | 'The combination of Entity and Entity ID has already been taken.' => 'Er bestaat al een alias voor deze combinatie',
61 | 'The item has been deleted' => 'Het item werd verwijderd',
62 | 'The sorting was successfully updated' => 'De sortering is gewijzigd',
63 | 'Title' => 'Titel',
64 | 'Toggle active' => 'Activeren / deactiveren',
65 | 'Toggle navigation' => 'Toon / verberg de navigatie',
66 | 'Translations' => 'Vertalingen',
67 | 'Type' => 'Type',
68 | 'Update' => 'Wijzigen',
69 | 'Update & close' => 'Wijzigen en sluiten',
70 | 'Update & new' => 'Wijzigen en toevoegen',
71 | 'Update {modelClass}' => '{modelClass} wijzigen',
72 | 'Update {modelClass}: ' => '{modelClass} wijzigen',
73 | 'Updated At' => 'Gewijzigd op',
74 | 'Url' => 'Url',
75 | 'User defined' => 'Gebruiker',
76 | 'Users' => 'Gebruikers',
77 | 'View' => 'Bekijken',
78 | 'View website' => 'Website bekijken',
79 | 'Welcome' => 'Welkom',
80 | 'Yes' => 'Ja',
81 | 'You do not have the right permissions to delete this item' => 'Je beschikt niet over voldoende rechten om dit item te verwijderen',
82 | 'field_id' => 'Expertise',
83 | '{item} has been deleted' => '{item} is verwijderd',
84 | '{item} has been updated' => '{item} is gewijzigd',
85 | '{item} successfully created' => '{item} succesvol toegevoegd',
86 | '{item} successfully updated' => '{item} succesvol gewijzigd',
87 | ];
88 |
--------------------------------------------------------------------------------
/migrations/m140930_123135_create_default_auth.php:
--------------------------------------------------------------------------------
1 | insert('{{%auth_item}}', [
12 | 'name' => 'Superadmin',
13 | 'type' => 1,
14 | 'description' => 'Superadmin',
15 | 'created_at' => time(),
16 | 'updated_at' => time()
17 | ]);
18 |
19 | $this->insert('{{%auth_item}}', [
20 | 'name' => '/*',
21 | 'type' => 2,
22 | 'description' => '',
23 | 'created_at' => time(),
24 | 'updated_at' => time()
25 | ]);
26 |
27 | // Assign the auth item to the main user
28 | $this->insert('{{%auth_assignment}}', [
29 | 'item_name' => 'Superadmin',
30 | 'user_id' => 1,
31 | 'created_at' => time()
32 | ]);
33 |
34 | // Create the auth item relation
35 | $this->insert('{{%auth_item_child}}', [
36 | 'parent' => 'Superadmin',
37 | 'child' => '/*'
38 | ]);
39 | }
40 |
41 | public function down()
42 | {
43 | echo "m140930_123135_create_default_permissions cannot be reverted.\n";
44 |
45 | return false;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/migrations/m141001_090124_add_default_permissions.php:
--------------------------------------------------------------------------------
1 | insert('{{%auth_item}}', [
12 | 'name' => 'showContentModule',
13 | 'type' => 2,
14 | 'description' => 'Show content module icon in main-menu',
15 | 'created_at' => time(),
16 | 'updated_at' => time()
17 | ]);
18 |
19 | $this->insert('{{%auth_item}}', [
20 | 'name' => 'showModulesModule',
21 | 'type' => 2,
22 | 'description' => 'Show modules module icon in main-menu',
23 | 'created_at' => time(),
24 | 'updated_at' => time()
25 | ]);
26 |
27 | $this->insert('{{%auth_item}}', [
28 | 'name' => 'showRightsModule',
29 | 'type' => 2,
30 | 'description' => 'Show rights module icon in main-menu',
31 | 'created_at' => time(),
32 | 'updated_at' => time()
33 | ]);
34 |
35 | $this->insert('{{%auth_item}}', [
36 | 'name' => 'showUsersModule',
37 | 'type' => 2,
38 | 'description' => 'Show users module icon in main-menu',
39 | 'created_at' => time(),
40 | 'updated_at' => time()
41 | ]);
42 |
43 | $this->insert('{{%auth_item}}', [
44 | 'name' => 'showTranslationsModule',
45 | 'type' => 2,
46 | 'description' => 'Show translations module in main-menu',
47 | 'created_at' => time(),
48 | 'updated_at' => time()
49 | ]);
50 |
51 | $this->insert('{{%auth_item}}', [
52 | 'name' => 'showMediaModule',
53 | 'type' => 2,
54 | 'description' => 'Show media module icon in main-menu',
55 | 'created_at' => time(),
56 | 'updated_at' => time()
57 | ]);
58 |
59 | $this->insert('{{%auth_item}}', [
60 | 'name' => 'showAliasModule',
61 | 'type' => 2,
62 | 'description' => 'Show alias module icon in main-menu',
63 | 'created_at' => time(),
64 | 'updated_at' => time()
65 | ]);
66 |
67 | // Create the auth item relation
68 | $this->insert('{{%auth_item_child}}', [
69 | 'parent' => 'Superadmin',
70 | 'child' => 'showContentModule'
71 | ]);
72 |
73 | $this->insert('{{%auth_item_child}}', [
74 | 'parent' => 'Superadmin',
75 | 'child' => 'showModulesModule'
76 | ]);
77 |
78 | $this->insert('{{%auth_item_child}}', [
79 | 'parent' => 'Superadmin',
80 | 'child' => 'showRightsModule'
81 | ]);
82 |
83 | $this->insert('{{%auth_item_child}}', [
84 | 'parent' => 'Superadmin',
85 | 'child' => 'showUsersModule'
86 | ]);
87 |
88 | $this->insert('{{%auth_item_child}}', [
89 | 'parent' => 'Superadmin',
90 | 'child' => 'showTranslationsModule'
91 | ]);
92 |
93 | $this->insert('{{%auth_item_child}}', [
94 | 'parent' => 'Superadmin',
95 | 'child' => 'showMediaModule'
96 | ]);
97 |
98 | $this->insert('{{%auth_item_child}}', [
99 | 'parent' => 'Superadmin',
100 | 'child' => 'showAliasModule'
101 | ]);
102 | }
103 |
104 | public function down()
105 | {
106 | // Delete the relations
107 | $this->delete('{{%auth_item_child}}', [
108 | 'parent' => 'Superadmin',
109 | 'child' => 'showContentModule'
110 | ]);
111 |
112 | $this->delete('{{%auth_item_child}}', [
113 | 'parent' => 'Superadmin',
114 | 'child' => 'showModulesModule'
115 | ]);
116 |
117 | $this->delete('{{%auth_item_child}}', [
118 | 'parent' => 'Superadmin',
119 | 'child' => 'showRightsModule'
120 | ]);
121 |
122 | $this->delete('{{%auth_item_child}}', [
123 | 'parent' => 'Superadmin',
124 | 'child' => 'showUsersModule'
125 | ]);
126 |
127 | $this->delete('{{%auth_item_child}}', [
128 | 'parent' => 'Superadmin',
129 | 'child' => 'showTranslationsModule'
130 | ]);
131 |
132 | $this->delete('{{%auth_item_child}}', [
133 | 'parent' => 'Superadmin',
134 | 'child' => 'showShopModule'
135 | ]);
136 |
137 | $this->delete('{{%auth_item_child}}', [
138 | 'parent' => 'Superadmin',
139 | 'child' => 'showMediaModule'
140 | ]);
141 |
142 | $this->delete('{{%auth_item_child}}', [
143 | 'parent' => 'Superadmin',
144 | 'child' => 'showCatalogueModule'
145 | ]);
146 |
147 | $this->delete('{{%auth_item_child}}', [
148 | 'parent' => 'Superadmin',
149 | 'child' => 'showAliasModule'
150 | ]);
151 |
152 | // Delete the auth items
153 | $this->delete('{{%auth_item}}', [
154 | 'name' => 'showContentModule',
155 | 'type' => 2,
156 | ]);
157 |
158 | $this->delete('{{%auth_item}}', [
159 | 'name' => 'showModulesModule',
160 | 'type' => 2,
161 | ]);
162 |
163 | $this->delete('{{%auth_item}}', [
164 | 'name' => 'showRightsModule',
165 | 'type' => 2,
166 | ]);
167 |
168 | $this->delete('{{%auth_item}}', [
169 | 'name' => 'showUsersModule',
170 | 'type' => 2,
171 | ]);
172 |
173 | $this->delete('{{%auth_item}}', [
174 | 'name' => 'showTranslationsModule',
175 | 'type' => 2,
176 | ]);
177 |
178 | $this->delete('{{%auth_item}}', [
179 | 'name' => 'showMediaModule',
180 | 'type' => 2,
181 | ]);
182 |
183 | $this->delete('{{%auth_item}}', [
184 | 'name' => 'showAliasModule',
185 | 'type' => 2,
186 | ]);
187 | }
188 | }
189 |
--------------------------------------------------------------------------------
/migrations/m150107_074600_create_image_tables.php:
--------------------------------------------------------------------------------
1 | db->driverName === 'mysql') {
13 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
14 | }
15 |
16 | // Drop image table
17 | if ($this->db->schema->getTableSchema('image', true)) {
18 | $this->dropTable('image');
19 | }
20 |
21 | $this->createTable('{{%image}}', [
22 | 'id' => Schema::TYPE_PK,
23 | 'name' => Schema::TYPE_STRING . '(255) NOT NULL',
24 | 'filePath' => Schema::TYPE_STRING . '(400) NOT NULL',
25 | 'itemId' => Schema::TYPE_STRING . '(255) NOT NULL',
26 | 'isMain' => 'TINYINT(3) UNSIGNED NOT NULL DEFAULT \'1\'',
27 | 'modelName' => Schema::TYPE_STRING . '(255) NOT NULL',
28 | 'urlAlias' => Schema::TYPE_STRING . '(255) NOT NULL',
29 | 'position' => Schema::TYPE_INTEGER . ' UNSIGNED NOT NULL',
30 | 'active' => 'TINYINT(3) UNSIGNED NOT NULL DEFAULT \'1\'',
31 | 'created_at' => Schema::TYPE_INTEGER . ' UNSIGNED NOT NULL',
32 | 'updated_at' => Schema::TYPE_INTEGER . ' UNSIGNED NOT NULL',
33 | ], $tableOptions);
34 |
35 | $this->createIndex('itemId', '{{%image}}', 'itemId');
36 |
37 | // Create 'image_lang' table
38 | $this->createTable('{{%image_lang}}', [
39 | 'image_id' => Schema::TYPE_INTEGER . ' NOT NULL',
40 | 'language' => Schema::TYPE_STRING . '(10) NOT NULL',
41 | 'alt' => Schema::TYPE_STRING . '(255) NOT NULL',
42 | 'title' => Schema::TYPE_STRING . '(255) NOT NULL',
43 | 'subtitle' => Schema::TYPE_STRING . ' NOT NULL',
44 | 'description' => Schema::TYPE_TEXT . ' NOT NULL',
45 | 'url' => Schema::TYPE_STRING . '(255) NOT NULL',
46 | 'created_at' => Schema::TYPE_INTEGER . ' UNSIGNED NOT NULL',
47 | 'updated_at' => Schema::TYPE_INTEGER . ' UNSIGNED NOT NULL',
48 | ], $tableOptions);
49 |
50 | $this->addPrimaryKey('image_lang_image_id_language', '{{%image_lang}}', ['image_id', 'language']);
51 | $this->createIndex('language', '{{%image_lang}}', 'language');
52 | $this->addForeignKey('FK_IMAGE_LANG_IMAGE_ID', '{{%image_lang}}', 'image_id', '{{%image}}', 'id', 'CASCADE', 'NO ACTION');
53 | }
54 |
55 | public function down()
56 | {
57 | $this->dropTable('image_lang');
58 | $this->dropTable('image');
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/migrations/m150526_084143_update_image_table.php:
--------------------------------------------------------------------------------
1 | alterColumn('image', 'isMain', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT \'0\'');
10 | }
11 |
12 | public function safeDown()
13 | {
14 | $this->alterColumn('image', 'isMain', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT \'1\'');
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/migrations/m150602_110727_add_identifier_field.php:
--------------------------------------------------------------------------------
1 | addColumn('{{%image}}', 'identifier', Schema::TYPE_STRING.'(255) NOT NULL');
11 | }
12 |
13 | public function down()
14 | {
15 | $this->dropColumn('{{%image}}', 'identifier');
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/migrations/m151012_130517_add_account_permissions.php:
--------------------------------------------------------------------------------
1 | insert('{{%auth_item}}', [
11 | 'name' => 'showProfile',
12 | 'type' => 2,
13 | 'description' => 'Show profile icon in user dropdown',
14 | 'created_at' => time(),
15 | 'updated_at' => time()
16 | ]);
17 |
18 | $this->insert('{{%auth_item}}', [
19 | 'name' => 'showAccount',
20 | 'type' => 2,
21 | 'description' => 'Show account icon in user dropdown',
22 | 'created_at' => time(),
23 | 'updated_at' => time()
24 | ]);
25 |
26 | $this->insert('{{%auth_item_child}}', [
27 | 'parent' => 'Superadmin',
28 | 'child' => 'showProfile',
29 | ]);
30 |
31 | $this->insert('{{%auth_item_child}}', [
32 | 'parent' => 'Superadmin',
33 | 'child' => 'showAccount',
34 | ]);
35 | }
36 |
37 | public function safeDown()
38 | {
39 | $this->delete('{{%auth_item_child}}', [
40 | 'parent' => 'Superadmin',
41 | 'child' => 'showProfile'
42 | ]);
43 |
44 | $this->delete('{{%auth_item_child}}', [
45 | 'parent' => 'Superadmin',
46 | 'child' => 'showAccount'
47 | ]);
48 |
49 | $this->delete('{{%auth_item}}', [
50 | 'name' => 'showProfile',
51 | 'type' => 2,
52 | ]);
53 |
54 | $this->delete('{{%auth_item}}', [
55 | 'name' => 'showAccount',
56 | 'type' => 2,
57 | ]);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/migrations/m151118_084144_update_image_lang_table.php:
--------------------------------------------------------------------------------
1 | dropColumn('image_lang', 'url');
11 | $this->addColumn('image_lang', 'link', Schema::TYPE_STRING . '(255) NOT NULL');
12 | }
13 |
14 | public function safeDown()
15 | {
16 | $this->dropColumn('image_lang', 'link');
17 | $this->addColumn('image_lang', 'url', Schema::TYPE_STRING . '(255) NOT NULL');
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/migrations/m160614_090913_add_position_column.php:
--------------------------------------------------------------------------------
1 | addColumn('{{%image}}', 'text_position', Schema::TYPE_STRING.'(255) NOT NULL');
12 | }
13 |
14 | public function safeDown()
15 | {
16 | $this->dropColumn('{{%image}}', 'text_position');
17 | }
18 | }
--------------------------------------------------------------------------------
/models/Image.php:
--------------------------------------------------------------------------------
1 | [
24 | 'class' => TimestampBehavior::className(),
25 | 'attributes' => [
26 | ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],
27 | ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at',
28 | ],
29 | 'value' => function () {
30 | return time();
31 | },
32 | ],
33 | 'translateable' => [
34 | 'class' => TranslateableBehavior::className(),
35 | 'translationAttributes' => [
36 | 'alt',
37 | 'title',
38 | 'subtitle',
39 | 'description',
40 | 'link'
41 | ]
42 | ],
43 | ]);
44 | }
45 |
46 | /**
47 | * @inheritdoc
48 | */
49 | public function attributeLabels()
50 | {
51 | return [
52 | 'name' => Yii::t('app', 'Image'),
53 | 'filePath' => Yii::t('app', 'File Path'),
54 | 'itemId' => Yii::t('app', 'Item ID'),
55 | 'isMain' => Yii::t('app', 'Main image'),
56 | 'modelName' => Yii::t('app', 'Attached to'),
57 | 'urlAlias' => Yii::t('app', 'Url alias'),
58 | 'active' => Yii::t('app', 'Active'),
59 | 'text_position' => Yii::t('app', 'Text position')
60 | ];
61 | }
62 |
63 | public function textPositionLabels() {
64 | return [
65 | self::TEXT_POSITION_LEFT => Yii::t('app', 'Left'),
66 | self::TEXT_POSITION_RIGHT => Yii::t('app', 'Right'),
67 | self::TEXT_POSITION_CENTER => Yii::t('app', 'Center'),
68 | ];
69 | }
70 |
71 | public function getUrl($size = false, $crop = true, $fitImageInCanvas = false)
72 | {
73 | // Check if the image exists or return a placeholder
74 | if (!file_exists(Yii::getAlias('@uploadsBasePath/img/') . $this->filePath)) {
75 | $img = new PlaceHolder;
76 | return $img->getUrl($size);
77 | }
78 |
79 | $urlSize = ($size) ? '_'.$size : '';
80 | $base = $this->getModule()->getCachePath();
81 | $sub = $this->getSubDur();
82 | $origin = $this->getPathToOrigin();
83 |
84 | $filePath = $base.'/'.$sub.'/'.$this->urlAlias.$urlSize.'.'.pathinfo($origin, PATHINFO_EXTENSION);
85 |
86 | if(!file_exists($filePath)){
87 | $this->createVersion($origin, $size, $crop, $fitImageInCanvas);
88 |
89 | if(!file_exists($filePath)){
90 | throw new \Exception(Yii::t('app', 'The image does not exist'));
91 | }
92 | }
93 |
94 | $httpPath = \Yii::getAlias('@uploadsBaseUrl').'/img/cache/'.$sub.'/'.$this->urlAlias.$urlSize.'.'.pathinfo($origin, PATHINFO_EXTENSION);
95 |
96 | return $httpPath;
97 | }
98 |
99 | /**
100 | * Returns the path to the image
101 | *
102 | * @param string|boolean The size of the image
103 | * @param boolean Does cropping have to be applied
104 | * @return string
105 | * @uses infoweb\cms\models\Image::getUrl()
106 | */
107 | public function getPath($size = false, $crop = true)
108 | {
109 | $url = $this->getUrl($size, $crop);
110 |
111 | // Replace the baseUrl with the basePath
112 | return str_replace(\Yii::getAlias('@uploadsBaseUrl'), \Yii::getAlias('@uploadsBasePath'), $url);
113 | }
114 |
115 | public function getBaseUrl()
116 | {
117 | $base = $this->getModule()->getStorePath();
118 | $sub = $this->getSubDur();
119 | $origin = $this->getPathToOrigin();
120 |
121 | return $base.'/'.$this->filePath;
122 | }
123 |
124 | public function createVersion($imagePath, $sizeString = false, $crop = true, $fitImageInCanvas = false)
125 | {
126 | if(strlen($this->urlAlias)<1){
127 | throw new \Exception('Image without urlAlias!');
128 | }
129 |
130 | $cachePath = $this->getModule()->getCachePath();
131 | $subDirPath = $this->getSubDur();
132 | $fileExtension = pathinfo($this->filePath, PATHINFO_EXTENSION);
133 |
134 | if($sizeString){
135 | $sizePart = '_'.$sizeString;
136 | }
137 | else{
138 | $sizePart = '';
139 | }
140 |
141 | $pathToSave = $cachePath.'/'.$subDirPath.'/'.$this->urlAlias.$sizePart.'.'.$fileExtension;
142 |
143 | BaseFileHelper::createDirectory(dirname($pathToSave), 0777, true);
144 |
145 | if($sizeString) {
146 | $size = $this->getModule()->parseSize($sizeString);
147 | }
148 | else{
149 | $size = false;
150 | }
151 |
152 | if($this->getModule()->graphicsLibrary == 'Imagick'){
153 | // Fixes interlaced images
154 | $interlaceFix = $this->interlaceFix($imagePath);
155 |
156 | if($interlaceFix) {
157 | $image = new \Imagick();
158 | $image->readImageBlob($interlaceFix);
159 | }
160 | else {
161 | $image = new \Imagick($imagePath);
162 | }
163 |
164 | $image->setImageCompressionQuality(100);
165 |
166 | // Fixes image rotations
167 | $this->ImagickAutoRotateImage($image);
168 |
169 | // If the dimensions of the original image match the requested
170 | // dimensions the original image is just copied to the new path
171 | if ($image->getImageWidth() == $size['width'] && $image->getImageHeight() == $size['height']) {
172 | copy($imagePath, $pathToSave);
173 | return $image;
174 | }
175 |
176 | if($size){
177 | if($size['height'] && $size['width']){
178 | if(!$crop && $fitImageInCanvas) {
179 | $image = $this->fitImageInCanvas($image, $size['width'], $size['height']);
180 | } elseif ($crop) {
181 | $image->cropThumbnailImage($size['width'], $size['height']);
182 | } else {
183 | $image->resizeImage($size['width'], $size['height'], \Imagick::FILTER_HAMMING, 1, false);
184 | }
185 | } elseif($size['height']){
186 | $image->thumbnailImage(0, $size['height']);
187 | } elseif($size['width']){
188 | $image->thumbnailImage($size['width'], 0);
189 | } else{
190 | throw new \Exception('Something wrong with this->module->parseSize($sizeString)');
191 | }
192 | }
193 |
194 | $image->writeImage($pathToSave);
195 | } else {
196 | $image = new \abeautifulsite\SimpleImage($imagePath);
197 |
198 | // If the dimensions of the original image match the requested
199 | // dimensions the original image is just copied to the new path
200 | if ($image->get_width() == $size['width'] && $image->get_height() == $size['height']) {
201 | copy($imagePath, $pathToSave);
202 | return $image;
203 | }
204 |
205 | if($size){
206 | if($size['height'] && $size['width']){
207 | if($crop) {
208 | $image->thumbnail($size['width'], $size['height']);
209 | }
210 | else {
211 | $image->resize($size['width'], $size['height']);
212 | }
213 | }elseif($size['height']){
214 | $image->fit_to_height($size['height']);
215 | }elseif($size['width']){
216 | $image->fit_to_width($size['width']);
217 | }else{
218 | throw new \Exception('Something wrong with this->module->parseSize($sizeString)');
219 | }
220 | }
221 |
222 | //WaterMark
223 | if($this->getModule()->waterMark){
224 |
225 | if(!file_exists(Yii::getAlias($this->getModule()->waterMark))){
226 | throw new Exception('WaterMark not detected!');
227 | }
228 |
229 | $wmMaxWidth = intval($image->get_width()*0.4);
230 | $wmMaxHeight = intval($image->get_height()*0.4);
231 |
232 | $waterMarkPath = Yii::getAlias($this->getModule()->waterMark);
233 |
234 | $waterMark = new \abeautifulsite\SimpleImage($waterMarkPath);
235 |
236 |
237 |
238 | if(
239 | $waterMark->get_height() > $wmMaxHeight
240 | or
241 | $waterMark->get_width() > $wmMaxWidth
242 | ){
243 |
244 | $waterMarkPath = $this->getModule()->getCachePath().DIRECTORY_SEPARATOR.
245 | pathinfo($this->getModule()->waterMark)['filename'].
246 | $wmMaxWidth.'x'.$wmMaxHeight.'.'.
247 | pathinfo($this->getModule()->waterMark)['extension'];
248 |
249 | //throw new Exception($waterMarkPath);
250 | if(!file_exists($waterMarkPath)){
251 | $waterMark->fit_to_width($wmMaxWidth);
252 | $waterMark->save($waterMarkPath, 100);
253 | if(!file_exists($waterMarkPath)){
254 | throw new Exception('Cant save watermark to '.$waterMarkPath.'!!!');
255 | }
256 | }
257 |
258 | }
259 |
260 | $image->overlay($waterMarkPath, 'bottom right', .5, -10, -10);
261 |
262 | }
263 |
264 | $image->save($pathToSave, 100);
265 | }
266 |
267 | return $image;
268 | }
269 |
270 | public function fitImageInCanvas(\Imagick $image, $width, $height) {
271 | $imageHeight = $image->getImageHeight();
272 | $imageWidth = $image->getImageWidth();
273 |
274 | if ($imageWidth > $width) {
275 | $image->scaleImage($width, $height, true);
276 | }
277 | if ($imageHeight > $height) {
278 | $image->scaleImage($width, $height, true);
279 | }
280 |
281 | $oldWidth = $image->getImageWidth();
282 | $oldHeight = $image->getImageHeight();
283 |
284 | #coords to center image inside fixed width/height canvas
285 | $x = ($width - $oldWidth) / 2;
286 | $y = ($height - $oldHeight) / 2;
287 |
288 | #create new image with the user image centered
289 | $newImage = new \Imagick();
290 | $bgColor = ($image->getImageFormat() == 'png') ? 'none' : 'white';
291 | $newImage->newImage($width, $height, new \ImagickPixel($bgColor));
292 | $newImage->compositeImage($image, \Imagick::COMPOSITE_OVER, $x, $y);
293 |
294 | return $newImage;
295 | }
296 |
297 |
298 |
299 | /**
300 | * Fix interlaceFix
301 | *
302 | * @param type $file
303 | * @return boolean
304 | */
305 | public function interlaceFix($file) {
306 | $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
307 |
308 | if ($ext == 'png') {
309 | $phpimage = imagecreatefrompng($file);
310 |
311 | imagealphablending($phpimage, false);
312 | imagesavealpha($phpimage, true);
313 |
314 | if ($phpimage) {
315 | imageinterlace($phpimage, 0);
316 | ob_start();
317 | imagepng($phpimage);
318 | }
319 | else {
320 | unset($phpimage);
321 | }
322 | }
323 | elseif ($ext == 'jpeg') {
324 | $phpimage = imagecreatefromjpeg($file);
325 |
326 | if ($phpimage) {
327 | imageinterlace($phpimage, 0);
328 | ob_start();
329 | imagejpeg($phpimage);
330 | }
331 | else {
332 | unset($phpimage);
333 | }
334 | }
335 |
336 | if (isset($phpimage)) {
337 | imagedestroy($phpimage);
338 | return ob_get_clean();
339 | }
340 |
341 | return false;
342 | }
343 |
344 | /**
345 | * Automatic rotation fix
346 | *
347 | * @param \Imagick $image
348 | */
349 | public function ImagickAutoRotateImage(\Imagick $image) {
350 | $orientation = $image->getImageOrientation();
351 | switch ($orientation) {
352 | case \imagick::ORIENTATION_BOTTOMRIGHT :
353 | $image->rotateimage("#000", 180);
354 | // rotate 180 degrees
355 | break;
356 |
357 | case \imagick::ORIENTATION_RIGHTTOP :
358 | $image->rotateimage("#000", 90);
359 | // rotate 90 degrees CW
360 | break;
361 |
362 | case \imagick::ORIENTATION_LEFTBOTTOM :
363 | $image->rotateimage("#000", -90);
364 | // rotate 90 degrees CCW
365 | break;
366 | }
367 |
368 | $image->setImageOrientation(\imagick::ORIENTATION_TOPLEFT);
369 | }
370 |
371 | /**
372 | * @inheritdoc
373 | */
374 | public function rules()
375 | {
376 | return [
377 | // @todo Update rules
378 | //[['filePath', 'itemId', 'modelName', 'urlAlias'], 'required'],
379 | [['itemId', 'isMain', 'created_at', 'updated_at'], 'integer'],
380 | [['filePath', 'urlAlias'], 'string', 'max' => 400],
381 | [['modelName', 'identifier', 'text_position'], 'string', 'max' => 255],
382 | ['text_position', 'default', 'value' => self::TEXT_POSITION_LEFT]
383 | ];
384 | }
385 |
386 | /**
387 | * @return \yii\db\ActiveQuery
388 | */
389 | public function getTranslations()
390 | {
391 | return $this->hasMany(ImageLang::className(), ['image_id' => 'id']);
392 | }
393 |
394 | public function getPopupImage()
395 | {
396 | return 'params['breadcrumbs'])) ? 'class="breadcrumb-padding"' :''; ?>>
98 | = $content ?>
99 |
100 |
104 |
105 |
106 |
107 | 'duplicateable-modal',
109 | 'header' => '