示例#1
0
                 }
             }
             break;
         case TextPart::$type:
             $assoc = $_POST;
             $assoc['author_id'] = $_POST['id'];
             unset($assoc['id']);
             $part = TextPart::FetchFromAssoc($assoc);
             if ($part === NULL) {
                 $content = AlertMessage('alert-danger', Language::Word('error during text block adding'));
             } else {
                 $glob_id = 0;
                 if (isset($_POST['glob_id'])) {
                     $glob_id = $_POST['glob_id'];
                 }
                 if (TextPart::InsertToDB($part, $_POST['language'], $glob_id)) {
                     $content = AlertMessage('alert-success', Language::Word('text block is successfully added'));
                 } else {
                     $content = AlertMessage('alert-danger', Language::Word('error during text block inserting'));
                 }
             }
             break;
         default:
             # code...
             break;
     }
     require_once $link_to_admin_template;
     exit;
 } else {
     echo 'id is not specified';
 }