当前位置: 首页>>代码示例>>PHP>>正文


PHP javascript类代码示例

本文整理汇总了PHP中javascript的典型用法代码示例。如果您正苦于以下问题:PHP javascript类的具体用法?PHP javascript怎么用?PHP javascript使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了javascript类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_new_record_form

/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    global $app_strings;
    global $app_list_strings;
    global $mod_strings;
    global $currentModule;
    global $current_user;
    global $timedate;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $form = new XTemplate('modules/Campaigns/Forms.html');
    $module_select = empty($_REQUEST['module_select']) ? '' : $_REQUEST['module_select'];
    $form->assign('MOD', $mod_strings);
    $form->assign('APP', $app_strings);
    $form->assign('THEME', SugarThemeRegistry::current()->__toString());
    $form->assign("JAVASCRIPT", get_set_focus_js() . get_validate_record_js());
    $form->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['campaign_status_dom'], "Planning"));
    $form->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['campaign_type_dom'], ""));
    $form->assign("USER_ID", $current_user->id);
    $form->assign("TEAM_ID", sprintf('<input type="hidden" name="team_id" value="%s">', $current_user->default_team));
    $form->assign("CALENDAR_LANG", "en");
    $form->assign("USER_DATEFORMAT", '(' . $timedate->get_user_date_format() . ')');
    $form->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
    $form->parse('main');
    $the_form .= $form->text('main');
    $focus = BeanFactory::getBean('Campaigns');
    $javascript = new javascript();
    $javascript->setFormName('quick_save');
    $javascript->setSugarBean($focus);
    $javascript->addRequiredFields('');
    $jscript = $javascript->getScript();
    $the_form .= $jscript . get_left_form_footer();
    return $the_form;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:39,代码来源:Forms.php

示例2: getFormBody

    function getFormBody($prefix, $mod = '', $formname = '', $size = '30', $script = true)
    {
        if (!ACLController::checkAccess('Notes', 'edit', true)) {
            return '';
        }
        global $mod_strings;
        $temp_strings = $mod_strings;
        if (!empty($mod)) {
            global $current_language;
            $mod_strings = return_module_language($current_language, $mod);
        }
        global $app_strings;
        global $app_list_strings;
        $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
        $lbl_note_subject = $mod_strings['LBL_NOTE_SUBJECT'];
        $lbl_note_description = $mod_strings['LBL_NOTE'];
        $default_parent_type = $app_list_strings['record_type_default_key'];
        $form = <<<EOF
\t\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t\t<input type="hidden" name="{$prefix}parent_type" value="{$default_parent_type}">
<p>\t\t\t\t<table cellspacing="0" cellpadding="0" border="0">
\t\t\t\t<tr>
\t\t\t\t    <td class="dataLabel">{$lbl_note_subject} <span class="required">{$lbl_required_symbol}</span></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t    <td class="dataField"><input name='{$prefix}name' size='{$size}' maxlength='255' type="text" value=""></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t    <td class="dataLabel">{$lbl_note_description}</td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t    <td class="dataField"><textarea name='{$prefix}description' cols='{$size}' rows='4' ></textarea></td>
\t\t\t\t</tr>
\t\t\t\t</table></p>


EOF;
        if ($script) {
            require_once 'include/javascript/javascript.php';
            require_once 'modules/Notes/Note.php';
            $javascript = new javascript();
            $javascript->setFormName($formname);
            $javascript->setSugarBean(new Note());
            $javascript->addRequiredFields($prefix);
            $form .= $javascript->getScript();
        }
        $mod_strings = $temp_strings;
        return $form;
    }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:49,代码来源:NoteFormBase.php

