-
Notifications
You must be signed in to change notification settings - Fork 24
/
details.php
144 lines (131 loc) · 6.29 KB
/
details.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php defined('BASEPATH') or exit('No direct script access allowed');
class Module_Galleries extends Module {
public $version = '1.4';
public function info()
{
return array(
'name' => array(
'sl' => 'Galerija',
'en' => 'Galleries',
'el' => 'Γκαλερί',
'de' => 'Galerien',
'pl' => 'Galerie',
'nl' => 'Gallerijen',
'fr' => 'Galeries',
'zh' => '畫廊',
'it' => 'Gallerie',
'ru' => 'Галереи',
'ar' => 'معارض الصّور',
'br' => 'Galerias',
'cs' => 'Galerie',
'es' => 'Galerías',
'fi' => 'Galleriat',
'lt' => 'Galerijos'
),
'description' => array(
'sl' => 'Modul galerije vam omogoča da ustvarite albume vaših slik.',
'en' => 'The galleries module is a simple module that lets users display images from Files.',
'el' => 'Παρέχει την δυνατότητα στους χρήστες να δημιουργούν άλμπουμ εικόνων.',
'de' => 'Mit dem Galerie Modul kannst du Bildergalerien anlegen.',
'pl' => 'Moduł pozwalający tworzyć galerie zdjęć.',
'nl' => 'De gallerij module die gebruikers in staat stelt afbeeldingsgallerijen te maken.',
'fr' => 'Galerie est une puissante extension permettant de créer des galeries d\'images.',
'zh' => '這是一個功能完整的畫廊模組,可以讓用戶建立自己的畫本或相簿。',
'it' => 'Il modulo gallerie è un potente modulo che permette agli utenti di creare gallerie di immagini.',
'ru' => 'Галереи - мощный модуль, который даёт пользователям возможность создавать галереи изображений.',
'ar' => 'هذه الوحدة تمُكّنك من إنشاء معارض الصّور بسهولة.',
'br' => 'O módulo de galerias é um poderoso módulo que permite aos usuários criar galerias de imagens.',
'cs' => 'Silný modul pro vytváření a správu galerií obrázků.',
'es' => 'Galerías es un potente módulo que permite a los usuarios crear galerías de imágenes.',
'fi' => 'Galleria moduuli antaa käyttäjien luoda kuva gallerioita.',
'lt' => 'Galerijos modulis leidžia vartotojams kurti nuotraukų galerijas'
),
'frontend' => TRUE,
'backend' => TRUE,
'menu' => 'content',
'shortcuts' => array(
array(
'name' => 'galleries.new_gallery_label',
'uri' => 'admin/galleries/create',
'class' => 'add'
),
),
);
}
public function install()
{
$this->dbforge->drop_table('galleries');
$this->dbforge->drop_table('gallery_images');
$galleries = "
CREATE TABLE ".$this->db->dbprefix('galleries')." (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`folder_id` int(11) NOT NULL,
`thumbnail_id` char(15) DEFAULT NULL,
`description` text,
`updated_on` int(15) NOT NULL,
`preview` varchar(255) DEFAULT NULL,
`enable_comments` int(1) DEFAULT NULL,
`published` int(1) DEFAULT NULL,
`css` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci,
`js` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `slug` (`slug`),
UNIQUE KEY `thumbnail_id` (`thumbnail_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
";
$gallery_images = "
CREATE TABLE ".$this->db->dbprefix('gallery_images')." (
`id` int(11) NOT NULL AUTO_INCREMENT,
`file_id` char(15) COLLATE utf8_unicode_ci NOT NULL,
`gallery_id` int(11) NOT NULL,
`order` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `gallery_id` (`gallery_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
";
$gallery_settings = "INSERT INTO `".$this->db->dbprefix('settings')."` (`slug`, `title`, `description`, `type`, `default`, `value`, `options`, `is_required`, `is_gui`, `module`, `order`) VALUES ('per_page', 'Per page', 'You can set the number of galleries to show in a single page', 'text', '10', '', '', '1', '1', 'galleries', '1001');";
if($this->db->query($galleries) && $this->db->query($gallery_images) && $this->db->query($gallery_settings) )
{
return TRUE;
}
}
public function uninstall()
{
$sql_settings = "DELETE FROM ".$this->db->dbprefix('settings')." WHERE slug = 'per_page' ";
if($this->dbforge->drop_table('galleries') &&
$this->dbforge->drop_table('gallery_images') && $this->db->query($sql_settings) )
{
return TRUE;
}
}
public function upgrade($old_version)
{
return TRUE;
}
public function help()
{
// Return a string containing help info
// You could include a file and return it here.
return "<h4>Overview</h4>
<p>The galleries module is a basic photo management tool. Features include drag & drop sorting and sub galleries.</p>
<h4>Creating Galleries</h4>
<p>To create a gallery go to Content->Files and create a new folder. Come back to Galleries and click \"Create a new gallery\" and select the folder of images that you just created in the File manager.
Fill out the title, slug, and the (optional) Description. (The Description shows
beside the gallery thumbnail at http://example.com/galleries). Choose whether you want to enable comments for this gallery or not
and select Publish if you wish for the gallery to show in the list of galleries. Note: selecting Unpublish does not disable the gallery, it just
removes it from the list at http://example.com/galleries. You can still create a navigation link directly to it and the
gallery will be viewable. For example: http://example.com/galleries/gallery-title</p>
<h4>Uploading Images</h4>
<p>For instructions on how to upload images refer to the Files documentation.</p>
<h4>Manage Gallery</h4>
<p>Click on List Galleries->Manage. Here you may change the gallery's title, slug, description, etc. If you want a thumbnail to represent this
gallery in the gallery list you may choose one from the dropdown and click Save. To change the order that the images are displayed in on the front-end
simply grab the images and drag them into the proper order.</p>
<h4>Editing an Image</h4>
<p>From the Manage page click on the image that you would like to edit. A modal window will appear and you may change
the title and the description of the image. You may also move the image to a different folder.</p>";
}
}
/* End of file details.php */