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


PHP Content::storeFormValues方法代码示例

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


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

示例1: copyContent

function copyContent()
{
    if (isset($_POST['saveChanges'])) {
        $_POST['categoryId'] = $_POST['copyId'];
        $_POST['id'] = $_POST['contentId'];
        $content = new Content();
        $content->storeFormValues($_POST);
        $content->copyContent();
        header("Location: index.php?action=listContent&categoryId=" . $_POST['categoryId'] . "&success=contentCopied");
    }
}
开发者ID:sabasco,项目名称:gnscms,代码行数:11,代码来源:copyContent.php

示例2: siteIndex

function siteIndex()
{
    if (isset($_POST['siteIndex'])) {
        $content = new Content();
        $content->storeFormValues($_POST);
        $content->siteIndex();
        header("Location: index.php?action=listContent&success=siteIndexUpdated&categoryId=" . $_GET['categoryId']);
    } else {
        header("Location: index.php?action=listContent&error=siteIndexNotUpdated&categoryId=" . $_GET['categoryId']);
    }
}
开发者ID:sabasco,项目名称:gnscms,代码行数:11,代码来源:siteIndex.php

示例3: editContent

function editContent()
{
    global $lang;
    $page_lang = scandir('inc/lang/' . $_SESSION['language']);
    foreach ($page_lang as $file) {
        if ($file != '.' && $file != '..') {
            $parts = explode(".", $file);
            $page = $parts[0];
            if ($page == 'content') {
                $page_file = $file;
            }
        }
    }
    include_once 'inc/lang/' . $_SESSION['language'] . '/' . $page_file;
    if ($_SESSION['access']->content > 1) {
        $results = array();
        if (isset($_POST['saveChanges'])) {
            $_POST['id'] = $_POST['editId'];
            unset($_POST['editId']);
            // User has posted the content edit form: save the content changes
            if (!($content = Content::getById((int) $_POST['id']))) {
                header("Location: index.php?action=listContent&categoryId=" . $_GET['categoryId'] . "&error=" . ($_POST['type'] == 0) ? "category" : "page" . "NotFound");
                return;
            }
            $_POST['botAction1'] == 'on' ? $botAction1 = 'index' : ($botAction1 = 'noindex');
            $_POST['botAction2'] == 'on' ? $botAction2 = 'follow' : ($botAction2 = 'nofollow');
            $_POST['menu'] == 'on' ? $_POST['menu'] = 1 : ($_POST['menu'] = 0);
            $botActionArray = array($botAction1, $botAction2);
            $_POST['botAction'] = implode(", ", $botActionArray);
            unset($_POST['botAction1']);
            unset($_POST['botAction2']);
            $_POST['lastModified'] = date('Y-m-d');
            $content = new Content();
            $content->storeFormValues($_POST);
            $content->update();
            header("Location: index.php?action=listContent&categoryId=" . $_GET['categoryId'] . "&success=changesSaved");
        } elseif (isset($_POST['cancel'])) {
            // User has cancelled their edits: return to the content list
            header("Location: index.php?action=listContent&categoryId=" . $_GET['categoryId']);
        } else {
            // User has not submitted the content edit form: display the form
            $results['content'] = Content::getById((int) $_GET['editId']);
            require "inc/layout/editContent.php";
        }
    } else {
        require "inc/layout/noAccess.php";
    }
}
开发者ID:sabasco,项目名称:gnscms,代码行数:48,代码来源:editContent.php

示例4: newContent

function newContent()
{
    if (isset($_POST['saveChanges'])) {
        $_POST['botAction1'] == 'on' ? $botAction1 = 'index' : ($botAction1 = 'noindex');
        $_POST['botAction2'] == 'on' ? $botAction2 = 'follow' : ($botAction2 = 'nofollow');
        $_POST['menu'] == 'on' ? $_POST['menu'] = 1 : ($_POST['menu'] = 0);
        $botActionArray = array($botAction1, $botAction2);
        $_POST['botAction'] = implode(", ", $botActionArray);
        $_POST['publicationDate'] = date('Y-m-d');
        $_POST['lastModified'] = date('Y-m-d');
        $content = new Content();
        $content->storeFormValues($_POST);
        $content->insert();
        if ($_POST['type'] == 0) {
            header("Location: index.php?action=listContent&categoryId=" . $_GET['categoryId'] . "&success=categoryCreated");
        } else {
            header("Location: index.php?action=listContent&categoryId=" . $_GET['categoryId'] . "&success=pageCreated");
        }
    }
}
开发者ID:sabasco,项目名称:gnscms,代码行数:20,代码来源:newContent.php

示例5: Content

// set the content status to enabled
if ($action == 'enableContent') {
    $content = new Content();
    $content->storeFormValues($_GET);
    $content->updateStatus();
}
// set the content status to disabled
if ($action == 'disableContent') {
    $content = new Content();
    $content->storeFormValues($_GET);
    $content->updateStatus();
}
// delete the content
if ($action == 'deleteContent') {
    $content = new Content();
    $content->storeFormValues($_GET);
    $content->delete();
}
// enable the user profile
if ($action == 'enableUser') {
    $user = new User();
    $user->storeFormValues($_GET);
    $user->status();
}
// disable the user profile
if ($action == 'disableUser') {
    $user = new User();
    $user->storeFormValues($_GET);
    $user->status();
}
// delete the user profile
开发者ID:sabasco,项目名称:gnscms,代码行数:31,代码来源:rpc.php


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