Ticket #382 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

fix current smarty templates

Reported by: Octavian Assigned to: demian
Priority: low Milestone: 0.5.6
Component: SGL - Template Renderers Version:
Severity: not categorised Keywords: smarty templates
Cc:

Description

Hi, I´m using Seagull with Smarty support, but i´ve encountered a lot of bugs in the ported templates. The 3 converted core modules should be enough to start with smarty support but even those are often not usable because there are still numerous flexy style variables/functions/tags in it. I saw the smartyize.sh script but it´s not able to completely replace all the flexy behaviour with smarty´s:

  • $result-> before every variable and function calls
  • parameters/keys in foreach loops
  • replace flexy:xxx commands
  • parameters in function calls
  • objectvars 'obj.var' to '$result->obj->var'
  • arrays 'arr[key]' to '$result->arr.key'

Attachments

Flexy2Smarty.php (15.7 kB) - added by ilyahegai on 02/20/06 06:03:58.
conv.php (304 bytes) - added by ilyahegai on 02/20/06 06:12:19.
Flexy2Smarty.2.php (15.8 kB) - added by ilyahegai on 03/03/06 05:41:01.
fixes array parsing
Flexy2Smarty.patch (1.0 kB) - added by ilyahegai on 03/03/06 08:09:38.

Change History

01/21/06 06:17:27 changed by demian

  • milestone changed from 0.5.5 to 0.5.6.

02/16/06 07:17:03 changed by demian

  • priority changed from normal to low.

02/20/06 06:03:58 changed by ilyahegai

  • attachment Flexy2Smarty.php added.

02/20/06 06:12:19 changed by ilyahegai

  • attachment conv.php added.

02/20/06 06:23:24 changed by ilyahegai

  • owner changed from somebody to demian.

needs Flexy.php and Flexy/Tree.php from HTML_Template_Flexy to work

usage example in conv.php

tested to work well with :

  • if statements (including nested)
  • foreach statements (including nested) - takes into account variables scope (as well as function parameters) inside foreach
  • include
  • flexy:raw
  • function calls including eg. {if:GLOBALS.empty(onLoad)} and {this.plugin(#outputIcon#,aValue[document_type_id]):h}

quite slow, but it's not problem (at least speeding up is not major goal) since it's used once

02/20/06 07:11:23 changed by demian

  • status changed from new to closed.
  • resolution set to fixed.

Great stuff Ilya, your converter code looks quite interesting. i don't have time to play with it now, but if it does the job as you say:

- please confirm withi mavis_beacon (Malaney) - let me know if i can remove smartyize.sh - run it on default modules and let's commit a fully working Smarty theme

03/03/06 05:41:01 changed by ilyahegai

  • attachment Flexy2Smarty.2.php added.

fixes array parsing

03/03/06 05:41:35 changed by ilyahegai

  • status changed from closed to reopened.
  • resolution deleted.

03/03/06 06:08:24 changed by demian

  • status changed from reopened to closed.
  • resolution set to invalid.

Hi Ilya - can you submit this as a patch rather than a file.

cheers

Demian

03/03/06 08:09:38 changed by ilyahegai

  • attachment Flexy2Smarty.patch added.

03/03/06 08:09:48 changed by ilyahegai

  • status changed from closed to reopened.
  • resolution deleted.

03/04/06 07:34:48 changed by demian

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [1604]) flexy2smarty improvements, fixes #382