This repository was archived by the owner on Apr 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathacc.dev_docs.php
More file actions
84 lines (60 loc) · 2.27 KB
/
acc.dev_docs.php
File metadata and controls
84 lines (60 loc) · 2.27 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
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Dev Docs Accessory
*
* Hook into the CP Menu and add a Dev Docs flyout
*
* @package Dev Docs
* @author Minds On Design Lab, Inc. <dev@mod-lab.com>
* @copyright Copyright (c) 2012 Minds On Design Lab, Inc.
* @link https://github.com/Minds-On-Design-Lab/dev_docs.ee_addon
* @license MIT http://opensource.org/licenses/mit-license.php
*/
require_once(PATH_THIRD . 'dev_docs/config/dev_docs.php');
class Dev_docs_acc {
var $name = "Dev Docs Accessory";
var $id = 'dev_docs_acc';
var $version = '1.0';
var $description = "Adds a Dev Docs dropdown menu to the CP main menu";
var $sections = array();
/**
* Constructor
*/
public function Dev_docs_acc() {
$this->EE =& get_instance();
$this->EE->load->add_package_path(PATH_THIRD . 'dev_docs');
$this->EE->load->config('dev_docs');
$this->EE->load->model('dev_docs_model');
$this->EE->load->library('Docs_library');
// Lang file isn't auto-loaded for some reason
$this->EE->lang->loadfile('dev_docs');
$this->_url_base = $this->EE->config->item('dd:mod_url_base');
}
public function set_sections() {
$r = '';
$this->sections[] = '<script type="text/javascript" charset="utf-8">$("#accessoryTabs a.dev_docs_acc").parent().remove();</script>';
$installed_modules = $this->EE->cp->get_installed_modules();
if(array_key_exists('dev_docs', $installed_modules)) {
$pages = $this->EE->dev_docs_model->get_pages();
foreach ($pages as $page) {
$title = $page['heading'];
$link = $this->_url_base . AMP . 'docs_page=' . $page['short_name'];
$r .= '<li><a href=\''. $link .'\'>'. $title .'</a></li>';
}
$this->EE->cp->add_to_head('
<script type="text/javascript">
$(document).ready(function(){
var ddpages = "'.$r.'";
var dev_docs_menu = "<li class=\'parent\'><a class=\'first_level\' href=\'#\'>Dev Docs</a><ul>" + ddpages + "<li class=\'bubble_footer\'></li></ul></li>";
$("ul#navigationTabs > li.parent:nth-child(3)").before(dev_docs_menu);
});
</script>
');
}
}
public function update() {
return TRUE;
}
}
/* End of file acc.dev_docs.php */
/* Location: ./system/expressionengine/third_party/dev_docs/acc.dev_docs.php */