Author: remi
Date: 2009-07-05 16:48:08 +0200 (Sun, 05 Jul 2009)
New Revision: 5055

Modified:
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
   
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
Log:
* Added "About" tool in the "Tools" page. (You need the previously committed 
plugin-tool "tool-about-tux" in your plugin directory)

Modified: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
    2009-07-05 14:46:23 UTC (rev 5054)
+++ 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
    2009-07-05 14:48:08 UTC (rev 5055)
@@ -38,6 +38,7 @@
         <![CDATA[
             function initialization()
             {
+                initializeLightbox();
             }
 
             function startATool(uuid)
@@ -51,6 +52,18 @@
                 }
                 getRequest("/plugins_server/start_plugin", args);
             }
+
+            function updateWindowAbout(uuid)
+            {
+                setpng(document.getElementById("windowGadgetHelpIcon"));
+                var skin = document.getElementById("skin").value;
+                var language = document.getElementById("language").value;
+                var src = "/wi_user_01/gadget_help?uuid=" + uuid;
+                src += "&language=" + language;
+                src += "&skin=" + skin;
+                src += "&rndParam=" + Math.random();
+                document.getElementById("windowAboutContentIFrame").src = src;
+            }
         ]]>
         </script>
     </head>
@@ -95,33 +108,77 @@
             <div class="frame01TopSpace">
             </div>
             <div class="frame01Middle">
