Nokia S40 Theme Packaging PHP Class
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
Anyone know if this, or similar DOCTYPE documents are available anywhere ?
Seems that Nokia stores them on the, hmmm, phone, but I can't seem to find one easily viewable online anywhere.
Code: [ Select ]
<!DOCTYPE theme PUBLIC "-//NOKIA//DTD THEME 1.1//EN" "theme.dtd">
Seems that Nokia stores them on the, hmmm, phone, but I can't seem to find one easily viewable online anywhere.
Strong with this one, the sudo is.
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
October 27th, 2006, 3:34 pm
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
I ran the theme_descriptor.xml configuration file produced by one of Nokias' Theme Studios through Hit Softwares' XML Document To DTD Utility after modifying every single thing I could in the Theme Studio & got this,
I'm determining which elements are required/optional, tweeking the attribute deffinitions, & commenting everything as its' use is determined.
I'll post what I end up with here by the end of the night, just trying to keep track of what I'm doing for now.
Code: [ Select ]
<!ELEMENT background EMPTY >
<!ATTLIST background src NMTOKEN #REQUIRED >
<!ELEMENT background-mini EMPTY >
<!ATTLIST background-mini src NMTOKEN #REQUIRED >
<!ELEMENT colorscheme EMPTY >
<!ATTLIST colorscheme color NMTOKEN #REQUIRED >
<!ELEMENT colorscheme-mini EMPTY >
<!ATTLIST colorscheme-mini color NMTOKEN #REQUIRED >
<!ELEMENT icon EMPTY >
<!ATTLIST icon item_id ID #REQUIRED >
<!ATTLIST icon size NMTOKEN #FIXED "large" >
<!ATTLIST icon src ( Deep.jpg | Mystery.jpg | Sea.jpg | Sunset.jpg ) #REQUIRED >
<!ELEMENT ringtone EMPTY >
<!ATTLIST ringtone src CDATA #REQUIRED >
<!ELEMENT screensaver EMPTY >
<!ATTLIST screensaver src NMTOKEN #REQUIRED >
<!ELEMENT theme ( wallpaper, screensaver, ringtone, colorscheme, icon+, wallpaper-mini, colorscheme-mini, background, background-mini ) >
<!ATTLIST theme name CDATA #REQUIRED >
<!ATTLIST theme version NMTOKEN #REQUIRED >
<!ELEMENT wallpaper EMPTY >
<!ATTLIST wallpaper src NMTOKEN #REQUIRED >
<!ELEMENT wallpaper-mini EMPTY >
<!ATTLIST wallpaper-mini src NMTOKEN #REQUIRED >
<!ATTLIST background src NMTOKEN #REQUIRED >
<!ELEMENT background-mini EMPTY >
<!ATTLIST background-mini src NMTOKEN #REQUIRED >
<!ELEMENT colorscheme EMPTY >
<!ATTLIST colorscheme color NMTOKEN #REQUIRED >
<!ELEMENT colorscheme-mini EMPTY >
<!ATTLIST colorscheme-mini color NMTOKEN #REQUIRED >
<!ELEMENT icon EMPTY >
<!ATTLIST icon item_id ID #REQUIRED >
<!ATTLIST icon size NMTOKEN #FIXED "large" >
<!ATTLIST icon src ( Deep.jpg | Mystery.jpg | Sea.jpg | Sunset.jpg ) #REQUIRED >
<!ELEMENT ringtone EMPTY >
<!ATTLIST ringtone src CDATA #REQUIRED >
<!ELEMENT screensaver EMPTY >
<!ATTLIST screensaver src NMTOKEN #REQUIRED >
<!ELEMENT theme ( wallpaper, screensaver, ringtone, colorscheme, icon+, wallpaper-mini, colorscheme-mini, background, background-mini ) >
<!ATTLIST theme name CDATA #REQUIRED >
<!ATTLIST theme version NMTOKEN #REQUIRED >
<!ELEMENT wallpaper EMPTY >
<!ATTLIST wallpaper src NMTOKEN #REQUIRED >
<!ELEMENT wallpaper-mini EMPTY >
<!ATTLIST wallpaper-mini src NMTOKEN #REQUIRED >
- <!ELEMENT background EMPTY >
- <!ATTLIST background src NMTOKEN #REQUIRED >
- <!ELEMENT background-mini EMPTY >
- <!ATTLIST background-mini src NMTOKEN #REQUIRED >
- <!ELEMENT colorscheme EMPTY >
- <!ATTLIST colorscheme color NMTOKEN #REQUIRED >
- <!ELEMENT colorscheme-mini EMPTY >
- <!ATTLIST colorscheme-mini color NMTOKEN #REQUIRED >
- <!ELEMENT icon EMPTY >
- <!ATTLIST icon item_id ID #REQUIRED >
- <!ATTLIST icon size NMTOKEN #FIXED "large" >
- <!ATTLIST icon src ( Deep.jpg | Mystery.jpg | Sea.jpg | Sunset.jpg ) #REQUIRED >
- <!ELEMENT ringtone EMPTY >
- <!ATTLIST ringtone src CDATA #REQUIRED >
- <!ELEMENT screensaver EMPTY >
- <!ATTLIST screensaver src NMTOKEN #REQUIRED >
- <!ELEMENT theme ( wallpaper, screensaver, ringtone, colorscheme, icon+, wallpaper-mini, colorscheme-mini, background, background-mini ) >
- <!ATTLIST theme name CDATA #REQUIRED >
- <!ATTLIST theme version NMTOKEN #REQUIRED >
- <!ELEMENT wallpaper EMPTY >
- <!ATTLIST wallpaper src NMTOKEN #REQUIRED >
- <!ELEMENT wallpaper-mini EMPTY >
- <!ATTLIST wallpaper-mini src NMTOKEN #REQUIRED >
I'm determining which elements are required/optional, tweeking the attribute deffinitions, & commenting everything as its' use is determined.
I'll post what I end up with here by the end of the night, just trying to keep track of what I'm doing for now.
Strong with this one, the sudo is.
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
Didn't notice there was a scrollbar in the Icons menu of the Theme Studio.
Had a bad deffinition for icon elements.
Had a bad deffinition for icon elements.
Code: [ Select ]
<!ELEMENT icon EMPTY >
<!ATTLIST icon item_id NMTOKEN #REQUIRED >
<!ATTLIST icon size NMTOKEN #REQUIRED >
<!ATTLIST icon src NMTOKEN #REQUIRED >
<!ATTLIST icon item_id NMTOKEN #REQUIRED >
<!ATTLIST icon size NMTOKEN #REQUIRED >
<!ATTLIST icon src NMTOKEN #REQUIRED >
- <!ELEMENT icon EMPTY >
- <!ATTLIST icon item_id NMTOKEN #REQUIRED >
- <!ATTLIST icon size NMTOKEN #REQUIRED >
- <!ATTLIST icon src NMTOKEN #REQUIRED >
Strong with this one, the sudo is.
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
This should to do it for version 1.1
//Edit - Changed all data types for "src" attributes to "URI"
//Edit - Changed all data types for "src" attributes to "URI"
Code: [ Select ]
<!--
<!DOCTYPE theme PUBLIC "-//NOKIA//DTD THEME 1.1//EN" "theme.dtd">
This is a re-creation of theme DTD based on "theme_descriptor.xml"
that is produced by "Nokia S40 Theme Studio 1.2"
-- REQUIRED ELEMENTS
theme (main container, all other elements go inside this one)
colorscheme
ringtone
screensaver
wallpaper
-- OPTIONAL ELEMENTS
background
background-mini
colorscheme-mini
icon
wallpaper-mini
May not be entirely accurate in terms of data-types, sticking to it is working for me though.
-->
<!-- a Uniform Resource Identifier, see [RFC2396] -->
<!ENTITY % URI "CDATA">
<!-- Color Values -->
<!ENTITY % Color "blue|black|red|orange|gray|green|brown|pink">
<!-- Icon Sizes -->
<!ENTITY % IconSize "large|small">
<!-- Icon item_id references -->
<!ENTITY % MenuItem "callregister|settings|organizer|gallery|services|media|applications|
contacts|simatk|push_to_talk|wireless_village|number_entry|messages|
goto|amsmessages|default">
<!--
Image used for
menu backgrounds in the
main screen.
-->
<!ELEMENT background EMPTY>
<!--
src filename of image (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST background
src URI #REQUIRED
>
<!--
Image used for
menu backgrounds in the
mini screen.
-->
<!ELEMENT background-mini EMPTY>
<!--
src filename of image (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST background-mini
src URI #REQUIRED
>
<!--
Color used for symbols
and indicators on the main screen
-->
<!ELEMENT colorscheme EMPTY>
<!--
color name of color to use
-->
<!ATTLIST colorscheme
color %Color; #REQUIRED
>
<!--
Color used for symbols
and indicators on the mini screen
-->
<!ELEMENT colorscheme-mini EMPTY>
<!--
color name of color to use
-->
<!ATTLIST colorscheme-mini
color %Color; #REQUIRED
>
<!--
Menu item icon
-->
<!ELEMENT icon EMPTY>
<!--
item_id menu item to associate icon with
size large for list view, small for grid view (yes, two icon elements are required to cover both)
src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST icon
item_id %MenuItem; #REQUIRED
size %IconSize; #REQUIRED
src URI #REQUIRED
>
<!--
Ringtone to use
-->
<!ELEMENT ringtone EMPTY>
<!--
src filename of audio to use (mid, midi, amr, awb, mp3, mp4, aac)
-->
<!ATTLIST ringtone
src URI #REQUIRED
>
<!--
Screensaver for the main screen
-->
<!ELEMENT screensaver EMPTY>
<!--
src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST screensaver
src URI #REQUIRED
>
<!--
Main container
-->
<!ELEMENT theme (background?, background-mini?, colorscheme, colorscheme-mini?, icon*, ringtone, screensaver, wallpaper, wallpaper-mini?)>
<!--
name name that will show in the menu for the theme
version theme version number
-->
<!ATTLIST theme
name CDATA #REQUIRED
version NMTOKEN #REQUIRED
>
<!--
Wallpaper image to use on the main screen
-->
<!ELEMENT wallpaper EMPTY>
<!--
src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST wallpaper
src URI #REQUIRED
>
<!--
Wallpaper image to use on the mini screen
-->
<!ELEMENT wallpaper-mini EMPTY>
<!--
src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST wallpaper-mini
src URI #REQUIRED
>
<!DOCTYPE theme PUBLIC "-//NOKIA//DTD THEME 1.1//EN" "theme.dtd">
This is a re-creation of theme DTD based on "theme_descriptor.xml"
that is produced by "Nokia S40 Theme Studio 1.2"
-- REQUIRED ELEMENTS
theme (main container, all other elements go inside this one)
colorscheme
ringtone
screensaver
wallpaper
-- OPTIONAL ELEMENTS
background
background-mini
colorscheme-mini
icon
wallpaper-mini
May not be entirely accurate in terms of data-types, sticking to it is working for me though.
-->
<!-- a Uniform Resource Identifier, see [RFC2396] -->
<!ENTITY % URI "CDATA">
<!-- Color Values -->
<!ENTITY % Color "blue|black|red|orange|gray|green|brown|pink">
<!-- Icon Sizes -->
<!ENTITY % IconSize "large|small">
<!-- Icon item_id references -->
<!ENTITY % MenuItem "callregister|settings|organizer|gallery|services|media|applications|
contacts|simatk|push_to_talk|wireless_village|number_entry|messages|
goto|amsmessages|default">
<!--
Image used for
menu backgrounds in the
main screen.
-->
<!ELEMENT background EMPTY>
<!--
src filename of image (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST background
src URI #REQUIRED
>
<!--
Image used for
menu backgrounds in the
mini screen.
-->
<!ELEMENT background-mini EMPTY>
<!--
src filename of image (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST background-mini
src URI #REQUIRED
>
<!--
Color used for symbols
and indicators on the main screen
-->
<!ELEMENT colorscheme EMPTY>
<!--
color name of color to use
-->
<!ATTLIST colorscheme
color %Color; #REQUIRED
>
<!--
Color used for symbols
and indicators on the mini screen
-->
<!ELEMENT colorscheme-mini EMPTY>
<!--
color name of color to use
-->
<!ATTLIST colorscheme-mini
color %Color; #REQUIRED
>
<!--
Menu item icon
-->
<!ELEMENT icon EMPTY>
<!--
item_id menu item to associate icon with
size large for list view, small for grid view (yes, two icon elements are required to cover both)
src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST icon
item_id %MenuItem; #REQUIRED
size %IconSize; #REQUIRED
src URI #REQUIRED
>
<!--
Ringtone to use
-->
<!ELEMENT ringtone EMPTY>
<!--
src filename of audio to use (mid, midi, amr, awb, mp3, mp4, aac)
-->
<!ATTLIST ringtone
src URI #REQUIRED
>
<!--
Screensaver for the main screen
-->
<!ELEMENT screensaver EMPTY>
<!--
src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST screensaver
src URI #REQUIRED
>
<!--
Main container
-->
<!ELEMENT theme (background?, background-mini?, colorscheme, colorscheme-mini?, icon*, ringtone, screensaver, wallpaper, wallpaper-mini?)>
<!--
name name that will show in the menu for the theme
version theme version number
-->
<!ATTLIST theme
name CDATA #REQUIRED
version NMTOKEN #REQUIRED
>
<!--
Wallpaper image to use on the main screen
-->
<!ELEMENT wallpaper EMPTY>
<!--
src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST wallpaper
src URI #REQUIRED
>
<!--
Wallpaper image to use on the mini screen
-->
<!ELEMENT wallpaper-mini EMPTY>
<!--
src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
-->
<!ATTLIST wallpaper-mini
src URI #REQUIRED
>
- <!--
- <!DOCTYPE theme PUBLIC "-//NOKIA//DTD THEME 1.1//EN" "theme.dtd">
- This is a re-creation of theme DTD based on "theme_descriptor.xml"
- that is produced by "Nokia S40 Theme Studio 1.2"
- -- REQUIRED ELEMENTS
- theme (main container, all other elements go inside this one)
- colorscheme
- ringtone
- screensaver
- wallpaper
- -- OPTIONAL ELEMENTS
- background
- background-mini
- colorscheme-mini
- icon
- wallpaper-mini
- May not be entirely accurate in terms of data-types, sticking to it is working for me though.
- -->
- <!-- a Uniform Resource Identifier, see [RFC2396] -->
- <!ENTITY % URI "CDATA">
- <!-- Color Values -->
- <!ENTITY % Color "blue|black|red|orange|gray|green|brown|pink">
- <!-- Icon Sizes -->
- <!ENTITY % IconSize "large|small">
- <!-- Icon item_id references -->
- <!ENTITY % MenuItem "callregister|settings|organizer|gallery|services|media|applications|
- contacts|simatk|push_to_talk|wireless_village|number_entry|messages|
- goto|amsmessages|default">
- <!--
- Image used for
- menu backgrounds in the
- main screen.
- -->
- <!ELEMENT background EMPTY>
- <!--
- src filename of image (jpg, jpeg, gif, png, bmp, wbmp, m3g)
- -->
- <!ATTLIST background
- src URI #REQUIRED
- >
- <!--
- Image used for
- menu backgrounds in the
- mini screen.
- -->
- <!ELEMENT background-mini EMPTY>
- <!--
- src filename of image (jpg, jpeg, gif, png, bmp, wbmp, m3g)
- -->
- <!ATTLIST background-mini
- src URI #REQUIRED
- >
- <!--
- Color used for symbols
- and indicators on the main screen
- -->
- <!ELEMENT colorscheme EMPTY>
- <!--
- color name of color to use
- -->
- <!ATTLIST colorscheme
- color %Color; #REQUIRED
- >
- <!--
- Color used for symbols
- and indicators on the mini screen
- -->
- <!ELEMENT colorscheme-mini EMPTY>
- <!--
- color name of color to use
- -->
- <!ATTLIST colorscheme-mini
- color %Color; #REQUIRED
- >
- <!--
- Menu item icon
- -->
- <!ELEMENT icon EMPTY>
- <!--
- item_id menu item to associate icon with
- size large for list view, small for grid view (yes, two icon elements are required to cover both)
- src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
- -->
- <!ATTLIST icon
- item_id %MenuItem; #REQUIRED
- size %IconSize; #REQUIRED
- src URI #REQUIRED
- >
- <!--
- Ringtone to use
- -->
- <!ELEMENT ringtone EMPTY>
- <!--
- src filename of audio to use (mid, midi, amr, awb, mp3, mp4, aac)
- -->
- <!ATTLIST ringtone
- src URI #REQUIRED
- >
- <!--
- Screensaver for the main screen
- -->
- <!ELEMENT screensaver EMPTY>
- <!--
- src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
- -->
- <!ATTLIST screensaver
- src URI #REQUIRED
- >
- <!--
- Main container
- -->
- <!ELEMENT theme (background?, background-mini?, colorscheme, colorscheme-mini?, icon*, ringtone, screensaver, wallpaper, wallpaper-mini?)>
- <!--
- name name that will show in the menu for the theme
- version theme version number
- -->
- <!ATTLIST theme
- name CDATA #REQUIRED
- version NMTOKEN #REQUIRED
- >
- <!--
- Wallpaper image to use on the main screen
- -->
- <!ELEMENT wallpaper EMPTY>
- <!--
- src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
- -->
- <!ATTLIST wallpaper
- src URI #REQUIRED
- >
- <!--
- Wallpaper image to use on the mini screen
- -->
- <!ELEMENT wallpaper-mini EMPTY>
- <!--
- src filename of image to use (jpg, jpeg, gif, png, bmp, wbmp, m3g)
- -->
- <!ATTLIST wallpaper-mini
- src URI #REQUIRED
- >
Strong with this one, the sudo is.
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
Version 2.0
Got the required elements done.
Some of the required attributes done.
An ENTITY list for the available menu items.
There's alot in 2.0, I might come back to it if I ever get a phone that supports it or get bored.
Got the required elements done.
Some of the required attributes done.
An ENTITY list for the available menu items.
There's alot in 2.0, I might come back to it if I ever get a phone that supports it or get bored.
Code: [ Select ]
<!--
<!DOCTYPE theme PUBLIC "-//NOKIA//DTD THEME 2.0//EN" "theme.dtd">
This is a re-creation of theme DTD based on "theme_descriptor.xml"
that is produced by "Nokia S40 Theme Studio 2.1"
--REQUIRED
wallpaper
screensaver
-- OPTIONAL
everything else
-->
<!ENTITY % MenuItem "applications|ams_messages|brew|callregister|camera|
cdmacust|contacts|extras|gallery|goto|media|messages|
number_entry|organizer|push_to_talk|services|settings|
simatk|sport|voiceportal|wireless_village">
<!ENTITY % Colors.Display "main|second">
<!ELEMENT background EMPTY >
<!ATTLIST background
grid_menu_bg NMTOKEN #IMPLIED
main_default_bg NMTOKEN #IMPLIED
note_bg NMTOKEN #IMPLIED
second_default_bg NMTOKEN #IMPLIED
>
<!ELEMENT colors EMPTY >
<!ATTLIST colors
active_idle_active_font_color NMTOKEN #IMPLIED
active_idle_content_background_color NMTOKEN #IMPLIED
calendar_highlight_color NMTOKEN #IMPLIED
display %Colors.Display; #REQUIRED
grid_highlight_color NMTOKEN #IMPLIED
grid_menu_font_color NMTOKEN #IMPLIED
grid_menu_highlight_font_color NMTOKEN #IMPLIED
header_font_color NMTOKEN #IMPLIED
idle_font_color NMTOKEN #IMPLIED
menu_font_color NMTOKEN #IMPLIED
menu_highlight_font_color NMTOKEN #IMPLIED
reorder_highlight_color NMTOKEN #IMPLIED
reorder_highlight_font_color NMTOKEN #IMPLIED
shortcut_bar_popup_background_color NMTOKEN #IMPLIED
shortcut_bar_popup_font_color NMTOKEN #IMPLIED
softkey_font_color NMTOKEN #IMPLIED
status_area_font_color NMTOKEN #IMPLIED
>
<!ELEMENT highlight EMPTY >
<!ATTLIST highlight
active_idle_row NMTOKEN #IMPLIED
active_idle_shortcut_bar NMTOKEN #IMPLIED
grid NMTOKEN #IMPLIED
list NMTOKEN #IMPLIED
reorder NMTOKEN #IMPLIED
tab NMTOKEN #IMPLIED
>
<!ELEMENT menu_item EMPTY >
<!ATTLIST menu_item
animating_grid NMTOKEN #IMPLIED
app_specific_bg NMTOKEN #IMPLIED
grid_view_icon NMTOKEN #IMPLIED
item_id %MenuItem; #REQUIRED
list_view_icon NMTOKEN #IMPLIED
>
<!ELEMENT radio_audio_bg EMPTY >
<!ATTLIST radio_audio_bg
audio_bg NMTOKEN #IMPLIED
radio_bg NMTOKEN #IMPLIED
>
<!ELEMENT screensaver EMPTY >
<!ATTLIST screensaver
main_display_graphics NMTOKEN #REQUIRED
second_display_graphics NMTOKEN #IMPLIED
>
<!ELEMENT shutdown EMPTY >
<!ATTLIST shutdown
main_display_graphics NMTOKEN #IMPLIED
second_display_graphics NMTOKEN #IMPLIED
tone NMTOKEN #IMPLIED
>
<!ELEMENT softkey_bg EMPTY >
<!ATTLIST softkey_bg
left NMTOKEN #IMPLIED
middle NMTOKEN #IMPLIED
right NMTOKEN #IMPLIED
>
<!ELEMENT startup EMPTY >
<!ATTLIST startup
main_display_graphics NMTOKEN #IMPLIED
second_display_graphics NMTOKEN #IMPLIED
tone NMTOKEN #IMPLIED
>
<!ELEMENT theme
(colors*, menu_item*, wallpaper, screensaver, background?, radio_audio_bg?, softkey_bg?, wait_graphics?, highlight?, tones?, startup?, shutdown?, transformation_open?, transformation_close?)>
<!ATTLIST theme
name CDATA #IMPLIED
version NMTOKEN #IMPLIED
>
<!ELEMENT tones EMPTY >
<!ATTLIST tones
cal_alert NMTOKEN #IMPLIED
msg_alert NMTOKEN #IMPLIED
ringtone NMTOKEN #IMPLIED
>
<!ELEMENT transformation_close EMPTY >
<!ATTLIST transformation_close
main_display_graphics NMTOKEN #IMPLIED
second_display_graphics NMTOKEN #IMPLIED
tone NMTOKEN #IMPLIED
>
<!ELEMENT transformation_open EMPTY >
<!ATTLIST transformation_open
main_display_graphics NMTOKEN #IMPLIED
second_display_graphics NMTOKEN #IMPLIED
tone NMTOKEN #IMPLIED
>
<!ELEMENT wait_graphics EMPTY >
<!ATTLIST wait_graphics
src NMTOKEN #IMPLIED
>
<!ELEMENT wallpaper EMPTY >
<!ATTLIST wallpaper
main_display_graphics NMTOKEN #REQUIRED
second_display_graphics NMTOKEN #IMPLIED
>
<!DOCTYPE theme PUBLIC "-//NOKIA//DTD THEME 2.0//EN" "theme.dtd">
This is a re-creation of theme DTD based on "theme_descriptor.xml"
that is produced by "Nokia S40 Theme Studio 2.1"
--REQUIRED
wallpaper
screensaver
-- OPTIONAL
everything else
-->
<!ENTITY % MenuItem "applications|ams_messages|brew|callregister|camera|
cdmacust|contacts|extras|gallery|goto|media|messages|
number_entry|organizer|push_to_talk|services|settings|
simatk|sport|voiceportal|wireless_village">
<!ENTITY % Colors.Display "main|second">
<!ELEMENT background EMPTY >
<!ATTLIST background
grid_menu_bg NMTOKEN #IMPLIED
main_default_bg NMTOKEN #IMPLIED
note_bg NMTOKEN #IMPLIED
second_default_bg NMTOKEN #IMPLIED
>
<!ELEMENT colors EMPTY >
<!ATTLIST colors
active_idle_active_font_color NMTOKEN #IMPLIED
active_idle_content_background_color NMTOKEN #IMPLIED
calendar_highlight_color NMTOKEN #IMPLIED
display %Colors.Display; #REQUIRED
grid_highlight_color NMTOKEN #IMPLIED
grid_menu_font_color NMTOKEN #IMPLIED
grid_menu_highlight_font_color NMTOKEN #IMPLIED
header_font_color NMTOKEN #IMPLIED
idle_font_color NMTOKEN #IMPLIED
menu_font_color NMTOKEN #IMPLIED
menu_highlight_font_color NMTOKEN #IMPLIED
reorder_highlight_color NMTOKEN #IMPLIED
reorder_highlight_font_color NMTOKEN #IMPLIED
shortcut_bar_popup_background_color NMTOKEN #IMPLIED
shortcut_bar_popup_font_color NMTOKEN #IMPLIED
softkey_font_color NMTOKEN #IMPLIED
status_area_font_color NMTOKEN #IMPLIED
>
<!ELEMENT highlight EMPTY >
<!ATTLIST highlight
active_idle_row NMTOKEN #IMPLIED
active_idle_shortcut_bar NMTOKEN #IMPLIED
grid NMTOKEN #IMPLIED
list NMTOKEN #IMPLIED
reorder NMTOKEN #IMPLIED
tab NMTOKEN #IMPLIED
>
<!ELEMENT menu_item EMPTY >
<!ATTLIST menu_item
animating_grid NMTOKEN #IMPLIED
app_specific_bg NMTOKEN #IMPLIED
grid_view_icon NMTOKEN #IMPLIED
item_id %MenuItem; #REQUIRED
list_view_icon NMTOKEN #IMPLIED
>
<!ELEMENT radio_audio_bg EMPTY >
<!ATTLIST radio_audio_bg
audio_bg NMTOKEN #IMPLIED
radio_bg NMTOKEN #IMPLIED
>
<!ELEMENT screensaver EMPTY >
<!ATTLIST screensaver
main_display_graphics NMTOKEN #REQUIRED
second_display_graphics NMTOKEN #IMPLIED
>
<!ELEMENT shutdown EMPTY >
<!ATTLIST shutdown
main_display_graphics NMTOKEN #IMPLIED
second_display_graphics NMTOKEN #IMPLIED
tone NMTOKEN #IMPLIED
>
<!ELEMENT softkey_bg EMPTY >
<!ATTLIST softkey_bg
left NMTOKEN #IMPLIED
middle NMTOKEN #IMPLIED
right NMTOKEN #IMPLIED
>
<!ELEMENT startup EMPTY >
<!ATTLIST startup
main_display_graphics NMTOKEN #IMPLIED
second_display_graphics NMTOKEN #IMPLIED
tone NMTOKEN #IMPLIED
>
<!ELEMENT theme
(colors*, menu_item*, wallpaper, screensaver, background?, radio_audio_bg?, softkey_bg?, wait_graphics?, highlight?, tones?, startup?, shutdown?, transformation_open?, transformation_close?)>
<!ATTLIST theme
name CDATA #IMPLIED
version NMTOKEN #IMPLIED
>
<!ELEMENT tones EMPTY >
<!ATTLIST tones
cal_alert NMTOKEN #IMPLIED
msg_alert NMTOKEN #IMPLIED
ringtone NMTOKEN #IMPLIED
>
<!ELEMENT transformation_close EMPTY >
<!ATTLIST transformation_close
main_display_graphics NMTOKEN #IMPLIED
second_display_graphics NMTOKEN #IMPLIED
tone NMTOKEN #IMPLIED
>
<!ELEMENT transformation_open EMPTY >
<!ATTLIST transformation_open
main_display_graphics NMTOKEN #IMPLIED
second_display_graphics NMTOKEN #IMPLIED
tone NMTOKEN #IMPLIED
>
<!ELEMENT wait_graphics EMPTY >
<!ATTLIST wait_graphics
src NMTOKEN #IMPLIED
>
<!ELEMENT wallpaper EMPTY >
<!ATTLIST wallpaper
main_display_graphics NMTOKEN #REQUIRED
second_display_graphics NMTOKEN #IMPLIED
>
- <!--
- <!DOCTYPE theme PUBLIC "-//NOKIA//DTD THEME 2.0//EN" "theme.dtd">
- This is a re-creation of theme DTD based on "theme_descriptor.xml"
- that is produced by "Nokia S40 Theme Studio 2.1"
- --REQUIRED
- wallpaper
- screensaver
- -- OPTIONAL
- everything else
- -->
- <!ENTITY % MenuItem "applications|ams_messages|brew|callregister|camera|
- cdmacust|contacts|extras|gallery|goto|media|messages|
- number_entry|organizer|push_to_talk|services|settings|
- simatk|sport|voiceportal|wireless_village">
- <!ENTITY % Colors.Display "main|second">
- <!ELEMENT background EMPTY >
- <!ATTLIST background
- grid_menu_bg NMTOKEN #IMPLIED
- main_default_bg NMTOKEN #IMPLIED
- note_bg NMTOKEN #IMPLIED
- second_default_bg NMTOKEN #IMPLIED
- >
- <!ELEMENT colors EMPTY >
- <!ATTLIST colors
- active_idle_active_font_color NMTOKEN #IMPLIED
- active_idle_content_background_color NMTOKEN #IMPLIED
- calendar_highlight_color NMTOKEN #IMPLIED
- display %Colors.Display; #REQUIRED
- grid_highlight_color NMTOKEN #IMPLIED
- grid_menu_font_color NMTOKEN #IMPLIED
- grid_menu_highlight_font_color NMTOKEN #IMPLIED
- header_font_color NMTOKEN #IMPLIED
- idle_font_color NMTOKEN #IMPLIED
- menu_font_color NMTOKEN #IMPLIED
- menu_highlight_font_color NMTOKEN #IMPLIED
- reorder_highlight_color NMTOKEN #IMPLIED
- reorder_highlight_font_color NMTOKEN #IMPLIED
- shortcut_bar_popup_background_color NMTOKEN #IMPLIED
- shortcut_bar_popup_font_color NMTOKEN #IMPLIED
- softkey_font_color NMTOKEN #IMPLIED
- status_area_font_color NMTOKEN #IMPLIED
- >
- <!ELEMENT highlight EMPTY >
- <!ATTLIST highlight
- active_idle_row NMTOKEN #IMPLIED
- active_idle_shortcut_bar NMTOKEN #IMPLIED
- grid NMTOKEN #IMPLIED
- list NMTOKEN #IMPLIED
- reorder NMTOKEN #IMPLIED
- tab NMTOKEN #IMPLIED
- >
- <!ELEMENT menu_item EMPTY >
- <!ATTLIST menu_item
- animating_grid NMTOKEN #IMPLIED
- app_specific_bg NMTOKEN #IMPLIED
- grid_view_icon NMTOKEN #IMPLIED
- item_id %MenuItem; #REQUIRED
- list_view_icon NMTOKEN #IMPLIED
- >
- <!ELEMENT radio_audio_bg EMPTY >
- <!ATTLIST radio_audio_bg
- audio_bg NMTOKEN #IMPLIED
- radio_bg NMTOKEN #IMPLIED
- >
- <!ELEMENT screensaver EMPTY >
- <!ATTLIST screensaver
- main_display_graphics NMTOKEN #REQUIRED
- second_display_graphics NMTOKEN #IMPLIED
- >
- <!ELEMENT shutdown EMPTY >
- <!ATTLIST shutdown
- main_display_graphics NMTOKEN #IMPLIED
- second_display_graphics NMTOKEN #IMPLIED
- tone NMTOKEN #IMPLIED
- >
- <!ELEMENT softkey_bg EMPTY >
- <!ATTLIST softkey_bg
- left NMTOKEN #IMPLIED
- middle NMTOKEN #IMPLIED
- right NMTOKEN #IMPLIED
- >
- <!ELEMENT startup EMPTY >
- <!ATTLIST startup
- main_display_graphics NMTOKEN #IMPLIED
- second_display_graphics NMTOKEN #IMPLIED
- tone NMTOKEN #IMPLIED
- >
- <!ELEMENT theme
- (colors*, menu_item*, wallpaper, screensaver, background?, radio_audio_bg?, softkey_bg?, wait_graphics?, highlight?, tones?, startup?, shutdown?, transformation_open?, transformation_close?)>
- <!ATTLIST theme
- name CDATA #IMPLIED
- version NMTOKEN #IMPLIED
- >
- <!ELEMENT tones EMPTY >
- <!ATTLIST tones
- cal_alert NMTOKEN #IMPLIED
- msg_alert NMTOKEN #IMPLIED
- ringtone NMTOKEN #IMPLIED
- >
- <!ELEMENT transformation_close EMPTY >
- <!ATTLIST transformation_close
- main_display_graphics NMTOKEN #IMPLIED
- second_display_graphics NMTOKEN #IMPLIED
- tone NMTOKEN #IMPLIED
- >
- <!ELEMENT transformation_open EMPTY >
- <!ATTLIST transformation_open
- main_display_graphics NMTOKEN #IMPLIED
- second_display_graphics NMTOKEN #IMPLIED
- tone NMTOKEN #IMPLIED
- >
- <!ELEMENT wait_graphics EMPTY >
- <!ATTLIST wait_graphics
- src NMTOKEN #IMPLIED
- >
- <!ELEMENT wallpaper EMPTY >
- <!ATTLIST wallpaper
- main_display_graphics NMTOKEN #REQUIRED
- second_display_graphics NMTOKEN #IMPLIED
- >
Strong with this one, the sudo is.
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
A bit of an update on my //Threads Merged, since I just noticed it's been viewed over 2,000 times so far.
I'd written this to package themes for my cellphone last year but never really did much with it, I plan to do a rewrite to include more phones now so I figure I should post this before I clean it off my drive.
Basicly Nokia S40 themes are zipfiles containing an XML descriptor file, some images, & maybe an SWF screensaver in the Version-3 S40 themes.
If you rename a *.nth file to .zip it will will open in any application that handles zipfiles, somthing like 7-zip doesn't even require renaming it.
When I wrote this the only zip functionalty access I had was via a script posted by camperjohn64 in this post.
This theme packager requires the script in that post & that is the include required as seen in the first lines of the packager.
First I'll post the class, followed by example usage in the next post since it's a tad lengthy.
I'd written this to package themes for my cellphone last year but never really did much with it, I plan to do a rewrite to include more phones now so I figure I should post this before I clean it off my drive.
Basicly Nokia S40 themes are zipfiles containing an XML descriptor file, some images, & maybe an SWF screensaver in the Version-3 S40 themes.
If you rename a *.nth file to .zip it will will open in any application that handles zipfiles, somthing like 7-zip doesn't even require renaming it.
When I wrote this the only zip functionalty access I had was via a script posted by camperjohn64 in this post.
This theme packager requires the script in that post & that is the include required as seen in the first lines of the packager.
Code: [ Select ]
// File packaging/compression
require('zipfile.class.php');
require('zipfile.class.php');
- // File packaging/compression
- require('zipfile.class.php');
First I'll post the class, followed by example usage in the next post since it's a tad lengthy.
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
nokia-s40theme.php
Code: [ Select ]
<?php
// File packaging/compression
require('zipfile.class.php');
class s40theme
{
var $file_list = Array();
var $theme = Array('name' => 'New Theme', 'version' => '0.0');
var $theme_descriptor;
var $theme_elements;
var $descriptor_template = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE theme PUBLIC \"-//NOKIA//DTD THEME {VERSION}//EN\" \"theme.dtd\">
<theme name=\"{THEME_NAME}\" version=\"{VERSION}\">\n{ELEMENTS}\n</theme>";
// Convience Functions
function set_name($name){$this -> theme['name'] = $name;}
function set_version($version){$this -> theme['version'] = $version;}
function sanitized_filename($filename){return preg_replace( "/[^\w\.-]+/", "_", preg_replace( '/^.+[\\\\\\/]/', '', $filename ));}
// Main Functions
function update_files($filename)
{
if( ! is_file($filename)){ return false;}
array_push($this -> file_list, $filename);
$this -> file_list = array_unique($this -> file_list);
return true;
}
function get_theme_descriptor()
{
$xml = '';
foreach($this -> theme_elements as $element => $details)
{
if( ! $details['inuse'])
{
continue;
}
if( ! $details['repeatable'])
{
$node = "\t<$element";
foreach($details['attributes'] as $attribute => $deffinition)
{
$node .= "\n\t\t" . $attribute . '="' . $deffinition['value'] . '"';
}
$xml .= "$node />\n";
}
else
{
foreach($details['clones'] as $clone => $clone_details)
{
$node = "\t<$element";
foreach($clone_details as $attribute => $deffinition)
{
$node .= "\n\t\t" . $attribute . '="' . $deffinition['value'] . '"';
}
$xml .= "$node />\n";
}
}
}
$this -> theme_descriptor = str_replace(
Array('{VERSION}', '{THEME_NAME}', '{ELEMENTS}'),
Array($this -> theme['version'], $this -> theme['name'], $xml),
$this -> descriptor_template
);
return $this -> theme_descriptor;
}
function set_element($element, $attributes)
{
if( ! array_key_exists($element, $this -> theme_elements)
or
! is_array($attributes))
{
return false;
}
$this -> theme_elements[$element]['inuse'] = true;
if($this -> theme_elements[$element]['repeatable'])
{
$clone_id = count($this -> theme_elements[$element]['clones']);
foreach($attributes as $attribute => $value)
{
if( ! array_key_exists($attribute, $this -> theme_elements[$element]['attributes']))
{
continue;
}
if($this -> theme_elements[$element]['attributes'][$attribute]['isfile'])
{
if( ! $this -> update_files($value))
{
if($clone_id < count($this -> theme_elements[$element]['clones']))
{
array_pop($this -> theme_elements[$element]['clones']);
if($clone_id == 0)
{
$this -> theme_elements[$element]['inuse'] = false;
}
}
return false;
}
$value = $this -> sanitized_filename($value);
}
$this -> theme_elements[$element]['clones'][$clone_id][$attribute]['value'] = utf8_encode($value);
}
}
else
{
foreach($attributes as $attribute => $value)
{
if( ! array_key_exists($attribute, $this -> theme_elements[$element]['attributes']))
{
continue;
}
if($this -> theme_elements[$element]['attributes'][$attribute]['isfile'])
{
if( ! $this -> update_files($value))
{
$this -> theme_elements[$element]['inuse'] = false;
return false;
}
$value = $this -> sanitized_filename($value);
}
$this -> set_elements_attribute($element, $attribute, $value);
}
}
return true;
}
function set_elements_attribute($element, $attribute, $value)
{
if( ! array_key_exists($attribute, $this -> theme_elements[$element]['attributes']))
{
return false;
}
$this -> theme_elements[$element]['attributes'][$attribute]['value'] = utf8_encode($value);
return true;
}
// Packaging
function packaged()
{
$zip = new zipfile();
$zip -> add_file($this -> get_theme_descriptor(), 'theme_descriptor.xml');
foreach($this -> file_list as $a_file)
{
$file_handle = fopen($a_file, 'rb');
$file_data = fread($file_handle, filesize($a_file));
fclose($file_handle);
$zip -> add_file($file_data, $this -> sanitized_filename($a_file));
}
return $zip -> file();
}
}
class s40theme1_1 extends s40theme
{
// Available Menu Items
var $menu_items = Array(
'callregister','settings','organizer','gallery','services','media','applications',
'contacts','simatk','push_to_talk','wireless_village','number_entry','messages',
'goto','amsmessages','default'
);
function s40theme1_1()
{
$this -> set_version('1.1');
$this -> theme_elements = Array(
'background' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'background-mini' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'colorscheme' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'color' => Array('isfile' => false, 'value' => false)
)
),
'icon' => Array(
'inuse' => false,
'repeatable' => true,
'clones' => Array(),
'attributes' => Array(
'src' => Array('isfile' => true),
'item_id' => Array('isfile' => false),
'size' => Array('isfile' => false),
)
),
'ringtone' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'screensaver' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'wallpaper' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'colorscheme-mini' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'color' => Array('isfile' => false, 'value' => false)
)
),
'wallpaper-mini' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
)
);
}
}
class s40theme2_0 extends s40theme
{
function s40theme2_0()
{
$this -> set_version('2.0');
$this -> theme_elements = Array(
'colors' => Array(
'inuse' => false,
'repeatable' => true,
'clones' => Array(),
'attributes' => Array(
'display' => Array('isfile' => false, 'value' => false),
'header_font_color' => Array('isfile' => false, 'value' => false),
'status_area_font_color' => Array('isfile' => false, 'value' => false),
'softkey_font_color' => Array('isfile' => false, 'value' => false),
'calendar_highlight_color' => Array('isfile' => false, 'value' => false),
'idle_font_color' => Array('isfile' => false, 'value' => false),
'active_idle_active_font_color' => Array('isfile' => false, 'value' => false),
'active_idle_content_background_color' => Array('isfile' => false, 'value' => false),
'shortcut_bar_popup_font_color' => Array('isfile' => false, 'value' => false),
'shortcut_bar_popup_background_color' => Array('isfile' => false, 'value' => false),
'menu_font_color' => Array('isfile' => false, 'value' => false),
'menu_highlight_font_color' => Array('isfile' => false, 'value' => false),
'grid_menu_font_color' => Array('isfile' => false, 'value' => false),
'grid_menu_highlight_font_color' => Array('isfile' => false, 'value' => false),
'reorder_highlight_font_color' => Array('isfile' => false, 'value' => false),
'grid_highlight_color' => Array('isfile' => false, 'value' => false),
'reorder_highlight_color' => Array('isfile' => false, 'value' => false)
)
),
'menu_item' => Array(
'inuse' => false,
'repeatable' => true,
'clones' => Array(),
'attributes' => Array(
'item_id' => Array('isfile' => false, 'value' => false),
'list_view_icon' => Array('isfile' => true, 'value' => false),
'grid_view_icon' => Array('isfile' => true, 'value' => false),
'animating_grid' => Array('isfile' => true, 'value' => false),
'app_specific_bg' => Array('isfile' => true, 'value' => false)
)
),
'wallpaper' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false)
)
),
'screensaver' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false)
)
),
'background' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_default_bg' => Array('isfile' => true, 'value' => false),
'second_default_bg' => Array('isfile' => true, 'value' => false),
'grid_menu_bg' => Array('isfile' => true, 'value' => false),
'note_bg' => Array('isfile' => true, 'value' => false)
)
),
'radio_audio_bg' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'radio_bg' => Array('isfile' => true, 'value' => false),
'audio_bg' => Array('isfile' => true, 'value' => false)
)
),
'softkey_bg' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'left' => Array('isfile' => true, 'value' => false),
'middle' => Array('isfile' => true, 'value' => false),
'right' => Array('isfile' => true, 'value' => false)
)
),
'wait_graphics' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'highlight' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'tab' => Array('isfile' => true, 'value' => false),
'list' => Array('isfile' => true, 'value' => false),
'grid' => Array('isfile' => true, 'value' => false),
'active_idle_row' => Array('isfile' => true, 'value' => false),
'active_idle_shortcut_bar' => Array('isfile' => true, 'value' => false),
'reorder' => Array('isfile' => true, 'value' => false)
)
),
'tones' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'ringtone' => Array('isfile' => true, 'value' => false),
'msg_alert' => Array('isfile' => true, 'value' => false),
'cal_alert' => Array('isfile' => true, 'value' => false)
)
),
'startup' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false),
'tone' => Array('isfile' => true, 'value' => false)
)
),
'shutdown' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false),
'tone' => Array('isfile' => true, 'value' => false)
)
),
'transformation_open' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false),
'tone' => Array('isfile' => true, 'value' => false)
)
),
'transformation_close' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false),
'tone' => Array('isfile' => true, 'value' => false)
)
)
);
}
}
?>
// File packaging/compression
require('zipfile.class.php');
class s40theme
{
var $file_list = Array();
var $theme = Array('name' => 'New Theme', 'version' => '0.0');
var $theme_descriptor;
var $theme_elements;
var $descriptor_template = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE theme PUBLIC \"-//NOKIA//DTD THEME {VERSION}//EN\" \"theme.dtd\">
<theme name=\"{THEME_NAME}\" version=\"{VERSION}\">\n{ELEMENTS}\n</theme>";
// Convience Functions
function set_name($name){$this -> theme['name'] = $name;}
function set_version($version){$this -> theme['version'] = $version;}
function sanitized_filename($filename){return preg_replace( "/[^\w\.-]+/", "_", preg_replace( '/^.+[\\\\\\/]/', '', $filename ));}
// Main Functions
function update_files($filename)
{
if( ! is_file($filename)){ return false;}
array_push($this -> file_list, $filename);
$this -> file_list = array_unique($this -> file_list);
return true;
}
function get_theme_descriptor()
{
$xml = '';
foreach($this -> theme_elements as $element => $details)
{
if( ! $details['inuse'])
{
continue;
}
if( ! $details['repeatable'])
{
$node = "\t<$element";
foreach($details['attributes'] as $attribute => $deffinition)
{
$node .= "\n\t\t" . $attribute . '="' . $deffinition['value'] . '"';
}
$xml .= "$node />\n";
}
else
{
foreach($details['clones'] as $clone => $clone_details)
{
$node = "\t<$element";
foreach($clone_details as $attribute => $deffinition)
{
$node .= "\n\t\t" . $attribute . '="' . $deffinition['value'] . '"';
}
$xml .= "$node />\n";
}
}
}
$this -> theme_descriptor = str_replace(
Array('{VERSION}', '{THEME_NAME}', '{ELEMENTS}'),
Array($this -> theme['version'], $this -> theme['name'], $xml),
$this -> descriptor_template
);
return $this -> theme_descriptor;
}
function set_element($element, $attributes)
{
if( ! array_key_exists($element, $this -> theme_elements)
or
! is_array($attributes))
{
return false;
}
$this -> theme_elements[$element]['inuse'] = true;
if($this -> theme_elements[$element]['repeatable'])
{
$clone_id = count($this -> theme_elements[$element]['clones']);
foreach($attributes as $attribute => $value)
{
if( ! array_key_exists($attribute, $this -> theme_elements[$element]['attributes']))
{
continue;
}
if($this -> theme_elements[$element]['attributes'][$attribute]['isfile'])
{
if( ! $this -> update_files($value))
{
if($clone_id < count($this -> theme_elements[$element]['clones']))
{
array_pop($this -> theme_elements[$element]['clones']);
if($clone_id == 0)
{
$this -> theme_elements[$element]['inuse'] = false;
}
}
return false;
}
$value = $this -> sanitized_filename($value);
}
$this -> theme_elements[$element]['clones'][$clone_id][$attribute]['value'] = utf8_encode($value);
}
}
else
{
foreach($attributes as $attribute => $value)
{
if( ! array_key_exists($attribute, $this -> theme_elements[$element]['attributes']))
{
continue;
}
if($this -> theme_elements[$element]['attributes'][$attribute]['isfile'])
{
if( ! $this -> update_files($value))
{
$this -> theme_elements[$element]['inuse'] = false;
return false;
}
$value = $this -> sanitized_filename($value);
}
$this -> set_elements_attribute($element, $attribute, $value);
}
}
return true;
}
function set_elements_attribute($element, $attribute, $value)
{
if( ! array_key_exists($attribute, $this -> theme_elements[$element]['attributes']))
{
return false;
}
$this -> theme_elements[$element]['attributes'][$attribute]['value'] = utf8_encode($value);
return true;
}
// Packaging
function packaged()
{
$zip = new zipfile();
$zip -> add_file($this -> get_theme_descriptor(), 'theme_descriptor.xml');
foreach($this -> file_list as $a_file)
{
$file_handle = fopen($a_file, 'rb');
$file_data = fread($file_handle, filesize($a_file));
fclose($file_handle);
$zip -> add_file($file_data, $this -> sanitized_filename($a_file));
}
return $zip -> file();
}
}
class s40theme1_1 extends s40theme
{
// Available Menu Items
var $menu_items = Array(
'callregister','settings','organizer','gallery','services','media','applications',
'contacts','simatk','push_to_talk','wireless_village','number_entry','messages',
'goto','amsmessages','default'
);
function s40theme1_1()
{
$this -> set_version('1.1');
$this -> theme_elements = Array(
'background' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'background-mini' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'colorscheme' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'color' => Array('isfile' => false, 'value' => false)
)
),
'icon' => Array(
'inuse' => false,
'repeatable' => true,
'clones' => Array(),
'attributes' => Array(
'src' => Array('isfile' => true),
'item_id' => Array('isfile' => false),
'size' => Array('isfile' => false),
)
),
'ringtone' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'screensaver' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'wallpaper' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'colorscheme-mini' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'color' => Array('isfile' => false, 'value' => false)
)
),
'wallpaper-mini' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
)
);
}
}
class s40theme2_0 extends s40theme
{
function s40theme2_0()
{
$this -> set_version('2.0');
$this -> theme_elements = Array(
'colors' => Array(
'inuse' => false,
'repeatable' => true,
'clones' => Array(),
'attributes' => Array(
'display' => Array('isfile' => false, 'value' => false),
'header_font_color' => Array('isfile' => false, 'value' => false),
'status_area_font_color' => Array('isfile' => false, 'value' => false),
'softkey_font_color' => Array('isfile' => false, 'value' => false),
'calendar_highlight_color' => Array('isfile' => false, 'value' => false),
'idle_font_color' => Array('isfile' => false, 'value' => false),
'active_idle_active_font_color' => Array('isfile' => false, 'value' => false),
'active_idle_content_background_color' => Array('isfile' => false, 'value' => false),
'shortcut_bar_popup_font_color' => Array('isfile' => false, 'value' => false),
'shortcut_bar_popup_background_color' => Array('isfile' => false, 'value' => false),
'menu_font_color' => Array('isfile' => false, 'value' => false),
'menu_highlight_font_color' => Array('isfile' => false, 'value' => false),
'grid_menu_font_color' => Array('isfile' => false, 'value' => false),
'grid_menu_highlight_font_color' => Array('isfile' => false, 'value' => false),
'reorder_highlight_font_color' => Array('isfile' => false, 'value' => false),
'grid_highlight_color' => Array('isfile' => false, 'value' => false),
'reorder_highlight_color' => Array('isfile' => false, 'value' => false)
)
),
'menu_item' => Array(
'inuse' => false,
'repeatable' => true,
'clones' => Array(),
'attributes' => Array(
'item_id' => Array('isfile' => false, 'value' => false),
'list_view_icon' => Array('isfile' => true, 'value' => false),
'grid_view_icon' => Array('isfile' => true, 'value' => false),
'animating_grid' => Array('isfile' => true, 'value' => false),
'app_specific_bg' => Array('isfile' => true, 'value' => false)
)
),
'wallpaper' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false)
)
),
'screensaver' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false)
)
),
'background' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_default_bg' => Array('isfile' => true, 'value' => false),
'second_default_bg' => Array('isfile' => true, 'value' => false),
'grid_menu_bg' => Array('isfile' => true, 'value' => false),
'note_bg' => Array('isfile' => true, 'value' => false)
)
),
'radio_audio_bg' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'radio_bg' => Array('isfile' => true, 'value' => false),
'audio_bg' => Array('isfile' => true, 'value' => false)
)
),
'softkey_bg' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'left' => Array('isfile' => true, 'value' => false),
'middle' => Array('isfile' => true, 'value' => false),
'right' => Array('isfile' => true, 'value' => false)
)
),
'wait_graphics' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'src' => Array('isfile' => true, 'value' => false)
)
),
'highlight' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'tab' => Array('isfile' => true, 'value' => false),
'list' => Array('isfile' => true, 'value' => false),
'grid' => Array('isfile' => true, 'value' => false),
'active_idle_row' => Array('isfile' => true, 'value' => false),
'active_idle_shortcut_bar' => Array('isfile' => true, 'value' => false),
'reorder' => Array('isfile' => true, 'value' => false)
)
),
'tones' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'ringtone' => Array('isfile' => true, 'value' => false),
'msg_alert' => Array('isfile' => true, 'value' => false),
'cal_alert' => Array('isfile' => true, 'value' => false)
)
),
'startup' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false),
'tone' => Array('isfile' => true, 'value' => false)
)
),
'shutdown' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false),
'tone' => Array('isfile' => true, 'value' => false)
)
),
'transformation_open' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false),
'tone' => Array('isfile' => true, 'value' => false)
)
),
'transformation_close' => Array(
'inuse' => false,
'repeatable' => false,
'attributes' => Array(
'main_display_graphics' => Array('isfile' => true, 'value' => false),
'second_display_graphics' => Array('isfile' => true, 'value' => false),
'tone' => Array('isfile' => true, 'value' => false)
)
)
);
}
}
?>
- <?php
- // File packaging/compression
- require('zipfile.class.php');
- class s40theme
- {
- var $file_list = Array();
- var $theme = Array('name' => 'New Theme', 'version' => '0.0');
- var $theme_descriptor;
- var $theme_elements;
- var $descriptor_template = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
- <!DOCTYPE theme PUBLIC \"-//NOKIA//DTD THEME {VERSION}//EN\" \"theme.dtd\">
- <theme name=\"{THEME_NAME}\" version=\"{VERSION}\">\n{ELEMENTS}\n</theme>";
- // Convience Functions
- function set_name($name){$this -> theme['name'] = $name;}
- function set_version($version){$this -> theme['version'] = $version;}
- function sanitized_filename($filename){return preg_replace( "/[^\w\.-]+/", "_", preg_replace( '/^.+[\\\\\\/]/', '', $filename ));}
- // Main Functions
- function update_files($filename)
- {
- if( ! is_file($filename)){ return false;}
- array_push($this -> file_list, $filename);
- $this -> file_list = array_unique($this -> file_list);
- return true;
- }
- function get_theme_descriptor()
- {
- $xml = '';
- foreach($this -> theme_elements as $element => $details)
- {
- if( ! $details['inuse'])
- {
- continue;
- }
- if( ! $details['repeatable'])
- {
- $node = "\t<$element";
- foreach($details['attributes'] as $attribute => $deffinition)
- {
- $node .= "\n\t\t" . $attribute . '="' . $deffinition['value'] . '"';
- }
- $xml .= "$node />\n";
- }
- else
- {
- foreach($details['clones'] as $clone => $clone_details)
- {
- $node = "\t<$element";
- foreach($clone_details as $attribute => $deffinition)
- {
- $node .= "\n\t\t" . $attribute . '="' . $deffinition['value'] . '"';
- }
- $xml .= "$node />\n";
- }
- }
- }
- $this -> theme_descriptor = str_replace(
- Array('{VERSION}', '{THEME_NAME}', '{ELEMENTS}'),
- Array($this -> theme['version'], $this -> theme['name'], $xml),
- $this -> descriptor_template
- );
- return $this -> theme_descriptor;
- }
- function set_element($element, $attributes)
- {
- if( ! array_key_exists($element, $this -> theme_elements)
- or
- ! is_array($attributes))
- {
- return false;
- }
- $this -> theme_elements[$element]['inuse'] = true;
- if($this -> theme_elements[$element]['repeatable'])
- {
- $clone_id = count($this -> theme_elements[$element]['clones']);
- foreach($attributes as $attribute => $value)
- {
- if( ! array_key_exists($attribute, $this -> theme_elements[$element]['attributes']))
- {
- continue;
- }
- if($this -> theme_elements[$element]['attributes'][$attribute]['isfile'])
- {
- if( ! $this -> update_files($value))
- {
- if($clone_id < count($this -> theme_elements[$element]['clones']))
- {
- array_pop($this -> theme_elements[$element]['clones']);
- if($clone_id == 0)
- {
- $this -> theme_elements[$element]['inuse'] = false;
- }
- }
- return false;
- }
- $value = $this -> sanitized_filename($value);
- }
- $this -> theme_elements[$element]['clones'][$clone_id][$attribute]['value'] = utf8_encode($value);
- }
- }
- else
- {
- foreach($attributes as $attribute => $value)
- {
- if( ! array_key_exists($attribute, $this -> theme_elements[$element]['attributes']))
- {
- continue;
- }
- if($this -> theme_elements[$element]['attributes'][$attribute]['isfile'])
- {
- if( ! $this -> update_files($value))
- {
- $this -> theme_elements[$element]['inuse'] = false;
- return false;
- }
- $value = $this -> sanitized_filename($value);
- }
- $this -> set_elements_attribute($element, $attribute, $value);
- }
- }
- return true;
- }
- function set_elements_attribute($element, $attribute, $value)
- {
- if( ! array_key_exists($attribute, $this -> theme_elements[$element]['attributes']))
- {
- return false;
- }
- $this -> theme_elements[$element]['attributes'][$attribute]['value'] = utf8_encode($value);
- return true;
- }
- // Packaging
- function packaged()
- {
- $zip = new zipfile();
- $zip -> add_file($this -> get_theme_descriptor(), 'theme_descriptor.xml');
- foreach($this -> file_list as $a_file)
- {
- $file_handle = fopen($a_file, 'rb');
- $file_data = fread($file_handle, filesize($a_file));
- fclose($file_handle);
- $zip -> add_file($file_data, $this -> sanitized_filename($a_file));
- }
- return $zip -> file();
- }
- }
- class s40theme1_1 extends s40theme
- {
- // Available Menu Items
- var $menu_items = Array(
- 'callregister','settings','organizer','gallery','services','media','applications',
- 'contacts','simatk','push_to_talk','wireless_village','number_entry','messages',
- 'goto','amsmessages','default'
- );
- function s40theme1_1()
- {
- $this -> set_version('1.1');
- $this -> theme_elements = Array(
- 'background' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'src' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'background-mini' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'src' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'colorscheme' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'color' => Array('isfile' => false, 'value' => false)
- )
- ),
- 'icon' => Array(
- 'inuse' => false,
- 'repeatable' => true,
- 'clones' => Array(),
- 'attributes' => Array(
- 'src' => Array('isfile' => true),
- 'item_id' => Array('isfile' => false),
- 'size' => Array('isfile' => false),
- )
- ),
- 'ringtone' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'src' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'screensaver' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'src' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'wallpaper' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'src' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'colorscheme-mini' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'color' => Array('isfile' => false, 'value' => false)
- )
- ),
- 'wallpaper-mini' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'src' => Array('isfile' => true, 'value' => false)
- )
- )
- );
- }
- }
- class s40theme2_0 extends s40theme
- {
- function s40theme2_0()
- {
- $this -> set_version('2.0');
- $this -> theme_elements = Array(
- 'colors' => Array(
- 'inuse' => false,
- 'repeatable' => true,
- 'clones' => Array(),
- 'attributes' => Array(
- 'display' => Array('isfile' => false, 'value' => false),
- 'header_font_color' => Array('isfile' => false, 'value' => false),
- 'status_area_font_color' => Array('isfile' => false, 'value' => false),
- 'softkey_font_color' => Array('isfile' => false, 'value' => false),
- 'calendar_highlight_color' => Array('isfile' => false, 'value' => false),
- 'idle_font_color' => Array('isfile' => false, 'value' => false),
- 'active_idle_active_font_color' => Array('isfile' => false, 'value' => false),
- 'active_idle_content_background_color' => Array('isfile' => false, 'value' => false),
- 'shortcut_bar_popup_font_color' => Array('isfile' => false, 'value' => false),
- 'shortcut_bar_popup_background_color' => Array('isfile' => false, 'value' => false),
- 'menu_font_color' => Array('isfile' => false, 'value' => false),
- 'menu_highlight_font_color' => Array('isfile' => false, 'value' => false),
- 'grid_menu_font_color' => Array('isfile' => false, 'value' => false),
- 'grid_menu_highlight_font_color' => Array('isfile' => false, 'value' => false),
- 'reorder_highlight_font_color' => Array('isfile' => false, 'value' => false),
- 'grid_highlight_color' => Array('isfile' => false, 'value' => false),
- 'reorder_highlight_color' => Array('isfile' => false, 'value' => false)
- )
- ),
- 'menu_item' => Array(
- 'inuse' => false,
- 'repeatable' => true,
- 'clones' => Array(),
- 'attributes' => Array(
- 'item_id' => Array('isfile' => false, 'value' => false),
- 'list_view_icon' => Array('isfile' => true, 'value' => false),
- 'grid_view_icon' => Array('isfile' => true, 'value' => false),
- 'animating_grid' => Array('isfile' => true, 'value' => false),
- 'app_specific_bg' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'wallpaper' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'main_display_graphics' => Array('isfile' => true, 'value' => false),
- 'second_display_graphics' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'screensaver' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'main_display_graphics' => Array('isfile' => true, 'value' => false),
- 'second_display_graphics' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'background' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'main_default_bg' => Array('isfile' => true, 'value' => false),
- 'second_default_bg' => Array('isfile' => true, 'value' => false),
- 'grid_menu_bg' => Array('isfile' => true, 'value' => false),
- 'note_bg' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'radio_audio_bg' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'radio_bg' => Array('isfile' => true, 'value' => false),
- 'audio_bg' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'softkey_bg' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'left' => Array('isfile' => true, 'value' => false),
- 'middle' => Array('isfile' => true, 'value' => false),
- 'right' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'wait_graphics' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'src' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'highlight' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'tab' => Array('isfile' => true, 'value' => false),
- 'list' => Array('isfile' => true, 'value' => false),
- 'grid' => Array('isfile' => true, 'value' => false),
- 'active_idle_row' => Array('isfile' => true, 'value' => false),
- 'active_idle_shortcut_bar' => Array('isfile' => true, 'value' => false),
- 'reorder' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'tones' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'ringtone' => Array('isfile' => true, 'value' => false),
- 'msg_alert' => Array('isfile' => true, 'value' => false),
- 'cal_alert' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'startup' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'main_display_graphics' => Array('isfile' => true, 'value' => false),
- 'second_display_graphics' => Array('isfile' => true, 'value' => false),
- 'tone' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'shutdown' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'main_display_graphics' => Array('isfile' => true, 'value' => false),
- 'second_display_graphics' => Array('isfile' => true, 'value' => false),
- 'tone' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'transformation_open' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'main_display_graphics' => Array('isfile' => true, 'value' => false),
- 'second_display_graphics' => Array('isfile' => true, 'value' => false),
- 'tone' => Array('isfile' => true, 'value' => false)
- )
- ),
- 'transformation_close' => Array(
- 'inuse' => false,
- 'repeatable' => false,
- 'attributes' => Array(
- 'main_display_graphics' => Array('isfile' => true, 'value' => false),
- 'second_display_graphics' => Array('isfile' => true, 'value' => false),
- 'tone' => Array('isfile' => true, 'value' => false)
- )
- )
- );
- }
- }
- ?>
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
Example usage
Code: [ Select ]
<?php
include("nokia-s40theme.php");
$theme_name = 'Silky Smooth';
$theme = new s40theme1_1();
$theme -> set_name($theme_name);
$theme -> set_element('ringtone', Array(
'src' => 'Enigmate-Asim_Kha-2032.mp3'));
$theme -> set_element('wallpaper', Array(
'src' => 'wallpaper.png'));
$theme -> set_element('wallpaper-mini', Array(
'src' => 'wallpaper-mini.png'));
$theme -> set_element('background', Array(
'src' => 'wallpaper.png'));
$theme -> set_element('background-mini', Array(
'src' => 'wallpaper-mini.png'));
$theme -> set_element('colorscheme', Array(
'color' => 'blue'));
$theme -> set_element('colorscheme-mini', Array(
'color' => 'blue'));
$theme -> set_element('screensaver', Array(
'src' => 'screensaver.gif'));
$menu_items = Array('callregister','settings','organizer','gallery','media','applications','contacts','wireless_village','messages','amsmessages','services');
foreach($menu_items as $icon){
$theme -> set_element('icon', Array(
'src' => "icons/$icon.png",
'item_id' => $icon,
'size' => 'small'));
$theme -> set_element('icon', Array(
'src' => "icons/$icon.png",
'item_id' => $icon,
'size' => 'large'));
}
ob_start();
$package = $theme -> packaged();
$package_size = strlen($package);
header('Last-Modified: '.date('r'));
header('Accept-Ranges: bytes');
header('Content-Length: ' . $package_size);
header('Content-Type: application/vnd.nok-s40theme');
header('Content-Disposition: attachment; filename="' . $theme_name . '.nth"');
print($package);
ob_end_flush();
?>
include("nokia-s40theme.php");
$theme_name = 'Silky Smooth';
$theme = new s40theme1_1();
$theme -> set_name($theme_name);
$theme -> set_element('ringtone', Array(
'src' => 'Enigmate-Asim_Kha-2032.mp3'));
$theme -> set_element('wallpaper', Array(
'src' => 'wallpaper.png'));
$theme -> set_element('wallpaper-mini', Array(
'src' => 'wallpaper-mini.png'));
$theme -> set_element('background', Array(
'src' => 'wallpaper.png'));
$theme -> set_element('background-mini', Array(
'src' => 'wallpaper-mini.png'));
$theme -> set_element('colorscheme', Array(
'color' => 'blue'));
$theme -> set_element('colorscheme-mini', Array(
'color' => 'blue'));
$theme -> set_element('screensaver', Array(
'src' => 'screensaver.gif'));
$menu_items = Array('callregister','settings','organizer','gallery','media','applications','contacts','wireless_village','messages','amsmessages','services');
foreach($menu_items as $icon){
$theme -> set_element('icon', Array(
'src' => "icons/$icon.png",
'item_id' => $icon,
'size' => 'small'));
$theme -> set_element('icon', Array(
'src' => "icons/$icon.png",
'item_id' => $icon,
'size' => 'large'));
}
ob_start();
$package = $theme -> packaged();
$package_size = strlen($package);
header('Last-Modified: '.date('r'));
header('Accept-Ranges: bytes');
header('Content-Length: ' . $package_size);
header('Content-Type: application/vnd.nok-s40theme');
header('Content-Disposition: attachment; filename="' . $theme_name . '.nth"');
print($package);
ob_end_flush();
?>
- <?php
- include("nokia-s40theme.php");
- $theme_name = 'Silky Smooth';
- $theme = new s40theme1_1();
- $theme -> set_name($theme_name);
- $theme -> set_element('ringtone', Array(
- 'src' => 'Enigmate-Asim_Kha-2032.mp3'));
- $theme -> set_element('wallpaper', Array(
- 'src' => 'wallpaper.png'));
- $theme -> set_element('wallpaper-mini', Array(
- 'src' => 'wallpaper-mini.png'));
- $theme -> set_element('background', Array(
- 'src' => 'wallpaper.png'));
- $theme -> set_element('background-mini', Array(
- 'src' => 'wallpaper-mini.png'));
- $theme -> set_element('colorscheme', Array(
- 'color' => 'blue'));
- $theme -> set_element('colorscheme-mini', Array(
- 'color' => 'blue'));
- $theme -> set_element('screensaver', Array(
- 'src' => 'screensaver.gif'));
- $menu_items = Array('callregister','settings','organizer','gallery','media','applications','contacts','wireless_village','messages','amsmessages','services');
- foreach($menu_items as $icon){
- $theme -> set_element('icon', Array(
- 'src' => "icons/$icon.png",
- 'item_id' => $icon,
- 'size' => 'small'));
- $theme -> set_element('icon', Array(
- 'src' => "icons/$icon.png",
- 'item_id' => $icon,
- 'size' => 'large'));
- }
- ob_start();
- $package = $theme -> packaged();
- $package_size = strlen($package);
- header('Last-Modified: '.date('r'));
- header('Accept-Ranges: bytes');
- header('Content-Length: ' . $package_size);
- header('Content-Type: application/vnd.nok-s40theme');
- header('Content-Disposition: attachment; filename="' . $theme_name . '.nth"');
- print($package);
- ob_end_flush();
- ?>
Strong with this one, the sudo is.
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
If you generate themes & save them to files rather than serve them immediately as in the example, & you're also using Apache, it's worth sticking this following code in an .htaccess file so the server sends the right mime-type.
Nokia phones are kinda picky about that & will save a *.nth file as a *.txt file if it doesn't get the right mime-type.
Nokia phones are kinda picky about that & will save a *.nth file as a *.txt file if it doesn't get the right mime-type.
Code: [ Select ]
AddType application/vnd.nok-s40theme .nth
Strong with this one, the sudo is.
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
- pmoch
- Born


- Joined: May 20, 2009
- Posts: 1
- Status: Offline
Que tal,
I have a problem and can not find answers anywhere. I've been testing and modifying themes for a nokia 6085. All items listed as S40 v2, and programming as it is described at the beginning. I could modify and make all sections of the topic but one startup.
For some reason the startup is not working, either in subjects or downloaded from the network in which I edit in etmas down some missing lines in the startup and shutdown as the second graph, and without this sequence does not work lina. But even so the startup has not worked and I can not find the answer to that is not working.
You can help me with that?
Thanks in advance.
I have a problem and can not find answers anywhere. I've been testing and modifying themes for a nokia 6085. All items listed as S40 v2, and programming as it is described at the beginning. I could modify and make all sections of the topic but one startup.
For some reason the startup is not working, either in subjects or downloaded from the network in which I edit in etmas down some missing lines in the startup and shutdown as the second graph, and without this sequence does not work lina. But even so the startup has not worked and I can not find the answer to that is not working.
You can help me with that?
Thanks in advance.
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 12 posts
- Users browsing this forum: No registered users and 134 guests
- 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
