Changeset 26524


Ignore:
Timestamp:
Jan 8, 2014, 5:44:34 PM (7 years ago)
Author:
mistic100
Message:

add link in Admin Tools 'Edit' menu if available

Location:
extensions/gvideo
Files:
18 added
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/gvideo/admin.php

    r26470 r26524  
    33
    44global $template, $page, $conf;
     5
     6load_language('plugin.lang', GVIDEO_PATH);
    57
    68$page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'add';
  • extensions/gvideo/include/events.inc.php

    r26470 r26524  
    1414    // add custom parser
    1515    add_event_handler('render_element_content', 'gvideo_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL-10, 2);
     16
     17    if (defined('ADMINTOOLS_ID'))
     18    {
     19      global $template;
     20
     21      load_language('plugin.lang', GVIDEO_PATH);
     22
     23      $template->assign(array(
     24        'GVIDEO_PATH' => GVIDEO_PATH,
     25        'U_GVIDEO_EDIT' => GVIDEO_ADMIN.'-photo&image_id='.$picture['current']['id'],
     26        ));
     27
     28      $template->set_prefilter('ato_public_controller', 'gvideo_admintools');
     29    }
    1630  }
    1731 
    1832  return $picture;
     33}
     34
     35function gvideo_admintools($content)
     36{
     37  $search = '{if isset($ato.U_DELETE)}';
     38  $replace = '
     39{if isset($U_GVIDEO_EDIT)}
     40  {combine_css path=$GVIDEO_PATH|cat:\'template/fontello/css/gvideo.css\'}
     41  <li><a class="icon-gvideo-movie" href="{$U_GVIDEO_EDIT}">{\'Video properties\'|translate}</a></li>
     42{/if}
     43{if isset($ato.U_DELETE)}';
     44
     45  return str_replace($search, $replace, $content);
    1946}
    2047
  • extensions/gvideo/main.inc.php

    r26470 r26524  
    4545  $maintain->autoUpdate(GVIDEO_VERSION, 'install');
    4646 
    47   load_language('plugin.lang', GVIDEO_PATH);
    48  
    4947  $conf['gvideo'] = unserialize($conf['gvideo']);
    5048}
Note: See TracChangeset for help on using the changeset viewer.