Add php files
This commit is contained in:
46
modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.en_us.lang.php
Executable file
46
modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.en_us.lang.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
$dashletStrings['InvadersDashlet'] = array('LBL_TITLE' => 'Invaders!',
|
||||
'LBL_DESCRIPTION' => 'A little way to pass the time',
|
||||
'LBL_DBLCLICK_HELP' => 'Use A and D to move, S to fire.',
|
||||
|
||||
);
|
||||
?>
|
||||
46
modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.ge_ge.lang.php
Executable file
46
modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.ge_ge.lang.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
$dashletStrings['InvadersDashlet'] = array('LBL_TITLE' => 'Invaders!',
|
||||
'LBL_DESCRIPTION' => 'Ein bisschen was zum Spielen',
|
||||
'LBL_DBLCLICK_HELP' => 'A und D um zu bewegen, S um zu feuern.',
|
||||
|
||||
);
|
||||
?>
|
||||
47
modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.meta.php
Executable file
47
modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.meta.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
global $app_strings, $current_language;
|
||||
|
||||
$dashletMeta['InvadersDashlet'] = array('title' => 'LBL_TITLE', // array index in language pack
|
||||
'description' => 'LBL_DESCRIPTION', // array index in language pack
|
||||
'icon' => 'themes/default/images/icon_Invaders_32.gif',
|
||||
'category' => 'Tools',
|
||||
);
|
||||
?>
|
||||
157
modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.php
Executable file
157
modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.php
Executable file
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/Dashlets/Dashlet.php');
|
||||
require_once('include/Sugar_Smarty.php');
|
||||
|
||||
class InvadersDashlet extends Dashlet {
|
||||
var $savedText; // users's saved text
|
||||
var $height = '100'; // height of the pad
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @global string current language
|
||||
* @param guid $id id for the current dashlet (assigned from Home module)
|
||||
* @param array $def options saved for this dashlet
|
||||
*/
|
||||
function InvadersDashlet($id, $def) {
|
||||
$this->loadLanguage('InvadersDashlet'); // load the language strings here
|
||||
|
||||
if(!empty($def['height'])) // set a default height if none is set
|
||||
$this->height = $def['height'];
|
||||
|
||||
parent::Dashlet($id); // call parent constructor
|
||||
|
||||
$this->isConfigurable = false; // dashlet is configurable
|
||||
$this->hasScript = true; // dashlet has javascript attached to it
|
||||
|
||||
// if no custom title, use default
|
||||
if(empty($def['title'])) $this->title = $this->dashletStrings['LBL_TITLE'];
|
||||
else $this->title = $def['title'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the dashlet
|
||||
*
|
||||
* @return string html to display dashlet
|
||||
*/
|
||||
function display() {
|
||||
$ss = new Sugar_Smarty();
|
||||
$ss->assign('id', $this->id);
|
||||
$ss->assign('height', $this->height);
|
||||
|
||||
$str = $ss->fetch('modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.tpl');
|
||||
return parent::display($this->dashletStrings['LBL_DBLCLICK_HELP']) . $str . '<br />'; // return parent::display for title and such
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the javascript for the dashlet
|
||||
*
|
||||
* @return string javascript to use with this dashlet
|
||||
*/
|
||||
function displayScript() {
|
||||
$ss = new Sugar_Smarty();
|
||||
$ss->assign('id', $this->id);
|
||||
|
||||
$str = $ss->fetch('modules/Home/Dashlets/InvadersDashlet/InvadersDashletScript.tpl');
|
||||
return $str; // return parent::display for title and such
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the configuration form for the dashlet
|
||||
*
|
||||
* @return string html to display form
|
||||
*/
|
||||
function displayOptions() {
|
||||
global $app_strings;
|
||||
|
||||
$ss = new Sugar_Smarty();
|
||||
$ss->assign('titleLbl', $this->dashletStrings['LBL_CONFIGURE_TITLE']);
|
||||
$ss->assign('heightLbl', $this->dashletStrings['LBL_CONFIGURE_HEIGHT']);
|
||||
$ss->assign('saveLbl', $app_strings['LBL_SAVE_BUTTON_LABEL']);
|
||||
$ss->assign('title', $this->title);
|
||||
$ss->assign('height', $this->height);
|
||||
$ss->assign('id', $this->id);
|
||||
|
||||
return parent::displayOptions() . $ss->fetch('modules/Home/Dashlets/InvadersDashlet/InvadersOptions.tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* called to filter out $_REQUEST object when the user submits the configure dropdown
|
||||
*
|
||||
* @param array $req $_REQUEST
|
||||
* @return array filtered options to save
|
||||
*/
|
||||
function saveOptions($req) {
|
||||
global $sugar_config, $timedate, $current_user, $theme;
|
||||
$options = array();
|
||||
$options['title'] = $_REQUEST['title'];
|
||||
if(is_numeric($_REQUEST['height'])) {
|
||||
if($_REQUEST['height'] > 0 && $_REQUEST['height'] <= 300) $options['height'] = $_REQUEST['height'];
|
||||
elseif($_REQUEST['height'] > 300) $options['height'] = '300';
|
||||
else $options['height'] = '100';
|
||||
}
|
||||
|
||||
// $options['savedText'] = br2nl($this->savedText);
|
||||
$options['savedText'] = $this->savedText;
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to save text on textarea blur. Accessed via Home/CallMethodDashlet.php
|
||||
* This is an example of how to to call a custom method via ajax
|
||||
*/
|
||||
function saveText() {
|
||||
if(isset($_REQUEST['savedText'])) {
|
||||
$optionsArray = $this->loadOptions();
|
||||
// _pp($_REQUEST['savedText']);
|
||||
$optionsArray['savedText'] = nl2br($_REQUEST['savedText']);
|
||||
$this->storeOptions($optionsArray);
|
||||
|
||||
}
|
||||
else {
|
||||
$optionsArray['savedText'] = '';
|
||||
}
|
||||
$json = getJSONobj();
|
||||
echo 'result = ' . $json->encode(array('id' => $_REQUEST['id'],
|
||||
'savedText' => $optionsArray['savedText']));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
38
modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.pl_pl.lang.php
Executable file
38
modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.pl_pl.lang.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* The contents of this file are subject to the SugarCRM Professional Subscription
|
||||
* Agreement ("License") which can be viewed at
|
||||
* http://www.sugarcrm.com/crm/products/sugar-professional-eula.html
|
||||
* By installing or using this file, You have unconditionally agreed to the
|
||||
* terms and conditions of the License, and You may not use this file except in
|
||||
* compliance with the License. Under the terms of the license, You shall not,
|
||||
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
|
||||
* or otherwise transfer Your rights to the Software, and 2) use the Software
|
||||
* for timesharing or service bureau purposes such as hosting the Software for
|
||||
* commercial gain and/or for the benefit of a third party. Use of the Software
|
||||
* may be subject to applicable fees and any use of the Software without first
|
||||
* paying applicable fees is strictly prohibited. You do not have the right to
|
||||
* remove SugarCRM copyrights from the source code or user interface.
|
||||
*
|
||||
* All copies of the Covered Code must include on each user interface screen:
|
||||
* (i) the "Powered by SugarCRM" logo and
|
||||
* (ii) the SugarCRM copyright notice
|
||||
* in the same form as they appear in the distribution. See full license for
|
||||
* requirements.
|
||||
*
|
||||
* Your Warranty, Limitations of liability and Indemnity are expressly stated
|
||||
* in the License. Please refer to the License for the specific language
|
||||
* governing these rights and limitations under the License. Portions created
|
||||
* by SugarCRM are Copyright (C) 2004-2007 SugarCRM, Inc.; All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
$dashletStrings['InvadersDashlet'] = array('LBL_TITLE' => 'Najeźdźcy!',
|
||||
'LBL_DESCRIPTION' => 'Ciekawy sposób spędzania czasu :)',
|
||||
'LBL_DBLCLICK_HELP' => 'Użyj A i D, do poruszania się i S aby strzelać.',
|
||||
|
||||
);
|
||||
?>
|
||||
Reference in New Issue
Block a user