This repository was archived by the owner on May 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathext.flag_master.php
More file actions
114 lines (94 loc) · 2.74 KB
/
Copy pathext.flag_master.php
File metadata and controls
114 lines (94 loc) · 2.74 KB
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
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* mithra62 - EE Add-on Stub
*
* @package mithra62:EE_addon_stub
* @author Eric Lamb
* @copyright Copyright (c) 2012, mithra62, Eric Lamb.
* @link http://blah.com
* @version 1.0
* @filesource ./system/expressionengine/third_party/ee_addon_stub/
*/
/**
* EE Add-on Stub - Ext Class
*
* Extension class
*
* @package mithra62:Ee_addon_stub
* @author Eric Lamb
* @filesource ./system/expressionengine/third_party/ee_addon_stub/ext.flag_master.php
*/
class Flag_master_ext
{
public $settings = array();
public $description = '';
public $settings_exist = 'y';
public $docs_url = '';
public $required_by = array('module');
/**
* Constructor
*
* @param mixed Settings array or empty string if none exist.
*/
public function __construct()
{
$this->EE =& get_instance();
$path = dirname(realpath(__FILE__));
include $path.'/config'.EXT;
$this->description = $config['description'];
$this->docs_url = $config['docs_url'];
$this->class = $this->name = $config['class_name'];
$this->settings_table = $config['settings_table'];
$this->version = $config['version'];
$this->mod_name = $config['mod_url_name'];
$this->ext_class_name = $config['ext_class_name'];
$this->EE->lang->loadfile('flag_master');
}
public function settings_form()
{
$this->EE->functions->redirect(BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module='.$this->mod_name.AMP.'method=settings');
}
/**
* Adds additional template tags to the comment template tag
* @param string $tagdata
* @param array $row
* @return string
*/
public function comment_entries_tagdata($tagdata, $row)
{
$this->EE->load->library('flag_master_lib');
$this->EE->load->library('flag_master_profiles');
$total = (string)$this->EE->flag_master_flags->get_total_flags($row['comment_id'], 'comment');
$tagdata = $this->EE->TMPL->swap_var_single('flag_master:comment_total_flags', $total, $tagdata);
return $tagdata;
}
/**
* Adds additional template tags to the entry template tag
* @param string $tagdata
* @param array $row
* @return string
*/
public function channel_entries_tagdata($tagdata, $row)
{
$this->EE->load->library('flag_master_lib');
$this->EE->load->library('flag_master_profiles');
$total = (string)$this->EE->flag_master_flags->get_total_flags($row['entry_id'], 'entry');
$tagdata = $this->EE->TMPL->swap_var_single('flag_master:entry_total_flags', $total, $tagdata);
return $tagdata;
}
public function void()
{
}
public function activate_extension()
{
return TRUE;
}
public function update_extension($current = '')
{
return TRUE;
}
public function disable_extension()
{
return TRUE;
}
}