summaryrefslogtreecommitdiff
path: root/doc/plugins/write/tutorial.mdwn
diff options
context:
space:
mode:
Diffstat (limited to 'doc/plugins/write/tutorial.mdwn')
0 files changed, 0 insertions, 0 deletions
  • # but WITHOUT ANY WARRANTY; without even the implied warranty of
  • # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  • # GNU General Public License for more details.
  • # You should have received a copy of the GNU General Public License
  • # along with this program; if not, write to the Free Software
  • # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  • #======================================================================
  • 1;
  • use DBI;
  • use LedgerSMB::User;
  • use LedgerSMB::Form;
  • use LedgerSMB::Locale;
  • use LedgerSMB::Session;
  • ## will need this later when session_destroy will be used
  • #use LedgerSMB::Session;
  • $form = new Form;
  • $locale = LedgerSMB::Locale->get_handle(${LedgerSMB::Sysconfig::language}) or
  • $form->error(__FILE__.':'.__LINE__.": Locale not loaded: $!\n");
  • $locale->encoding('UTF-8');
  • $form->{charset} = 'UTF-8';
  • #$form->{charset} = $locale->encoding;
  • # customization
  • if (-f "bin/custom/$form->{script}") {
  • eval { require "bin/custom/$form->{script}"; };
  • $form->error(__FILE__.':'.__LINE__.': '.$@) if ($@);
  • }
  • # per login customization
  • if (-f "bin/custom/$form->{login}_$form->{script}") {
  • eval { require "bin/custom/$form->{login}_$form->{script}"; };
  • $form->error(__FILE__.':'.__LINE__.': '.$@) if ($@);
  • }
  • # window title bar, user info
  • $form->{titlebar} = "LedgerSMB ".$locale->text('Version'). " $form->{version}";
  • if ($form->{action}) {
  • $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}";
  • &{ $form->{action} };
  • } else {
  • &login_screen;
  • }
  • 1;
  • sub login_screen {
  • $form->{stylesheet} = "ledger-smb.css";
  • $form->{favicon} = "favicon.ico";
  • $form->{endsession} = 1;
  • if ($form->{login}) {
  • $sf = q|function sf() { document.login.password.focus(); }|;
  • } else {
  • $sf = q|function sf() { document.login.login.focus(); }|;
  • }
  • my $headeradd = qq|
  • <script language="JavaScript" type="text/javascript">
  • <!--
  • var agt = navigator.userAgent.toLowerCase();
  • var is_major = parseInt(navigator.appVersion);
  • var is_nav = ((agt.indexOf('mozilla') != -1) && (agt.indexOf('spoofer') == -1)
  • && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera') == -1)
  • && (agt.indexOf('webtv') == -1));
  • var is_nav4lo = (is_nav && (is_major <= 4));
  • function jsp() {
  • if (is_nav4lo){
  • document.login.js.value = "0";
  • } else {
  • document.login.js.value = "1";
  • }
  • }