示例3: doSave

 function doSave()
 {
     $uid = (int) $_POST['uid'];
     $info = array();
     if ($_POST['pwd'] || $_POST['pwd1'] || $_POST['pwd2']) {
         $pwd = md5(trim($_POST['pwd']));
         $pwd1 = md5(trim($_POST['pwd1']));
         $pwd2 = md5(trim($_POST['pwd2']));
         if (!$_POST['pwd'] || !$_POST['pwd1'] || !$_POST['pwd2']) {
             javascript::alert("修改密码.原密码,新密码,确认密码不能为空");
         }
         $pwd != $user['password'] && javascript::alert("原密码错误!");
         $pwd1 != $pwd2 && javascript::alert("新密码与确认密码不一致!");
         iCMS_DB::query("UPDATE `#iCMS@__members` SET `password` = '{$pwd2}' WHERE `uid` ='{$uid}' LIMIT 1");
     }
     //	    $username=dhtmlspecialchars($_POST['name']);
     $_POST['email'] && !eregi("^([_\\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\\.([a-z]{2,6})\$", $_POST['email']) && javascript::alert("E-mail格式错误!!");
     $email = stripslashes($_POST['email']);
     $gender = intval($_POST['gender']);
     $info['nickname'] = dhtmlspecialchars(stripslashes($_POST['nickname']));
     cstrlen($info['nickname']) > 12 && javascript::alert("昵称长度大于12");
     $info['icq'] = intval($_POST['icq']);
     $info['home'] = dhtmlspecialchars(stripslashes($_POST['home']));
     $info['year'] = intval($_POST['year']);
     $info['month'] = intval($_POST['month']);
     $info['day'] = intval($_POST['day']);
     $info['from'] = dhtmlspecialchars(stripslashes($_POST['from']));
     $info['signature'] = dhtmlspecialchars(stripslashes($_POST['signature']));
     $user['info'] = $info;
     iCMS_DB::query("UPDATE `#iCMS@__members` SET `info` = '" . addslashes(serialize($user['info'])) . "',`email`='{$email}',`gender`='{$gender}' WHERE `uid` ='{$uid}' LIMIT 1");
     javascript::dialog('用户编辑完成!', 'url:' . __SELF__ . '?mo=user&do=manage');
 }
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:32,代码来源:user.mo.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     javascript::add('editarea/edit_area_full.js');
     javascript::add('featurecode.js');
     stylesheet::add('featurecode.css');
 }
开发者ID:swk,项目名称:bluebox,代码行数:7,代码来源:featurecode.php

示例5: index

 public function index()
 {
     stylesheet::add('esl', 50);
     javascript::add('pubsub.js', 50);
     //CLEAR THE ESL SESSION
     $_SESSION['esl'] = array();
 }
开发者ID:swk,项目名称:bluebox,代码行数:7,代码来源:esl.php

示例6: index

 public function index()
 {
     $this->view->filetree = filetree::php_file_tree(Kohana::config('freeswitch.cfg_root'), "javascript:FileManager.load('[link]');", array('xml', 'conf', 'tpl'));
     javascript::add('php_file_tree_jquery.js');
     stylesheet::add('php_file_tree.css');
     javascript::add('editarea/edit_area_full.js');
 }
开发者ID:swk,项目名称:bluebox,代码行数:7,代码来源:xmleditor.php

示例7: doSave

 function doSave()
 {
     $id = (int) $_POST['id'];
     $name = dhtmlspecialchars($_POST['name']);
     $table = dhtmlspecialchars($_POST['table']);
     $description = dhtmlspecialchars($_POST['desc']);
     $position2 = $_POST['pos'];
     $position = $_POST['position'];
     $binding = isset($_POST['binding']) ? 1 : 0;
     empty($name) && javascript::alert('模块名称不能为空!');
     empty($table) && $binding && javascript::alert('模块名不能为空!');
     if (!$binding && empty($id)) {
         if (empty($table)) {
             include iPATH . 'include/cn.class.php';
             $table = CN::pinyin($name);
         }
         $table = $table . '_content';
     }
     if ($id) {
         iCMS_DB::getValue("SELECT `id` FROM `#iCMS@__model` where `table` = '{$table}' and `id`!='{$id}'") && javascript::alert('该模块已经存在!请检查是否重复');
         iCMS_DB::query("UPDATE `#iCMS@__model` SET `name` = '{$name}', `table` = '{$table}', `binding` = '{$binding}', `description` = '{$description}', `position` = '{$position}', `position2` = '{$position2}' WHERE `id` = '{$id}';");
     } else {
         iCMS_DB::query("INSERT INTO `#iCMS@__model`(`name`, `table`, `binding`, `description`, `position`,`position2`, `addtime`)VALUES ('{$name}', '{$table}', '{$binding}', '{$description}', '{$position}','{$position2}', '" . time() . "');");
         $id = iCMS_DB::$insert_id;
     }
     model::cache();
     $moreaction = array(array("text" => "下一步添加字段", "url" => __SELF__ . "?mo=models&do=addfield&id=<?php echo {$id};?>"), array("text" => "返回模块列表", "url" => __SELF__ . "?mo=models&do=manage"));
     javascript::dialog('模块添加完成!<br />10秒后返回模块列表', "url:" . __SELF__ . "?mo=models&do=manage", $moreaction, 10);
 }
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:29,代码来源:models.mo.php

示例8: __construct

    public function __construct()
    {
        parent::__construct();

        stylesheet::add('autoattendant', 50);

        javascript::add('mustache');
    }
开发者ID:Jaybee-,项目名称:bluebox,代码行数:8,代码来源:autoattendant.php

