मैंने अपनी व्यापक खोज जारी रखी है और जूमला 1.5 के लिए आलेख संपादक में अतिरिक्त बटन जोड़ने पर एक मार्गदर्शिका पाई है।
ट्यूटोरियल यहां उपलब्ध है: http://tushev.org/articles/programming/18-how-to-create-an-editor-button-editors-xtd-plugin-for-joomla।
सीधे बॉक्स से बाहर यह जूमला 2.5 और जूमला 3.0 के साथ काम नहीं करेगा क्योंकि एक्सएमएल मैनिफेस्ट मानकों को कभी-कभी बदल दिया गया है। ट्यूटोरियल के साथ लाइन में रखते हुए इसके बजाय इस एक्सएमएल मेनिफेस्ट का उपयोग करें।
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" method="upgrade" group="editors-xtd">
<name>test</name>
<author>Name</author>
<creationDate>Month 2013</creationDate>
<copyright>Month Name. All rights reserved.</copyright>
<license>GPL</license>
<authorEmail>Email</authorEmail>
<authorUrl>Your URL</authorUrl>
<version>1.0.0</version>
<description>
"adds the button 'test' to the editor"
</description>
<files>
<filename plugin="test">test.php</filename>
</files>
</extension>
ट्यूटोरियल पीएचपी सही है और इस प्रकार है:
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.plugin.plugin');
class plgButtonTest extends JPlugin {
function plgButtonTest(& $subject, $config)
{
parent::__construct($subject, $config);
}
function onDisplay($name)
{
$js = "
function buttonTestClick(editor) {
txt = prompt('Please enter something','123');
if(!txt) return;
jInsertEditorText('{test '+txt+'}', editor);
}";
$css = ".button2-left .testButton {
background: transparent url(/plugins/editors-xtd/test.png) no-repeat 100% 0px;
}";
$doc = & JFactory::getDocument();
$doc->addScriptDeclaration($js);
$doc->addStyleDeclaration($css);
$button = new JObject();
$button->set('modal', false);
$button->set('onclick', 'buttonTestClick(\''.$name.'\');return false;');
$button->set('text', JText::_('Test'));
$button->set('name', 'testButton');
$button->set('link', '#');
return $button;
}
}
?>
आप सभी आपकी मदद के लिए धन्यवाद। यदि आपके पास कोई अन्य बेहतर तरीका है तो मैं सबसे ज्यादा आभारी हूं।
स्रोत
2012-12-07 09:10:14
क्या आप अपना कोड पोस्ट कर सकते हैं? मैं इसे प्लगइन इंस्टॉल करता हूं और सही जगह पर और सक्षम है। – Elin
हाय एलिन, मैंने कोड पोस्ट करने पर विचार किया लेकिन यह मदद नहीं करेगा क्योंकि यह 'पेज ब्रेक' बटन के लिए पहले से उपलब्ध कोड है जो डिफ़ॉल्ट जूमला इंस्टॉल के साथ आता है। प्लगइन सक्षम है और उसी स्थान पर अन्य संपादक-xtd प्लगइन्स के रूप में। –
यदि यह पूरी तरह से एक प्रतिलिपि है तो आप उन स्थानों में से किसी एक को बदलने में विफल रहे हैं जहां नाम xml में कुछ मिलान करना है। – Elin