<?php
/**
* Lite Publisher
* Copyright (C) 2010 - 2013 Vladimir Yushko http://litepublisher.ru/ http://litepublisher.com/
* Dual licensed under the MIT (mit.txt)
* and GPL (gpl.txt) licenses.
**/

function tplugingeneratorInstall($self) {
  $lang = tplugins::getnamelang(tplugins::getname(__file__));
  $theme = tview::i()->theme;
  $self->lock();
  $self->url = '/plugin-generator.htm';
  $self->title = $lang->name;
  
  $args = new targs();
  $args->formtitle = $lang->description;
  $args->name = 'plugin';
  $args->hasadmin = false;
  $html = tadminhtml::i();
  $self->content = $html->adminform('
  [text=name]
  [checkbox=hasadmin]
  ', $args);
  
  $self->unlock();
  
  $menus = tmenus::i();
  $menus->add($self);
}

function tplugingeneratorUninstall($self) {
  $menus = tmenus::i();
  $menus->delete($menus->class2id(get_class($self)));
}