Advertising
Paste Description for JZA
PHP Packager scripter, it misses some dump of info.
- JZA
- Friday, October 2nd, 2009 at 3:39:04pm MDT
- #!/usr/bin/php
- <?php
- $ext=$argv[1];
- $extensionname=$ext[0];
- $codefile=$argv[1];
- $zip = new ZipArchive();
- $zip->open($extensionname.".oxt",ZIPARCHIVE::CREATE);
- $dir=new Directorio($extensionname);
- $dir->crear();
- $addon=new Archivo($extensionname,"addons.xcu");
- $addon->setContent("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
- $addon->addLine("<oor:component-data xmlns:oor=\"http://openoffice.org/2001/registry\"");
- $addon->addLine(" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" oor:name=\"Addons\"");
- $addon->addLine(" oor:package=\"org.openoffice.Office\">");
- $addon->addLine("<node oor:name=\"AddonUI\">");
- $addon->addLine(" <node oor:name=\"OfficeToolBar\">");
- $addon->addLine(" <node oor:name=\"python.uno.openoffice.".$extensionname."\" oor:op=\"replace\">");
- $addon->addLine(" <node oor:name=\"m1\" oor:op=\"replace\">");
- $addon->addLine(" <prop oor:name=\"URL\" oor:type=\"xs:string\">");
- $addon->addLine(" <value>service:name.vojta.openoffice.".$extensionname."?execute</value>");
- $addon->addLine(" </prop>");
- $addon->addLine(" <prop oor:name=\"ImageIdentifier\" oor:type=\"xs:string\">");
- $addon->addLine(" <value/>");
- $addon->addLine(" </prop>");
- $addon->addLine(" <prop oor:name=\"Title\" oor:type=\"xs:string\">");
- $addon->addLine(" <value/>\n <value xml:lang=\"en-US\">".$extensionname."</value>");
- $addon->addLine(" <value xml:lang=\"cs\">Vlnka</value>\n </prop>");
- $addon->addLine(" <prop oor:name=\"Target\" oor:type=\"xs:string\">");
- $addon->addLine(" <value>_self</value>\n </prop>");
- $addon->addLine(" <prop oor:name=\"Context\" oor:type=\"xs:string\">");
- $addon->addLine(" <value>com.sun.star.text.TextDocument</value>\n </prop>\n </node>\n </node>\n</node>");
- $addon->addLine("</node>\n </oor:component-data>");
- $addon->crear();
- $zip->addFile($codefile);
- $zip->addFile($addon->folder.$addon->name,$addon->name);
- $zip->close();
- class Directorio
- {
- function __construct($name)
- {
- $this->name = $name;
- }
- function crear()
- {
- }
- }
- class Archivo
- {
- function __construct($folder,$name)
- {
- $this->folder=$folder;
- $this->name=$name;
- }
- function setContent($txt)
- {
- $this->content=$txt;
- }
- function addLine($txt)
- {
- $this->content=$this->content."\n".$txt;
- }
- function crear()
- {
- $this->folder = ($this->folder)?$this->folder."/":"";
- }
- };
- ?>
Paste Details
Tags: php ooo dictionary dic ooodic
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.