Customizing SugarCRM 6.5 theme - sugarcrm

I am new to SugarCRM 6.5 CE.
I have been trying to make custom theme by copying the already available themes and changing the name of folder.
The theme is now available in the drop down but any changes I am making to its CSS is not taking place.
Thanks in advance.
Here is my themedef file
$themedef = array(
'name' => "Test",
'description' => "Default theme from Sugar 5",
'version' => array(
'regex_matches' => array('6\.*.*'),
),
'group_tabs' => true,
'parentTheme' => "Test",
);

You have to set the parent theme like this:
'parentTheme' => "Sugar5", // this is the standard theme you want to overwrite.

Related

Adding new main menu item to Moodle Mobile 3.5

I am trying to develop a new plugin to add an item to the main menu more items in Moodle Mobile 3.5 using PHP and Angular/Ionic 3. I want to display a new main menu item "Agenda" with icon.
After creating the db\mobile.php file and define the delegate as "CoreMainMenuDelegate", the problem now is showing the name in the main menu as "plugin.local_parentagenda.Agenda", and without icon.
What can I try to resolve this?
Moodle site version: 3.3.1
Moodle Mobile version: 3.5
You must add a valid key string from lang definition in displaydata as a title, and the icon is a string from ionicicons. Search for ion-md, only those work.
Here an example plugin local/example/db/mobile.php
$addons = array(
"local_example" => array( // Plugin identifier
'handlers' => array( // Different places where the plugin will display content.
'localexample' => array( // Handler unique name (alphanumeric).
'displaydata' => array(
'title' => 'pluginname',
'icon' => 'bluetooth',
'class' => '',
),
'delegate' => 'CoreMainMenuDelegate', // Delegate (where to display the link to the plugin)
'method' => 'mobile_test_view', // Main function in \local_example\output\mobile
)
),
'lang' => array( // Language strings that are used in all the handlers.
array('pluginname', 'local_example'),
array('example:viewexample', 'local_example')
),
));
Note the title property in displaydata array and the pluginname definition in lang array, both are required.

Mask and issues

Regarding the mask, in backend mask have default configurations such as below:
general.json => typo3conf/mask.json
frontend.content => fileadmin/templates/content/
frontend.layouts => fileadmin/templates/content/Layouts/
frontend.partials => fileadmin/templates/content/Partials/
backend.backend => fileadmin/templates/backend/
backend.layouts_backend => fileadmin/templates/backend/Layouts/
backend.partials_backend => fileadmin/templates/backend/Partials/
backend.preview => fileadmin/templates/preview/
While installing our theme extension, we need to change the above mask configuration option values like below:
general.json => typo3conf/ext/<extension_key>/mask.json
frontend.content => fileadmin/<extension_key>/templates/content/
frontend.layouts => fileadmin/<extension_key>/templates/content/Layouts/
frontend.partials => fileadmin/<extension_key>/templates/content/Partials/
backend.backend => fileadmin/<extension_key>/templates/backend/
backend.layouts_backend => fileadmin/<extension_key>/templates/backend/Layouts/
backend.partials_backend => fileadmin/<extension_key>/templates/backend/Partials/
backend.preview => fileadmin/<extension_key>/templates/preview/
We tried like below, but its not working:
plugin.tx_mask.general.json = EXT:user_ss4u/mask.json
module.tx_mask.general.json = EXT:user_ss4u/mask.json
It seems like you try to override the settings via typoscript, which is -
as far as i know - not possible.
The settings you want to change are saved in typo3conf/LocalConfiguration.php
in ['EXT']['extConf']['mask'] so there are two (okay, one with two ways) possibilities to change them:
1.1 via Extension Manager
Open the module "Extension" in the TYPO3 Backend and search for the mask Extension.
Click on the configure icon at the end of the row.
Now you should be able to change the settings.
Changes are stored in typo3conf/LocalConfiguration.php
1.2 via Mask itself
Open the module "Mask" in the TYPO3 Backend.
Click on the configure icon to change to the Configuration Tab.
Now you should be able to change the settings.
Changes are stored in typo3conf/LocalConfiguration.php
2. via PHP
You can add the following snippet to a file like the ext_localconf.php in typo3conf/ext/<extension_key> or in typo3conf/AdditionalConfiguration.php
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mask'] = serialize([
'json' => 'typo3conf/ext/<extension_key>/mask.json',
'content' => 'fileadmin/<extension_key>/templates/content/',
'layouts' => 'fileadmin/<extension_key>/templates/content/Layouts/',
'partials' => 'fileadmin/<extension_key>/templates/content/Partials/',
'backend' => 'fileadmin/<extension_key>/templates/backend/',
'layouts_backend' => 'fileadmin/<extension_key>/templates/backend/Layouts/',
'partials_backend' => 'fileadmin/<extension_key>/templates/backend/Partials/',
'preview' => 'fileadmin/<extension_key>/templates/preview/',
]);

