-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetails.php
104 lines (90 loc) · 2.71 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
<?php defined('BASEPATH') or exit('No direct script access allowed');
/**
* @author Steve Williamson
* @package PyroCMS
* @subpackage Modules
* @category Wordcloud
*/
class Module_Wordcloud extends Module {
public $version = '1.0';
public function info()
{
$info = array(
'name' => array(
'en' => 'Wordcloud',
),
'description' => array(
'en' => 'Show a wordcloud on your website.',
),
'frontend' => TRUE,
'backend' => TRUE,
'skip_xss' => TRUE,
'menu' => 'content',
'sections' => array(
'wordcloud' => array(
'name' => 'wordcloud:list_title',
'uri' => 'admin/wordcloud',
'shortcuts' => array(
array(
'name' => 'wordcloud:add_title',
'uri' => 'admin/wordcloud/create',
'class' => 'add'
),
),
)
)
);
return $info;
}
public function install()
{
$this->load->driver('Streams');
$this->lang->load('wordcloud/wordcloud');
$this->streams->streams->add_stream('wordcloud', 'wordcloud', 'wordcloud', 'wordcloud_', NULL);
$this->streams->streams->update_stream('wordcloud', 'wordcloud', array('stream_prefix' => 'wordcloud_', 'title_column' => 'text', 'sorting' => 'custom', 'view_options' => array('created','text', 'weight', 'link')));
$fields = array(
array(
'name' => 'lang:wordcloud:text',
'slug' => 'text',
'namespace' => 'wordcloud',
'type' => 'text',
),
array(
'name' => 'lang:wordcloud:weight',
'slug' => 'weight',
'namespace' => 'wordcloud',
'type' => 'integer',
),
array(
'name' => 'lang:wordcloud:link',
'slug' => 'link',
'namespace' => 'wordcloud',
'type' => 'text',
),
);
// Add all the Fields
$this->streams->fields->add_fields($fields);
// Assign Child Fields
$this->streams->fields->assign_field('wordcloud', 'wordcloud', 'text', array('required' => true, 'instructions' => lang('wordcloud:instructions:text')));
$this->streams->fields->assign_field('wordcloud', 'wordcloud', 'weight', array('required' => true, 'instructions' => lang('wordcloud:instructions:weight')));
$this->streams->fields->assign_field('wordcloud', 'wordcloud', 'link', array('required' => false, 'instructions' => lang('wordcloud:instructions:link')));
return TRUE;
}
public function uninstall()
{
$this->load->driver('Streams');
$this->streams->utilities->remove_namespace('wordcloud');
return TRUE;
}
public function upgrade($old_version)
{
// Your Upgrade Logic
return TRUE;
}
public function help()
{
// Return a string containing help info
// You could include a file and return it here.
return "No help information yet.";
}
}