This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS functionality for a redundant checkbox above the group suggest selector box, providing a checkbox for users to select to a specific chosen group (like the homepage or main communications team). | |
(function($, LW) { | |
// Make adjustments below to match the group id and group name | |
// to the calendar group you want to use for this feature. | |
var group_id = '8'; | |
var group_name = 'Homepage'; | |
if (LW.page === 'events_edit' || LW.page === 'events_sub_edit' || LW.page === 'news_edit') { // define pages to target with this transformation | |
if (livewhale.group_title != group_name) { // if we're not in the target group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Sample event creation code | |
require $_SERVER['DOCUMENT_ROOT'].'/livewhale/nocache.php'; // load LW functions | |
$gid = 1; // id of group where the event should be created | |
$data_to_save = array( // create sample event | |
'gid'=>$gid, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Save this file in /livewhale/client/modules/mymodule/ and login to LiveWhale to load the module for the first time. | |
$_LW->REGISTERED_APPS['my_module']=array( | |
'title'=>'My Module', | |
'handlers'=>array('onFormsSubmission'), | |
); | |
class LiveWhaleApplicationMyModule { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load LiveWhale | |
require $_SERVER['DOCUMENT_ROOT'].'/livewhale/nocache.php'; | |
// Show errors | |
ini_set('display_errors', 1); | |
// Require logged-in user | |
if (!$_LW->isLiveWhaleUser()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
This is a sample application designed to demonstrate how to add an additional custom field to a backend editor. | |
The example provided adds a "Dress Code" field to the existing event editor in LiveWhale. To add a custom field to the news editor, for example, follow the same example but change all references from events to news below. | |
*/ | |
$_LW->REGISTERED_APPS['custom_fields'] = array( // configure this application module | |
'title' => 'Custom Fields', | |
'handlers' => array('onLoad', 'onAfterValidate', 'onSaveSuccess', 'onAfterEdit', 'onOutput') | |
); | |
class LiveWhaleApplicationCustomFields { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Provide access to each segment of the server path with the variable: <xphp var="url_segment_[x]" /> | |
$_LW->REGISTERED_APPS['server_path']=array( | |
'title'=>'Server Path', | |
'handlers'=>array('onLoad') | |
); | |
class LiveWhaleApplicationServerPath { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$_LW->REGISTERED_APPS['global_search']=array( // configure this module | |
'title'=>'Global Search', | |
'handlers'=>array('onLoad') | |
); | |
class LiveWhaleApplicationGlobalSearch { | |
public function onLoad() { // in back-end search, if admin searching for ID, automatically search globally |