Change joomla 2.5 default editor in custom component - joomla

I am using jce editor in my joomla and it's my default editor.
now I want use tinymce editor in my custom component at frontend Without changing the default editor. I get editor by this code:
$editor = JFactory::getEditor();
echo $editor->display('content', $this->content, '550', '400', '60', '20', false);
but it's only show my default editor. I want only use tinymce in my custom component fronted.

First of all getEditor() is deprecated and you should not be using it for new code. Please review the docblocks and as instructed use JEditor instead.
If you read the docblocks you will see that the name of the editor is a property of the editor object. By default the constructor uses 'none' but you can put what you want.
However, more importantly, in your xml form (as illustrated in com_templates) you can specify the editor
<field
name="source"
type="editor"
editor="codemirror|none"
buttons="no"
label="COM_TEMPLATES_FIELD_SOURCE_LABEL"
description="COM_TEMPLATES_FIELD_SOURCE_DESC"
height="500px"
rows="20"
cols="80"
syntax="php"
filter="raw" />
Make sure you check that the editor is present and enabled, otherwise fall back to none.

Related

Is it possible to configure CKFinder as just a file browser without any upload functionality?

I want to be able to click on the image icon in CKEditor and be able to browser the local file system. I would like the chosen file to be passed to the editor just like the standard URL is. I want to use the base64image plugin to embed the image inline.
I have tried using CKFinder but, when I click the Browse Server button in the Image Properties dialog, I get an empty window with just 'run();' in the centre.
To enable CKFinder in read-only (gallery) mode, set the readOnly configuration option to true and pass it as a configruation option to the CKFinder.setupCKEditor function:
CKFinder.setupCKEditor( editor, {
readOnly: true
} );
This will disable the possibility to modify anything.
If you only want to disable uploads, you can disable modules related to upload operations:
CKFinder.setupCKEditor( editor, {
removeModules: 'FormUpload,Html5Upload,UploadFileButton'
} );
The second thing is to change Access Control settings in the server side connector by setting 'FILE_CREATE' to false so the uploads will be disabled also on the server side.

Dropdown menu does not trigger in oneui 3.0.2 (in Firefox)

I use an dropDownButton from the extlib, which does not work when I changed to OneUI 3.0.2 (from 2.1, in which it works fine).
Happens in firefox (31.8), not in (a very old) IE. Firebug shows the following error in its console, when I click on on of the dropdown entries:
TypeError: _9.getAttribute is not a function ,
and it point to ...{return _6[_9.getAttribute("widgetId")];}... in the lib -extlib.dijit.OneUIv302Dialog&-extlib.dijit.OneUIv302Menu&#Eya.js
Is it a (known) bug?
my code:
<xe:dropDownButton
id="dropDownButton1">
<xe:this.treeNodes>
<xe:basicContainerNode
label="IAM">
<xe:this.children>
<xe:basicLeafNode
submitValue="approve1" label="approve selected">
</xe:basicLeafNode>
<xe:basicLeafNode
submitValue="reject0" label="reject selected">
</xe:basicLeafNode>
</xe:this.children>
</xe:basicContainerNode>
</xe:this.treeNodes>
<xp:eventHandler
event="onItemClick" submit="true"
refreshMode="complete">
<xe:this.action><![CDATA[#{javascript:submitIAMAction()}]]></xe:this.action>
</xp:eventHandler>
</xe:dropDownButton>
I have tested the Extension Library DropDownButton in conjunction with OneUI V3.0.2 without any troubles.
UPDATE "Output on server console":
I am working with the following environment:
Firefox 42
Domino Server 9.0.1FP4
Extension Library Version 9.0.1.v00_14_20150831-1301
It could be a problem with your Domino Server and/or Extension Library Version?
Try to do some updates on your environment.
It sounds like the same issue we had. In our case, I think the drop down entries could still work if you clicked on the actual text in the drop down option, clicking in the 'white space' would not work.
We found a solution thanks to Serdar Basegmez in the Defect list in ExtLib project on OpenNTF
http://extlib.openntf.org/main.nsf/project.xsp?r=project/XPages%20Extension%20Library/defects/0FFE08B1FC57FE6A86257D91004C156D
Give this a try:
put the following in a javascript library.
if(dojo.isMozilla) dojo.addOnLoad(function() {
dijit.registry.backupByNode=dijit.registry.byNode;
dijit.registry.byNode=function(node) {
if(node.getAttribute) {
return dijit.registry.backupByNode(node);
} else {
return dijit.registry.backupByNode(node.parentNode);
}
}
});
and then add your theme: (add add as a resource to a single page)
<resources>
<script src="/fixDropDownButton.js" clientSide="true"
type="text/javascript"></script>
</resources>

Xpages ExtLib - dynamic content

When using dynamic content from extlib:
<xe:dynamicContent id="dynamicContent1" defaultFacet="key2" useHash="true" disableTheme="false" themeId="Dc">
<xp:this.facets>
<xc:cc_searchTemplate xp:key="key1" />
<xc:cc_vseZadeveTemplate xp:key="key2" />
</xp:this.facets>
</xe:dynamicContent>
with theme
<control>
<name>Dc</name>
<property mode="override">
<name>style</name>
<value>color:red</value>
</property>
</control>
Theme is not applied to dynamic content div. Also, why doing partial refresh on dynamic content (switch CC) doesnt load resources from custom control?
Simply put, this control does not have support for styleClass attribute. This can be found on github -> extlib -> dynamiccontent, dynamiccontrol renderer. Also in xsp config files.
Ive extended control and renderer and added style. Class is hardcoded atm.

Virtuemart setting "Checkout" link to target="new"

I know this question is specific to VM only but I have run out of options.
I'm usually ok with minimal php code editing, but his is over my head.
I can not find the php that relates to the "checkout" link
I need to have it open in a new window ie. target="new"
Reason being; VM is running in an iframe (facebook) and for Paypal to work I need to pull the user out of iframe and into new window on checkout.
You can find the checkout link in
components/com_virtuemart/themes/default/templates/pages/shop.cart.tpl.php
(If you're not using the default theme then replace 'default' with the name of your theme's directory).
You might have had trouble finding the checkout link because VirtueMart uses language files, so the text for the checkout link is actually PHPSHOP_CHECKOUT_TITLE and looked up from administrator/components/com_virtuemart/languages/common/ e.g. english.php. The workflow is recursively grep for the text to find it in the language file then recursively grep for its reference to find where it's used.
The checkout link is generated by a call to vmCommonHTML hyperlink, which takes the following parameters:
function hyperLink( $link, $text, $target='', $title='', $attributes='' )
...
So you'd need to specify the target in the third parameter, so change:
echo vmCommonHTML::hyperlink( $href, $text, '', $text, $class_att );
to
echo vmCommonHTML::hyperlink( $href, $text, 'new', $text, $class_att );

How to display custom Entity under 'Extensions' tab on workplace?

I have created a new custom entity called Sports Leagues.
Now i am wondering how to display/ accessible this under 'Extensions' tab on workplace?
Thanks
On the screen where you customize the new entity there's a section on the General tab called 'Areas that display this entity' - check the 'Workplace' checkbox.
Export Site Map, look for Area with Id="Workplace". Look for the Extensions group, or add:
<Group Id="Extensions" ResourceId="Group_Extensions">
<SubArea Id="sportsleagues" Entity="new_sportsleagues" />
</Group>
Import the SiteMap back into the system. (Settings then Customization)
did you remember to publish the new entity? ticking the workplace box and publishing the entity should be all you need to do.

Resources