-                <xsl:for-each select="root/data/*">
-                    <!-- ATTITUNE STUDIO -->
-                    <xsl:if test="name() = 'attitunes_studio'">
-                        <xsl:element name="a">
-                            <xsl:attribute name="class">toolsBtnTitle 
toolsBtnStartEnable</xsl:attribute>
-                            <xsl:attribute 
name="id">toolsStartAttitunesStatudio</xsl:attribute>
-                            <xsl:attribute 
name="onclick">javascript:startATool('<xsl:value-of select="uuid"/>');return 
false;</xsl:attribute>
-                            <xsl:attribute 
name="href">#</xsl:attribute><xsl:value-of select="../../translations/start"/>
-                        </xsl:element>
-                        <span class="toolsRowName"><xsl:value-of 
select="name"/></span>
-                        <div class="frame01Sep"></div>
-                    </xsl:if>
-                    <!-- TUX CONTROLLER -->
-                    <xsl:if test="name() = 'tux_controller'">
-                        <xsl:element name="a">
-                            <xsl:attribute name="class">toolsBtnTitle 
toolsBtnStartEnable</xsl:attribute>
-                            <xsl:attribute 
name="id">toolsStartAttitunesStatudio</xsl:attribute>
-                            <xsl:attribute 
name="onclick">javascript:startATool('<xsl:value-of select="uuid"/>');return 
false;</xsl:attribute>
-                            <xsl:attribute 
name="href">#</xsl:attribute><xsl:value-of select="../../translations/start"/>
-                        </xsl:element>
-                        <span class="toolsRowName"><xsl:value-of 
select="name"/></span>
-                        <!-- <div class="frame01Sep"></div> -->
-                    </xsl:if>
-                </xsl:for-each>
+                <!-- ATTITUNE STUDIO -->
+                <xsl:if test="root/data/attitunes_studio != ''">
+                    <xsl:element name="a">
+                        <xsl:attribute name="class">toolsBtnTitle 
toolsBtnStartEnable</xsl:attribute>
+                        <xsl:attribute 
name="id">toolsStartAttitunesStatudio</xsl:attribute>
+                        <xsl:attribute 
name="onclick">javascript:startATool('<xsl:value-of 
select="root/data/attitunes_studio/uuid"/>');return false;</xsl:attribute>
+                        <xsl:attribute 
name="href">#</xsl:attribute><xsl:value-of select="root/translations/start"/>
+                    </xsl:element>
+                    <span class="toolsRowName"><xsl:value-of 
select="root/data/attitunes_studio/name"/></span>
+                    <div class="frame01Sep"></div>
+                </xsl:if>
+                <!-- TUX CONTROLLER -->
+                <xsl:if test="root/data/tux_controller != ''">
+                    <xsl:element name="a">
+                        <xsl:attribute name="class">toolsBtnTitle 
toolsBtnStartEnable</xsl:attribute>
+                        <xsl:attribute 
name="id">toolsStartAttitunesStudio</xsl:attribute>
+                        <xsl:attribute 
name="onclick">javascript:startATool('<xsl:value-of 
select="root/data/tux_controller/uuid"/>');return false;</xsl:attribute>
+                        <xsl:attribute 
name="href">#</xsl:attribute><xsl:value-of select="root/translations/start"/>
+                    </xsl:element>
+                    <span class="toolsRowName"><xsl:value-of 
select="root/data/tux_controller/name"/></span>
+                    <div class="frame01Sep"></div>
+                </xsl:if>
+                <!-- ABOUT -->
+                <xsl:if test="root/data/about != ''">
+                    <xsl:element name="a">
+                        <xsl:attribute name="class">toolsBtnTitle 
toolsBtnShowEnable</xsl:attribute>
+                        <xsl:attribute name="id"><xsl:value-of 
select="root/data/about/uuid"/></xsl:attribute>
+                        <xsl:attribute name="name">lbOn</xsl:attribute>
+                        <xsl:attribute name="rel">windowAbout</xsl:attribute>
+                        <xsl:attribute 
name="href">#</xsl:attribute><xsl:value-of select="root/translations/show"/>
+                    </xsl:element>
+                    <span class="toolsRowName"><xsl:value-of 
select="root/data/about/name"/></span>
+                </xsl:if>
+
+
             </div>
             <div class="frame01Bottom"></div>
         </div>
+
+        <!-- WINDOW ABOUT -->
+        <div id="windowAbout" class="window01Box" 
onfocus="updateWindowAbout(arguments[0]);" style="height:350px; 
margin-top:65px;">
+            <div class="windowFrame01Top">
+                <div class="windowGadgetIcon">
+                    <xsl:element name="img">
+                        <xsl:attribute 
name="id">windowGadgetHelpIcon</xsl:attribute>
+                        <xsl:attribute name="src"><xsl:value-of 
select="root/data/about/icon"/></xsl:attribute>
+                        <xsl:attribute name="height">33</xsl:attribute>
+                        <xsl:attribute name="width">33</xsl:attribute>
+                    </xsl:element>
+                </div>
+                <span class="windowTitle" 
id="windowGadgetHelpTitle"><xsl:value-of select="root/data/about/name"/></span>
+            </div>
+            <div class="windowFrame01Middle" style="height:290px;">
+                <iframe class="windowContentIFrame"
+                    id="windowAboutContentIFrame"
+                    name="windowAboutContentIFrame"
+                    frameborder="0"
+                    scrolling="no"
+                    style="height:240px"
+                    src="">
+                </iframe>
+                <div 
style="display:table;float:left;height:34px;width:370px"></div>
+                <xsl:element name="a">
+                    <xsl:attribute name="class">windowBtn</xsl:attribute>
+                    <xsl:attribute name="name">lbOff</xsl:attribute>
+                    <xsl:attribute name="rel">deactivate</xsl:attribute>
+                    <xsl:attribute name="href">#</xsl:attribute><xsl:value-of 
select="root/translations/close"/>
+                </xsl:element>
+            </div>
+            <div class="windowFrame01Bottom"></div>
+        </div>
     </body>
 </html>
 </xsl:template>

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
  2009-07-05 14:46:23 UTC (rev 5054)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
  2009-07-05 14:48:08 UTC (rev 5055)
@@ -94,6 +94,16 @@
                 'uuid' : tuxControllerData['description']['uuid'],
                 'help' : tuxControllerData['description']['helpFile'],
             }
+        # About TuxBox
+        aboutTuxBoxData = resourcePluginsServer.getPluginData(
+            "d7c4218d-5a5c-4cdd-b515-0df7411c000f", language)
+        if aboutTuxBoxData != None:
+            result['about'] = {
+                'name' : aboutTuxBoxData['description']['translatedName'],
+                'icon' : aboutTuxBoxData['description']['iconFile'],
+                'uuid' : aboutTuxBoxData['description']['uuid'],
+                'help' : aboutTuxBoxData['description']['helpFile'],
+            }
         return result
 
 # Create an instance of the resource
@@ -391,6 +401,8 @@
         skin = parameters['skin']
         data = resourceUgcServer.getUgcData(uuid, language)
         if data == None:
+            data = resourcePluginsServer.getPluginData(uuid, language)
+        if data == None:
             contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
         else:
             contentStruct['root']['data'] = data


------------------------------------------------------------------------------
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to