示例9: doStatus

 function doStatus()
 {
     $id = intval($_GET['id']);
     $act = intval($_GET['act']);
     iCMS_DB::query("UPDATE `#iCMS@__advertise` SET `status` = '{$act}' WHERE `id` ='{$id}'");
     $this->create($id);
     javascript::dialog("操作完成!", 'url:1');
 }
开发者ID:idreamsoft,项目名称:iCMS5.1,代码行数:8,代码来源:advertise.mo.php

示例10: doUpdate

 function doUpdate()
 {
     foreach ($_POST as $key => $value) {
         updateConfig(dhtmlspecialchars($value), $key);
     }
     CreateConfigFile();
     javascript::dialog('配置已更新!');
 }
开发者ID:idreamsoft,项目名称:iCMS5.1,代码行数:8,代码来源:setting.mo.php

示例11: doEdit

 function doEdit()
 {
     $defArray['source'] = explode("\r\n", dhtmlspecialchars($_POST['source']));
     $defArray['author'] = explode("\r\n", dhtmlspecialchars($_POST['author']));
     $defArray['editor'] = explode("\r\n", dhtmlspecialchars($_POST['editor']));
     $this->iCMS->setCache('system/default', $defArray, 0);
     javascript::dialog('编辑完成!<br />3秒后返回', 'url:' . __SELF__ . '?mo=defaults');
 }
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:8,代码来源:defaults.mo.php

示例12: qtipAjaxReturn

 public function qtipAjaxReturn($data)
 {
     if (!empty($data->user_id)) {
         $fullName = $data->first_name . ' ' . $data->last_name;
         javascript::codeBlock('$(\'.users_dropdown\').append(\'<option value="' . $data->user_id . '" selected="selected">' . $fullName . '</option>\');');
     }
     parent::qtipAjaxReturn($data);
 }
开发者ID:swk,项目名称:bluebox,代码行数:8,代码来源:usermanager.php

示例13: get_new_record_form

/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    global $mod_strings;
    global $app_strings;
    global $app_list_strings;
    global $theme;
    global $current_user;
    global $sugar_version, $sugar_config;
    $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
    $lbl_subject = $mod_strings['LBL_SUBJECT'];
    $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
    $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
    $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
    $user_id = $current_user->id;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $the_form .= '<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    $the_form .= <<<EOQ
\t\t<form name="MachineSave" onSubmit="return check_form('MachineSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Machines">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="action" value="Save">



\t\t{$lbl_subject}&nbsp;<span class="required">{$lbl_required_symbol}</span><br>
\t\t<p><input name='name' type="text" size='27' maxlength="255"value=""><br>
EOQ;
    global $sugar_config;
    $the_form .= <<<EOQ
<p>\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value="  {$lbl_save_button_label}  " ></p>
\t\t
\t\t</form>
EOQ;
    require_once 'include/javascript/javascript.php';
    require_once 'modules/Machines/Machine.php';
    $javascript = new javascript();
    $javascript->setFormName('MachineSave');
    $javascript->setSugarBean(new Machine());
    $javascript->addRequiredFields('');
    $the_form .= $javascript->getScript();
    $the_form .= get_left_form_footer();
    return $the_form;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:50,代码来源:Forms.php

示例14: dostatus0

 function dostatus0()
 {
     empty($_POST['id']) && javascript::dialog("请选择要操作的评论!");
     foreach ($_POST['id'] as $k => $id) {
         $indexId = $_POST['indexId'][$id];
         iCMS_DB::query("UPDATE `#iCMS@__comment` SET `status` = '0' WHERE `id` ='{$id}'");
         iCMS_DB::query("UPDATE `#iCMS@__article` SET `comments` = comments-1  WHERE `id` ='{$indexId}'");
     }
     javascript::dialog("取消审核!", "url:0");
 }
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:10,代码来源:comment.mo.php

示例15: doEdit

 function doEdit()
 {
     $disable = explode("\r\n", dhtmlspecialchars($_POST['disable']));
     $filter = explode("\r\n", dhtmlspecialchars($_POST['filter']));
     foreach ($filter as $k => $val) {
         $filterArray[$k] = explode("=", $val);
     }
     $this->iCMS->setCache('system/word.filter', $filterArray, 0);
     $this->iCMS->setCache('system/word.disable', $disable, 0);
     javascript::dialog('更新完成!<br />3秒后返回', 'url:' . __SELF__ . '?mo=filter');
 }
开发者ID:idreamsoft,项目名称:iCMS5.1,代码行数:11,代码来源:filter.mo.php


注:本文中的javascript类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。