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


PHP messages::portfolioModifiedNotification方法代码示例

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


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

示例1: _admEditPortfolioSaveForm


//.........这里部分代码省略.........
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/portfolio.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
    $max_time_value = 100;
    //стоимость работы из портфолио
    $max_portf_cost[0] = 100000;
    // usd
    $max_portf_cost[1] = 100000;
    // euro
    $max_portf_cost[2] = 5000000;
    // rur
    $max_portf_cost[3] = 100000;
    // fm
    $user = new users();
    $user->GetUserByUID($aForm['user_id']);
    // инициализация
    $aPortf = portfolio::GetPortfById($rec_id);
    $alert = array();
    $maxlen = $aForm['is_video'] ? 80 : 120;
    $name = substr($aForm['pname'], 0, $maxlen);
    $name = change_q_x($name, false, true, '', false, false);
    $name = $name ? $name : '';
    $descr = substr(change_q_new(trim(stripslashes($aForm['descr']))), 0, 1500);
    $prof = intval($aForm['prof']);
    $new_prof = intval($aForm['new_prof']);
    $prj_id = $rec_id;
    $cost = intval(str_replace(' ', '', $aForm['pcost']) * 100) / 100;
    $cost_type = intval($aForm['pcosttype']);
    $time_value = intval(trim($aForm['ptime']));
    $time_type = intval($aForm['ptimeei']);
    $is_video = $aForm['is_video'] ? 't' : 'f';
    $video_link = $aForm['is_video'] ? stripslashes(trim($aForm['v_video_link'])) : '';
    $link = $aForm['is_video'] ? '' : addhttp(trim(substr(change_q_x($aForm['link'], true), 0, 150)));
    $link = $link ? $link : '';
    $make_position = $aForm['make_position'];
    $make_position_num = trim($aForm['make_position_num']);
    $update_prev = intval($aForm['upd_prev']);
    $prev_type = intval($aForm['prev_type']);
    $del_prev = intval($aForm['del_prev']);
    $new_position = NULL;
    $pict = substr(change_q_new(trim(stripslashes($aForm['pict']))), 0, 1500);
    $prev_pict = substr(change_q_new(trim(stripslashes($aForm['prev_pict']))), 0, 1500);
    if ($new_prof != $prof) {
        $new_position = 0;
    }
    if (isset($make_position)) {
        switch ($make_position) {
            case 'first':
                $new_position = 1;
                break;
            case 'last':
                $new_position = 0;
                break;
            case 'num':
            default:
                $new_position = intval($make_position_num);
                $new_position = $new_position <= 0 ? 1 : $new_position;
                break;
        }
    }
    // валидация (нумерация алертов как в первоначальном варианте радактирования и новый нулевой)
    if (!$name || strlen(trim(stripslashes($aForm['pname']))) > 80) {
        $alert[1] = 'Поле заполнено некорректно';
    }
    if ($link != '' && !url_validate($link, true)) {
        $alert[6] = 'Поле заполнено некорректно';
    }
    if ($is_video == 't') {
        $v_video_link = video_validate($video_link);
        if (!$v_video_link) {
            $alert[206] = "Поле заполнено некорректно";
        } else {
            $video_link = preg_replace("/^http:\\/\\//", '', $v_video_link);
        }
    }
    if ($cost < 0 || $cost > $max_portf_cost[$cost_type]) {
        $alert[4] = 'Стоимость должна быть в пределе от 0 ' . view_range_cost2(0, $max_portf_cost[$cost_type], '', '', false, $cost_type) . ($cost_type != 2 ? '.' : '');
    }
    if ($time_value < 0 || $time_value > $max_time_value) {
        $alert[5] = 'Временные затраты должны быть в пределе от 0 до ' . $max_time_value . '.';
    }
    if ($new_prof != $prof && ($new_prof == professions::CLIENTS_PROF_ID || $new_prof == professions::BEST_PROF_ID) && portfolio::CountAll($aForm['user_id'], $new_prof, true) >= portfolio::MAX_BEST_WORKS) {
        $alert[0] = 'Превышено количество работ в этом разделе';
    }
    // сохраняем
    if (!$alert) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/messages.php';
        $sReason = _parseReason($aForm['user_id'], $aForm['adm_edit_text']);
        $portf = new portfolio();
        $portf->EditPortf($aForm['user_id'], $name, $img, $sm_img, $link, $descr, $new_prof, $cost, $cost_type, $time_type, $time_value, $prev_type, $prj_id, $file_error, $preview_error, $new_position, 0, $video_link, $update_prev, $_SESSION['uid'], $pict, $prev_pict, $user->login, $sReason);
        if ($del_prev) {
            $portf->DelPict($user->login, $prj_id, 0);
        }
        messages::portfolioModifiedNotification($aPortf, $user, $sReason);
        $content_id = user_content::MODER_PORTFOLIO;
        _admEditAfterAll($objResponse, $content_id, $rec_id, $rec_type, $sDrawFunc, $aForm);
    } else {
        _setErrors($objResponse, $alert, array(0 => 'prof', 1 => 'pname', 2 => 'descr', 4 => 'pcost', 5 => 'ptime', 6 => 'link', 206 => 'video_link'), $sDrawFunc);
    }
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:101,代码来源:adm_edit_content.server.php


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