Changeset 4078 for extensions/adult_content/class.inc.php
- Timestamp:
- Oct 21, 2009, 4:00:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/adult_content/class.inc.php
r3494 r4078 46 46 $menu->register_block(new RegisteredBlock('mbAdultContent', 'Adult Content', 'AC')); 47 47 } 48 48 function ac_lien_menu($menu) 49 { 50 array_push($menu, array('NAME' => 'Adult Content', 51 'URL' => get_admin_plugin_menu_link(get_root_url().'plugins/'.$this->plugin_name.'/admin/admin.php'))); 52 return $menu; 53 } 54 function get_template($file) 55 { 56 global $user, $template; 57 58 $dir = $this->plugin_path.'template/'; 59 $theme_file = $dir.$user['template'].'/'.$user['theme'].'/'.$file; 60 $template_file = $dir.$user['template'].'/'.$file; 61 62 if (file_exists($theme_file)) 63 { 64 return $theme_file; 65 } 66 elseif (file_exists($template_file)) 67 { 68 return $template_file; 69 } 70 else 71 { 72 return $dir.'yoga/'.$file; 73 } 74 } 75 76 function set_block_on_index () 77 { 78 global $page, $template; 79 80 if (isset($page['section']) and $page['section'] == 'categories') 81 { 82 $template->set_filename('ac_block', realpath($this->get_template('block.tpl') ) ); 83 $begin = 'PLUGIN_INDEX_CONTENT_BEFORE'; 84 $end = 'PLUGIN_INDEX_CONTENT_AFTER'; 85 $template->concat($begin, $template->parse('ac_block', true)); 86 } 87 } 49 88 function placer_identification($menu_ref_arr) 50 89 { … … 74 113 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { 75 114 $block->set_title(l10n('ac_title_menu')); 76 $block->template = $this-> plugin_path.'template/'.$user['template'].'/opened.tpl';115 $block->template = $this->get_template('opened.tpl'); 77 116 } 78 117 } … … 82 121 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { 83 122 $block->set_title(l10n('ac_title_fermer')); 84 $block->template = $this-> plugin_path.'template/'.$user['template'].'/closed.tpl';123 $block->template = $this->get_template('closed.tpl'); 85 124 } 86 125 … … 93 132 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { 94 133 $block->set_title(l10n('ac_title_fermer')); 95 $block->template = $this-> plugin_path.'template/'.$user['template'].'/closed.tpl';134 $block->template = $this->get_template('closed.tpl'); 96 135 } 97 136 } … … 101 140 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { 102 141 $block->set_title(l10n('ac_title_menu')); 103 $block->template = $this-> plugin_path.'template/'.$user['template'].'/opened.tpl';142 $block->template = $this->get_template('opened.tpl'); 104 143 } 105 144 … … 117 156 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { 118 157 $block->set_title(l10n('ac_title_menu')); 119 $block->template = $this-> plugin_path.'template/'.$user['template'].'/msg.tpl';158 $block->template = $this->get_template('msg.tpl'); 120 159 } 121 160 … … 133 172 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { 134 173 $block->set_title(l10n('ac_title_menu')); 135 $block->template = $this-> plugin_path.'template/'.$user['template'].'/msg.tpl';174 $block->template = $this->get_template('msg.tpl'); 136 175 } 137 176
Note: See TracChangeset
for help on using the changeset viewer.