How to add custom wizards in typo3 7 TCA?

When I try to add the wizard named wizard_geo_selector in TCA ,there arised an error "module not registered".Please tell me how to register the wizard properly in the TCA.?
In TYPO3 Version 7.6 new wizards are added like this:
Inside your extension create the directory Configuration/Backend/
In the new directory create a file Routes.php, it will be found automatically, no mentioning in ext_localconf.php or ext_tables.php is required. If you still need Ajax you can add the file AjaxRoutes.php in the same folder.
Content for Routes.php:
return array(
'my_wizard_element' => array(
'path' => '/wizard/tx_geoselecotor/geo_selector_wizard',
'target' => \Path\To\your\class\WizardGeoSelector::class . '::WizardAction'
),
);
Content for AjaxRoutes.php
<?php
/**
* Definitions for routes provided by EXT:backend
* Contains all AJAX-based routes for entry points
*
* Currently the "access" property is only used so no token creation + validation is made
* but will be extended further.
*/
return array('my_ajax_element' => array(
'path' => 'tx_geoselecotor/my_ajax_route',
'target' => \Path\To\your\class\MyAjaxController::class .'::myAjaxFunction'
));
If you're unsure about the notation you can compare with existing entries in the Global Variables in the Backend:
Navigate to System -> Configuration -> Backend Routes
The route of the paths is handled different, for Ajax it's always "ajax" prepended, so you've never to add it to the path, else it's twice in the route. For the common route there is no change concerning the defined string.
Now the wizard can be used and even it never has to be defined in ext_tables.php it has to be mentioned there from any table-field in the configuration-area (module[name]):
'table_field_for_wizard' => array(
'label' => 'LLL:EXT:my_extension/Resources/Private/Language/locallang.xml:table_name.tx_myextension_wizard',
'config' => array (
'type' => 'user',
'userFunc' => 'Path/to/class/without/wizard->renderForm',
'wizards' => array(
'my_wizard' => array(
'type' => 'popup',
'title' => 'MyTitle',
'JSopenParams' => 'height=700,width=780,status=0,menubar=0,scrollbars=1',
'icon' => 'EXT:' . $_EXTKEY . '/Resources/Public/img/link_popup.gif',
'module' => array(
'name' => 'my_wizard_element',
'urlParameters' => array(
'mode' => 'wizard',
'ajax' => '0',
'any' => '... parameters you need'
),
),
),
'_VALIGN' => 'middle',
'_PADDING' => '4',
),
# Optional
#'softref'=>'something',
),
),
In the userFunc Path/to/class/without/wizard->renderForm you've to create a button which is linking to the wizard and onClick the wizard will open with the route you defined in Routes.php and the optional urlParameters.
Currently I never found this whole item explained in the core-documentation.
Edit:
Details about routing can be found here: Routing
The rendering process can be found here: Rendering / NodeFactory
You should probably read also the outer context of the linked paragraph.
Edit 2:
An example extension can be found here, some things never work 100% but the wizard is working. The extension is for TYPO3 Version 7:
https://github.com/DavidBruchmann/imagemap_wizard
Ricky's answer doesn't really work anymore, since addModulePath ist deprecated since version 7.
Also, just registering the module like this still give's you said error.
The only thing that keeps the wizard going again is this:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule('wizard','pbsurvey_answers',"",\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY).'wizard/');
But when you add this, the module appears as a new point in your TYPO3 backend.
IN TCA add the wizard like follows:
'module' => array(
'name' => 'wizard_geo_selector',
),
In ext_tables.php register the wizard.
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
'wizard_geo_selector',
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/Wizards/Yourwizardname/'
);
Keep in mind this is deprecated since Typo3 7 and removed in Typo3 8.So you can use this method upto Typo3 7.For Typo3 8 do use the method specified by David below.

How to integrate newtinymce + elfinder extension in Yii?

