TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

styles and chart

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: zixxus
Date: 2014-08-14
Time: 21:31

styles and chart

I have two questions about this document styles and graphs.

1. chart I want to appear only when you select the input. and if you do not select have it not be. in what way the easiest way to do this, to chart in August reappearing only when we in the right place. trying it for the help of the code but then I would have to somehow enclose the chart folder.

2 I have a document which in the majority of the code and such. Code looks like this

<table:table table:name="46.51.181.47" table:style-name="_34_6.51.181.47">
                <table:table-column table:style-name="_34_6.51.181.47.A"/>
                <table:table-column table:style-name="_34_6.51.181.47.B"/>
                <table:table-row table:style-name="_34_6.51.181.47.1">
                    <table:table-cell table:style-name="_34_6.51.181.47.A1" office:value-type="string">
                        <text:p text:style-name="P2">
                            <text:span text:style-name="White_20_Text">
                                <text:span text:style-name="T1">text</text:span>
                            </text:span>
                        </text:p>
                    </table:table-cell>

and so on

adds this code by $tbs->source

and now how do I keep the style of these tables, cos Beam type or color?
By: zixxus
Date: 2014-08-14
Time: 23:54

Re: styles and chart

okay with styles coped.
as if someone had some cool idea how you can add a graph directly from the code so that he was in the right place, not in the template. Only the code.
By: Skrol29
Date: 2014-08-16
Time: 00:05

Re: styles and chart

Hi zixxus,

It is quite complicated to add a chart that is not prepared in the template.
This is because they are several sub-file that make a chart in an ODT.
For creating a chart from scratch you have to refer to the Open Document Format.

Maybe you could place the chart inside a conditional TBS block so the chart will be displayed only with the condition is checked.
By: zixxus
Date: 2014-08-17
Time: 23:38

Re: styles and chart

hah managed to :)
it turned out very simple
if someone needed a graph we need to copy to a new document, save the file and unzip it (unzip, winrar, Xarchiver). Then copy the folders META-INF, Object 1, ObjectReplacements.do the same with the file who will get after using TBS and copy only the folder META-INF, now we have to mix both folders META-INF. edit the manifest.xml file with TBS and paste him all the lines of unwrapped as the first META-INF / manifest.xml that contain the word object 1 is:

    <manifest:file-entry manifest:full-path="Object 1/content.xml" manifest:media-type="text/xml"/>
<manifest:file-entry manifest:full-path="Object 1/styles.xml" manifest:media-type="text/xml"/>
<manifest:file-entry manifest:full-path="Object 1/meta.xml" manifest:media-type="text/xml"/>
<manifest:file-entry manifest:full-path="Object 1/" manifest:media-type="application/vnd.oasis.opendocument.chart"/>
<manifest:file-entry manifest:full-path="ObjectReplacements/Object 1" manifest:media-type="application/x-openoffice-gdimetafile;windows_formatname=&quot;GDIMetaFile&quot;"/>

and save it as manifest.xml in the first file that you extracted them. Now simply use the this: http://php.net/manual/en/ziparchive.open.php


and by copying (document with the graph / content.xml) home page with adequate line graph. more or less the php code looks like this (there is no function of the zip on the link)
$chart = '<text:p text:style-name="Standard"><draw:frame draw:style-name="fr1" draw:name="chart" text:anchor-type="char" svg:x="-0.4882in" svg:y="0.1492in" svg:width="7.5516in" svg:height="3.022in" draw:z-index="0"><draw:object xlink:href="./Object 1" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/><draw:image xlink:href="./ObjectReplacements/Object 1" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/><svg:desc>chart</svg:desc></draw:frame></text:p>';
$TBS->LoadTemplate($template, OPENTBS_ALREADY_XML);
$TBS->MergeBlock('char', $chart);
By: Skrol29
Date: 2014-08-18
Time: 12:49

Re: styles and chart

Ok, thanks for sharing this tip.