Categories > TinyButStrong general >

opentbs heading

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: zixxus
Date: 2014-07-10
Time: 23:09

opentbs heading

Hello :)
how can I edit a heading 1, heading 2, etc. directly from the php code.
I have a php code and more precisely the form in which I would like in some places apply any tags ([[h1]] text [[/ h1]]) and later for the help str_replace to change the text so that it applied the document he got tags

text:
Lorem Ipsum is simply [[h1]] dummy text [[/ h1]] of the [[h2]] printing and [[/ h2]] typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,

The final document (the effect I'd like to get when you type text into the form):

Image
http://picoolio.net/images/2014/07/10/Screenshot-10.07.2014-230611.png
By: Skrol29
Date: 2014-07-11
Time: 00:57

Re: opentbs heading

Hi Zixxus,

Is your template DOCX ord ODT ?

You can select the header using $TBS->PlugIn(OPENTBS_SELECT_HEADER)
For more options, see http://www.tinybutstrong.com/opentbs.php?doc#opentbs_select_header

And then you can edit the contents using $TBS->Source

By: zixxus
Date: 2014-07-11
Time: 19:27

Re: opentbs heading

Hello Skrol ! :)

I am using sxw format, and watch the entire code uses $ OOo-> not $ TBS->
By: zixxus
Date: 2014-07-11
Time: 19:28

Re: opentbs heading

can have the whole ready-made code that I get to see him take a look?
By: Skrol29
Date: 2014-07-15
Time: 09:28

Re: opentbs heading

> the entire code uses $ OOo-> not $ TBS->

So you are using TinyDoc, not OpenTBS.

> can have the whole ready-made code

OpenTBS can be downloaded here: http://www.tinybutstrong.com/opentbs.php
By: zixxus
Date: 2014-07-15
Time: 19:01

Re: opentbs heading

how can I change the tags in tinyDoc ?
is the opportunity?
By: zixxus
Date: 2014-07-15
Time: 22:11

Re: opentbs heading

in what way I can to replace tags [[it]] [[/ it]] for a list of dots?
By: Skrol29
Date: 2014-07-15
Time: 23:14

Re: opentbs heading

The same way as for TBS:
Use $OOo->LoadXmlFromDoc() to load the header files, then use $OOo->Source for changing the contents.
See http://www.tinybutstrong.com/tbsooo.php
By: zixxus
Date: 2014-07-15
Time: 23:58

Re: opentbs heading

Sent in by YOU can ready code who turn [[it]] [[/ it]] on the list as <li> in html because unfortunately already who art the day I can not to deal :(
By: zixxus
Date: 2014-07-17
Time: 00:03

Re: opentbs heading

my code:
<?php

include_once('tbs_class.php');
include_once('tbs_plugin_opentbs.php');



$contentval = array();

$d =  $_POST['my_text'];
$d = preg_replace("#\[\[it]](.*?)\[\[/it]\]#si", '<text:h text:style-name="Heading_20_2" text:outline-level="1">\\1</text:h>', $d);

    $contentval[] = array(
        'valone' => 'defaulttext',
        'valtwo' => $d,
    );



$d =  $_POST['my_text_two'];
$d = preg_replace("#\[\[it]](.*?)\[\[/it]\]#si", '<text:h text:style-name="Heading_20_2" text:outline-level="1">\\1</text:h>', $d);

    $contentval[] = array(
        'valone' => 'defaulttext two',
        'valtwo' => $d,
    );

$TBS = new clsTinyButStrong;
$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN); // load the OpenTBS plugin


$template = 'teagsd.odt';
$TBS->LoadTemplate($template); // Also merge some [onload] automatic fields (depends of the type of document).



$TBS->MergeBlock('mb', 'array', 'contentval');


$TBS->PlugIn(OPENTBS_DELETE_COMMENTS);

$TBS->Show(OPENTBS_DOWNLOAD, 'ghdfghsd.odt');


my odt:

[mb;block=begin] [mb.valone] [mb.valtwo] [mb;block=end]

can you help me ?