I wanted to integrate elFinder with TinyMCE. More specifically, make it available as a button somewhere on TinyMCE (like inside insert picture dialog).
What I have done so far:
1. have newtinymce, elfinder extensions under protected/extensions folder. (The author said integrating these two would be cleaner in code)
2. have ElfinderController, TinyMceController as described on extension page.
3. inside protected/config/main.php component secion:
'widgetFactory'=>array(
'widgets'=>array(
'TinyMce'=>array(
'language'=>'en',
'settings'=>array(
'language' => 'en',
'theme' => "advanced",
'skin' => 'o2k7',
'plugins' => "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
// Theme options
'theme_advanced_buttons1' => "removeformat,pagebreak,visualchars,visualaid,|,insertlayer,moveforward,movebackward,absolute,styleprops,attribs,|,undo,redo,search,replace,cleanup,print,preview,save,newdocument",
'theme_advanced_buttons2' => "pastetext,pasteword,|,hr,blockquote,|,bullist,numlist,outdent,indent,justifyleft,justifycenter,justifyright,justifyfull,ltr,rtl,formatselect",//copy,cut,paste,
'theme_advanced_buttons3' => "nonbreaking,sub,sup,charmap,|,bold,italic,underline,strikethrough,forecolor,backcolor,fontsizeselect,fontselect",
'theme_advanced_buttons4' => "tablecontrols,|,link,unlink,anchor,|,image,media",
'theme_advanced_toolbar_location' => "top",
'theme_advanced_toolbar_align' => "right",
'theme_advanced_statusbar_location' => "bottom",
'theme_advanced_resizing' => true,
'relative_urls' => false,
'spellchecker_languages' => null,
'fileManager'=>array(
'class' => 'ext.elFinder.TinyMceElFinder',
'connectorRoute'=>'elfinder/connector',
),
)
)
)
),
4. in view file:
<?php
$this->widget('ext.tinymce.TinyMce', array(
'model' => $model,
'attribute' => 'content',
'compressorRoute' => 'tinyMce/compressor',
'htmlOptions' => array(
'rows' => 6,
'cols' => 60,
),
)); ?>
This gives me the TinyMCE editor without elFinder window as a button on TinyMCE somewhere (like inside insert picture dialog).
When I add the following inside view file, it gives me an elFinder area directly where I put the code.
<?php $this->widget('ext.elFinder.ServerFileInput', array(
'model' => $model,
'attribute' => 'content',
'connectorRoute' => 'elfinder/connector',
)
);?>
I guess this means elFinder is working. But I don't want it as a separate widget for a field, rather I want it to be part of TinyMCE as stated at the top.
What else do I need to integrate them?
It was a onfiguration problem. fileManager property was not a child of settings, but a sibling.
So config/main.php part should be something like:
'widgetFactory'=>array(
'widgets'=>array(
'TinyMce'=>array(
'language'=>'en',
'settings'=>array(...),
'fileManager'=>array(
'class' => 'ext.elFinder.TinyMceElFinder',
'connectorRoute'=>'elfinder/connector',
),

Magento Custom Module - WYSIWYG image browse issue

I have a custom module with a content field (WYSIWYG editor)
When I select the insert image button, the following popup appears. For some reason the 'browse' button at the side of the Image URL has disappeared. Can someone point me in the right direction to get the image icon back? (what block/controller etc)
What is required when adding the full featured WYSIWYG editor to a custom magento module?
This is my form field element within Form.php (block)
$fieldset->addField('post_content', 'editor', array(
'name' => 'post_content',
'label' => Mage::helper('faqs')->__('Answer'),
'title' => Mage::helper('faqs')->__('Answer'),
'style' => 'width:700px; height:500px;',
'wysiwyg' => true,
));
Thank you.
Jonny
Had to find out the hard way, but the solution is quite simple:
Please check the permissions of your Role your Admin is in unser System=>Permissions=>Roles
There you can find in the Tab "Role Resources" the Checkbox "Media Gallery". Make sure this checkbox is ticked!
Then, clean cache, log out and in again and it should work.
Cheers!
I managed to sort this by adding some configuration options to the field,
Add the following code above the addField() of your WYSIWYG,
$configSettings = Mage::getSingleton('cms/wysiwyg_config')->getConfig(
array( 'add_widgets' => false, 'add_variables' => false, 'add_images' => false, 'files_browser_window_url'=> $this->getBaseUrl().'admin/cms_wysiwyg_images/index/'));
Once you've added the code, you need to add another param to the addField called 'config' calling your $configSettings variable.
$fieldset->addField('post_content', 'editor', array(
'name' => 'post_content',
'label' => Mage::helper('faqs')->__('Answer'),
'title' => Mage::helper('faqs')->__('Answer'),
'style' => 'width:700px; height:500px;',
'wysiwyg' => true,
'config' => $configSettings
));