• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: LISE 2: get timestamp of datefield
PostPosted: Tue May 15, 2018 12:05 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jan 26, 2012 3:22 pm
Posts: 235
Location: Belgium
Hi,
i'm wondering how i can get the time stamp from a LISE2 object.
If i call {$item->fielddefs.dag|print_r} in the lise summary template i get the following object.
Code:
lisefd_SelectDateTime Object
(
    [id:LISEFielddefBase:private] => 3
    [name:LISEFielddefBase:private] => dag
    [alias:LISEFielddefBase:private] => dag
    [description:LISEFielddefBase:private] =>
    [type:LISEFielddefBase:private] => SelectDateTime
    [friendlytype:LISEFielddefBase:private] => Select DateTime
    [value:LISEFielddefBase:private] => LISEFielddefValue Object
        (
            [storage:ArrayObject:private] => Array
                (
                    [0] => 17-05-2018
                )

        )

    [originator:LISEFielddefBase:private] => LISE
    [active:LISEFielddefBase:private] => 1
    [disabled:LISEFielddefBase:private] =>
    [path:LISEFielddefBase:private] => /srv/users/serverpilot/apps/joli/public/modules/LISE/lib/fielddefs/SelectDateTime
    [position:LISEFielddefBase:private] => 0
    [required:LISEFielddefBase:private] => 1
    [options:LISEFielddefBase:private] => Array
        (
            [backwards_compatibility] => 0
            [date_format] => dd-mm-yy
            [format_type] => 1
            [show_seconds] => 0
            [size] => 20
            [time_format] => HH:mm
            [unix_datetime_stamp] => 1526515200
        )

    [caller:LISEFielddefBase:private] =>
    [item_id:LISEFielddefBase:private] => 2
    [parent_array:LISEFielddefBase:private] => LISEFielddefArray Object
        (
            [_parent_item:LISEFielddefArray:private] => LISEItem Object
                (
                    [item_id] => 2
                    [alias] => voorbeeld_event
                    [title] => Voorbeeld event
                    [url] => http://joli.ws.marketingcoach.be/kalender/Voorbeeld-event
                    [position] => 1
                    [active] => 1
                    [create_time] => 2018-05-15 13:22:13
                    [modified_time] => 2018-05-15 13:22:13
                    [start_time] =>
                    [end_time] =>
                    [owner] => 1
                    [key1] =>
                    [key2] =>
                    [key3] =>
                    [fielddefs] => LISEFielddefArray Object
 *RECURSION*
                )

            [storage:ArrayObject:private] => Array
                (
                    [3] => lisefd_SelectDateTime Object
 *RECURSION*
                    [1] => lisefd_TextArea Object
                        (
                            [id:LISEFielddefBase:private] => 1
                            [name:LISEFielddefBase:private] => Beschrijving
                            [alias:LISEFielddefBase:private] => beschrijving
                            [description:LISEFielddefBase:private] =>
                            [type:LISEFielddefBase:private] => TextArea
                            [friendlytype:LISEFielddefBase:private] => Text Area
                            [value:LISEFielddefBase:private] => LISEFielddefValue Object
                                (
                                    [storage:ArrayObject:private] => Array
                                        (
                                            [0] => Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia minima repudiandae, dolores pariatur facilis totam.
Rerum molestiae soluta doloribus ullam earum facere tempore, recusandae quibusdam sit, voluptas repellat dolorem vitae.
                                        )

                                )

                            [originator:LISEFielddefBase:private] => LISE
                            [active:LISEFielddefBase:private] => 1
                            [disabled:LISEFielddefBase:private] =>
                            [path:LISEFielddefBase:private] => /srv/users/serverpilot/apps/joli/public/modules/LISE/lib/fielddefs/TextArea
                            [position:LISEFielddefBase:private] => 1
                            [required:LISEFielddefBase:private] => 0
                            [options:LISEFielddefBase:private] => Array
                                (
                                    [max_length] => 255
                                    [search_index] => 0
                                    [wysiwyg] => 0
                                )

                            [caller:LISEFielddefBase:private] =>
                            [item_id:LISEFielddefBase:private] => 2
                            [parent_array:LISEFielddefBase:private] => LISEFielddefArray Object
 *RECURSION*
                            [template:LISEFielddefBase:private] => {$fielddef.name}: {$fielddef.value}
                            [view:LISEFielddefBase:private] =>
                            [hastemplate:LISEFielddefBase:private] => 1
                            [event_handler:protected] => LISEEventHandlerBase Object
                                (
                                    [_field:LISEEventHandlerBase:private] => lisefd_TextArea Object
 *RECURSION*
                                )

                        )

                )

        )

    [template:LISEFielddefBase:private] => {$fielddef.name}: {$fielddef.value|cms_date_format}
    [view:LISEFielddefBase:private] =>
    [hastemplate:LISEFielddefBase:private] => 1
    [event_handler:protected] => liseeh_SelectDateTime Object
        (
            [_field:LISEEventHandlerBase:private] => lisefd_SelectDateTime Object
 *RECURSION*
        )

)
1


Instead of placing {$item-dag}, my template wants me to call day and month seperatly. that is why i want access to the [unix_datetime_stamp]
but i seam to be unable to access its value ("1526515200" in this example)

Code:
{$item->fielddefs.dag->options->unix_datetime_stamp}

or
Code:
{$item->fielddefs.dag->options.unix_datetime_stamp}

or even
Code:
{$item->fielddefs.dag->options['unix_datetime_stamp']}

those get me nowhere...

_________________
Kind regards,
HarmO


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: LISE 2: get timestamp of datefield  Topic is solved
PostPosted: Wed May 16, 2018 10:43 am 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 2995
Location: The Netherlands
This seems to work now:
Code:
{$item->fielddefs['dag']->GetOptionValue('unix_datetime_stamp')}


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting