Keyword

[PLUGIN] - Admin Form

  • Clint De Battista
  • Clint De Battista's Avatar Topic Author
  • Offline
  • New Member
More
10 years 3 months ago - 10 years 3 months ago #129662 by Clint De Battista
[PLUGIN] - Admin Form was created by Clint De Battista
function onRenderAdminForm(&$item, $type, $tabs = '') {

if ($tabs == 'extrafields') {

$mainframe = JFactory::getApplication();
$path = "item-extrafields";

$manifest = '
<?xml version="1.0" encoding="utf-8"?>
<extension>
<fields group="item-extrafields" label="Saisons">
<field name="saison1" label ="PLG_K2_EXTRAFIELDS_LABEL_SAISON1" type="editor" width="100%" filter="safehtml" buttons="true" />
</fields>
</extension>';

jimport('joomla.form.form');

$form = JForm::getInstance('plg_k2_'.$this->pluginName.'_'.$path, $manifest, array(), true, 'fields[@group="'.$path.'"]');


$fields = '';
foreach ($form->getFieldset() as $field)
{
$search = 'name="'.$field->name.'"';
$replace = 'name="plugins"';
$input = JString::str_ireplace($search, $replace, $field->__get('input'));
$fields .= $field->__get('label').' '.$input;

}



if ($fields)
{
$plugin = new stdClass;
$plugin->name = $this->pluginNameHumanReadable;
$plugin->fields = $fields;

$doc = JFactory::getDocument();

$js = "

c = window.parent.tinyMCE;
d = 'wtfffffffffffff';
//document.getElement('#' + c).set('value', d);
console.log(c);
";

$doc->addScriptDeclaration($js);

return $plugin;
}


//JLog::add('le(s) colonne(s): ' . print_r($plugin, true) . ' n\'existe(nt) pas');

}

}

This is on my plugin. Everythings works good but when I save I don't have on my editor the last "text" but it's stored on database.

Do I have to use an alternative to "restore" the text from the database ?

Please Log in or Create an account to join the conversation.

  • Clint De Battista
  • Clint De Battista's Avatar Topic Author
  • Offline
  • New Member
More
10 years 3 months ago #129663 by Clint De Battista
Replied by Clint De Battista on topic Re: [PLUGIN] - Admin Form
Forum dead?

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago - 9 years 10 months ago #134119 by Abu Reviewer
Replied by Abu Reviewer on topic [PLUGIN] - Admin Form
I too need a solution for this problem did you find any solution?
Last edit: 9 years 10 months ago by Abu Reviewer. Reason: Spelling mistake

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago #134141 by Lefteris
Replied by Lefteris on topic [PLUGIN] - Admin Form
@Clint De Battista
Hi. What exactly are you trying to achieve with this code? You don't need to override this function in your plugin. A good place to start when writing K2 plugins is the example K2 plugin at github.com/joomlaworks/example-k2-plugin .

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum