-
AuthorPosts
-
goldorakiller Friend
goldorakiller
- Join date:
- July 2010
- Posts:
- 39
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 10
- Thanked:
- 6 times in 1 posts
September 22, 2010 at 3:37 pm #154539Why JA typo button doesn’t appear in frontend K2 edit window ?
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 23, 2010 at 8:54 am #356470<em>@goldorakiller 195102 wrote:</em><blockquote>Why JA typo button doesn’t appear in frontend K2 edit window ?</blockquote>
Dear goldorakiller,
By default the JaTypo plugin did not support this feature,you can try as follow to get it
Go to the plugin/system/jatypo.php file,look for these codes
[PHP]
function onAfterInitialise()
{
global $mainframe;$doc =& JFactory::getDocument();
$base_url = JURI::base();
global $mainframe;
if($mainframe->isAdmin()) {
$base_url = dirname ($base_url);
JHTML::_(‘behavior.mootools’);
$doc->addScript($base_url.’/plugins/system/jatypo/assets/script.js’);
$doc->addStylesheet($base_url.’/plugins/system/jatypo/assets/style.css’);
}
$doc->addStylesheet($base_url.”/plugins/system/jatypo/typo/typo.css”);
}function onAfterRender () {
global $mainframe;$jatypo = JRequest::getCmd (‘jatypo’);
if (!$mainframe->isAdmin() && !$jatypo) return;$tmpl = dirname (__FILE__).DS.’jatypo’.DS.’tmpl’.DS.’default.php’;
$html = $this->loadTemplate ($tmpl);
//$html = file_get_contents ($tmpl);
//if (preg_match (‘/<body[^>]*>(.*)</body>/s’, $html, $matches)) $html = $matches[1];$buffer = JResponse::getBody();
if($mainframe->isAdmin()) {
if (preg_match (‘/id=”editor-xtd-buttons”/’, $buffer)) {
//exist editor
//$html = “<div id=”jatypo-wrap”>$html</div>”;
$buffer = preg_replace (‘/</body>/’, “n$htmln</body>”, $buffer);
JResponse::setBody ($buffer);
}
return;
}//replace body by the sample
$buffer = preg_replace (‘/<body([^>]*)>.*</body>/s’, “<body\1>$html</body>”, $buffer);
JResponse::setBody ($buffer);
}
[/PHP]Change it to
[PHP]
function onAfterRoute()
{
global $mainframe;$doc =& JFactory::getDocument();
$view = JRequest::getCmd (‘view’);
$task = JRequest::getCmd (‘task’);$base_url = JURI::base();
global $mainframe;
if($mainframe->isAdmin() || (($view == ‘item’ || $view == ‘article’) && $task == ‘edit’)) {
if($mainframe->isAdmin()) {
$base_url = dirname ($base_url);
}
//$base_url = dirname ($base_url);
JHTML::_(‘behavior.mootools’);
$doc->addScript($base_url.’/plugins/system/jatypo/assets/script.js’);
$doc->addStylesheet($base_url.’/plugins/system/jatypo/assets/style.css’);
}
$doc->addStylesheet($base_url.”/plugins/system/jatypo/typo/typo.css”);
}
onAfterRender
function onAfterRender() {
global $mainframe;
$view = JRequest::getCmd (‘view’);$task = JRequest::getCmd (‘task’);
$jatypo = JRequest::getCmd (‘jatypo’);
if (!($mainframe->isAdmin() || (($view == ‘item’ || $view == ‘article’) && $task == ‘edit’)) && !$jatypo) return;$tmpl = dirname (__FILE__).DS.’jatypo’.DS.’tmpl’.DS.’default.php’;
$html = $this->loadTemplate ($tmpl);
//$html = file_get_contents ($tmpl);
//if (preg_match (‘/<body[^>]*>(.*)</body>/s’, $html, $matches)) $html = $matches[1];$buffer = JResponse::getBody();
if($mainframe->isAdmin() || (($view == ‘item’ || $view == ‘article’) && $task == ‘edit’)) {
if (preg_match (‘/id=”editor-xtd-buttons”/’, $buffer)) {
//exist editor
//$html = “<div id=”jatypo-wrap”>$html</div>”;
$buffer = preg_replace (‘/</body>/’, “n$htmln</body>”, $buffer);
JResponse::setBody ($buffer);
}
return;
}//replace body by the sample
$buffer = preg_replace (‘/<body([^>]*)>.*</body>/s’, “<body\1>$html</body>”, $buffer);
JResponse::setBody ($buffer);
}
[/PHP]I do hope that will help !
goldorakiller Friendgoldorakiller
- Join date:
- July 2010
- Posts:
- 39
- Downloads:
- 0
- Uploads:
- 9
- Thanks:
- 10
- Thanked:
- 6 times in 1 posts
September 23, 2010 at 9:49 am #356472Ok i try this and tell you.
I think this should be added in next ja typo version 🙂
EDIT :
That’s not work as I want .
Your code add typo example but not the ja typo button like in backend !
I’d like that K2 frontend works like backendEDIT 2 :
Ok now it’s work !
Thx dathq
-
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by goldorakiller 14 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum