Plog 1.0.1 > Class / Action / Admin / Adminpostmanagementcommonaction.class.php

Questions? Need Help? Want to share? » PHP Forum
Script Name:
Plog 1.0.1

Download:
plog-1.0.1.zip

Category:
Blog

Archive Content:

Plog 1.0.1

Plog 1.0.1 > Class

Plog 1.0.1 > Class > Action

Plog 1.0.1 > Class > Action > Admin

Plog 1.0.1 > Class > Action

Plog 1.0.1 > Class > Bayesian

Plog 1.0.1 > Class > Config

Plog 1.0.1 > Class > Controller

Plog 1.0.1 > Class > Dao

Plog 1.0.1 > Class > Dao > Customfields

Plog 1.0.1 > Class > Dao

Plog 1.0.1 > Class > Dao > Status

Plog 1.0.1 > Class > Dao

Plog 1.0.1 > Class > Data

Plog 1.0.1 > Class > Data > Date

Plog 1.0.1 > Class > Data

Plog 1.0.1 > Class > Data > Forms

Plog 1.0.1 > Class > Data

Plog 1.0.1 > Class > Data > Pager

Plog 1.0.1 > Class > Data

Plog 1.0.1 > Class > Data > Validator

Plog 1.0.1 > Class > Data > Validator > Rules

Plog 1.0.1 > Class > Data > Validator

Plog 1.0.1 > Class > Database

Plog 1.0.1 > Class > Database > Adodb

Plog 1.0.1 > Class > Database > Adodb > Datadict

Plog 1.0.1 > Class > Database > Adodb > Docs

Plog 1.0.1 > Class > Database > Adodb > Drivers

Plog 1.0.1 > Class > Database > Adodb > Lang

Plog 1.0.1 > Class > Database > Adodb

Plog 1.0.1 > Class > Database > Adodb > Perf

Plog 1.0.1 > Class > Database > Adodb

Plog 1.0.1 > Class > Database

Plog 1.0.1 > Class

Plog 1.0.1 > Class > File

Plog 1.0.1 > Class > File > Finder

Plog 1.0.1 > Class > File > Unpacker

Plog 1.0.1 > Class > Gallery

Plog 1.0.1 > Class > Gallery > Dao

Plog 1.0.1 > Class > Gallery > Data

Plog 1.0.1 > Class > Gallery

Plog 1.0.1 > Class > Gallery > Getid3

Plog 1.0.1 > Class > Gallery > Helperapps

Plog 1.0.1 > Class > Gallery > Resizers

Plog 1.0.1 > Class > Gallery > Template

Plog 1.0.1 > Class > Locale

Plog 1.0.1 > Class > Logger

Plog 1.0.1 > Class > Logger > Appender

Plog 1.0.1 > Class > Logger > Config

Plog 1.0.1 > Class > Logger > Layout

Plog 1.0.1 > Class > Logger > Logger

Plog 1.0.1 > Class > Logger

Plog 1.0.1 > Class > Mail

Plog 1.0.1 > Class > Mail > Phpmailer

Plog 1.0.1 > Class > Mail > Phpmailer > Language

Plog 1.0.1 > Class > Mail > Phpmailer

Plog 1.0.1 > Class > Misc

Plog 1.0.1 > Class > Net

Plog 1.0.1 > Class > Net > Http

Plog 1.0.1 > Class > Net > Http > Phpsniff

Plog 1.0.1 > Class > Net > Http > Session

Plog 1.0.1 > Class > Net > Http

Plog 1.0.1 > Class > Net

Plog 1.0.1 > Class > Net > Xmlrpc

Plog 1.0.1 > Class > Net

Plog 1.0.1 > Class > Object

Plog 1.0.1 > Class > Plugin

Plog 1.0.1 > Class > Security

Plog 1.0.1 > Class > Summary

Plog 1.0.1 > Class > Summary > Action

Plog 1.0.1 > Class > Summary > Dao

Plog 1.0.1 > Class > Summary > Data

Plog 1.0.1 > Class > Summary > Data > Validator

Plog 1.0.1 > Class > Summary > Mail

Plog 1.0.1 > Class > Summary > View

Plog 1.0.1 > Class > Template

Plog 1.0.1 > Class > Template > Menu

Plog 1.0.1 > Class > Template > Smarty

Plog 1.0.1 > Class > Template > Smarty > Core

Plog 1.0.1 > Class > Template > Smarty

Plog 1.0.1 > Class > Template > Smarty > Plugins

Plog 1.0.1 > Class > Template > Smarty

Plog 1.0.1 > Class > Template

Plog 1.0.1 > Class > Template > Templatesets

Plog 1.0.1 > Class > Template

Plog 1.0.1 > Class > View

Plog 1.0.1 > Class > View > Admin

Plog 1.0.1 > Class > View

Plog 1.0.1 > Class > Xml

Plog 1.0.1 > Class > Xml > Parser

Plog 1.0.1 > Class > Xml

Plog 1.0.1 > Class > Xml > Rssparser

Plog 1.0.1 > Class > Xml > Rssparser > Magpierss

Plog 1.0.1 > Class > Xml > Rssparser > Magpierss > Extlib

Plog 1.0.1 > Class > Xml > Rssparser > Magpierss

Plog 1.0.1 > Class > Xml > Rssparser

Plog 1.0.1 > Class > Xml > Tree

Plog 1.0.1 > Class > Xml

Plog 1.0.1

Plog 1.0.1 > Config

Plog 1.0.1

Plog 1.0.1 > Gallery

Plog 1.0.1

Plog 1.0.1 > Imgs

Plog 1.0.1 > Imgs > .xvpics

Plog 1.0.1 > Imgs > Admin

Plog 1.0.1 > Imgs

Plog 1.0.1

Plog 1.0.1 > Install

Plog 1.0.1 > Js

Plog 1.0.1 > Js > Calendar

Plog 1.0.1 > Js > Editor

Plog 1.0.1 > Js > Htmlarea

Plog 1.0.1 > Js > Htmlarea > Docs

Plog 1.0.1 > Js > Htmlarea

Plog 1.0.1 > Js > Htmlarea > Images

Plog 1.0.1 > Js > Htmlarea > Lang

Plog 1.0.1 > Js > Htmlarea > Plugins

Plog 1.0.1 > Js > Htmlarea > Plugins > CharacterMap

Plog 1.0.1 > Js > Htmlarea > Plugins > CharacterMap > Img

Plog 1.0.1 > Js > Htmlarea > Plugins > CharacterMap > Lang

Plog 1.0.1 > Js > Htmlarea > Plugins > CharacterMap > Popups

Plog 1.0.1 > Js > Htmlarea > Plugins > ContextMenu

Plog 1.0.1 > Js > Htmlarea > Plugins > ContextMenu > Lang

Plog 1.0.1 > Js > Htmlarea > Plugins > ContextMenu

Plog 1.0.1 > Js > Htmlarea > Plugins > CSS

Plog 1.0.1 > Js > Htmlarea > Plugins > CSS > Lang

Plog 1.0.1 > Js > Htmlarea > Plugins > DynamicCSS

Plog 1.0.1 > Js > Htmlarea > Plugins > DynamicCSS > Lang

Plog 1.0.1 > Js > Htmlarea > Plugins > EnterParagraphs

Plog 1.0.1 > Js > Htmlarea > Plugins > EnterParagraphs > Lang

Plog 1.0.1 > Js > Htmlarea > Plugins > FullPage

Plog 1.0.1 > Js > Htmlarea > Plugins > FullPage > Img

Plog 1.0.1 > Js > Htmlarea > Plugins > FullPage > Lang

Plog 1.0.1 > Js > Htmlarea > Plugins > FullPage > Popups

Plog 1.0.1 > Js > Htmlarea > Plugins > FullPage

Plog 1.0.1 > Js > Htmlarea > Plugins > InsertSmiley

Plog 1.0.1 > Js > Htmlarea > Plugins > InsertSmiley > Emoticons

Plog 1.0.1 > Js > Htmlarea > Plugins > InsertSmiley > Img

Plog 1.0.1 > Js > Htmlarea > Plugins > InsertSmiley

Plog 1.0.1 > Js > Htmlarea > Plugins > InsertSmiley > Lang

Plog 1.0.1 > Js > Htmlarea > Plugins > InsertSmiley > Popups

Plog 1.0.1 > Js > Htmlarea > Plugins > ListType

Plog 1.0.1 > Js > Htmlarea > Plugins > ListType > Lang

Plog 1.0.1 > Js > Htmlarea > Plugins > ListType

Plog 1.0.1 > Js > Htmlarea > Plugins

Plog 1.0.1 > Js > Htmlarea > Plugins > TableOperations

Plog 1.0.1 > Js > Htmlarea > Plugins > TableOperations > Img

Plog 1.0.1 > Js > Htmlarea > Plugins > TableOperations > Lang

Plog 1.0.1 > Js > Htmlarea > Plugins > TableOperations

Plog 1.0.1 > Js > Htmlarea

Plog 1.0.1 > Js > Htmlarea > Popups

Plog 1.0.1 > Js > Htmlarea

Plog 1.0.1 > Js > Ie7

Plog 1.0.1 > Js > Ie7 > Src

Plog 1.0.1 > Js

Plog 1.0.1 > Js > Ui

Plog 1.0.1

Plog 1.0.1 > Locale

Plog 1.0.1 > Locale > Unsupport

Plog 1.0.1 > Plugins

Plog 1.0.1

Plog 1.0.1 > Styles

Plog 1.0.1

Plog 1.0.1 > Templates

Plog 1.0.1 > Templates > Admin

Plog 1.0.1 > Templates > Admin > Xml

Plog 1.0.1 > Templates > Blueish

Plog 1.0.1 > Templates > Grey

Plog 1.0.1 > Templates > Misc

Plog 1.0.1 > Templates > Rss

Plog 1.0.1 > Templates > Standard

Plog 1.0.1 > Templates > Standard > Imgs

Plog 1.0.1 > Templates > Standard

Plog 1.0.1 > Templates > Summary

Plog 1.0.1 > Templates > Summary > Rss

Plog 1.0.1 > Templates > Summary

Plog 1.0.1 > Templates > Wizard

Plog 1.0.1 > Tmp

Plog 1.0.1

Adminpostmanagementcommonaction.class.php:


<?php

    
include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
    include_once( 
PLOG_CLASS_PATH."class/dao/customfields/customfieldvaluefactory.class.php" );
    include_once( 
PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
    

    
/**
     * \ingroup Action
     * @private
     *
     * there is a lot of code that can be shared amongst
     * AdminAddPostAction and AdminUpdatePostAction so we'll put it all here
     * and make these two classes extend this one
     */
    
class AdminPostManagementCommonAction extends AdminAction
    
{

        var 
$_postText;
        var 
$_postExtendedText;
        var 
$_postTopic;
        var 
$_postCategories;
        var 
$_postStatus;
        var 
$_sendNotification;
        var 
$_sendPings;
        var 
$_previewPost;
        var 
$_addPost;
        var 
$_commentsEnabled;
        
// stuff about the date
        
var $_postYear;
        var 
$_postMonth;
        var 
$_postDay;
        var 
$_postHour;
        var 
$_postMinutes;
        var 
$_postTimestamp;
        
// custom fields
        
var $_customFields;
        var 
$_postSlug;
        var 
$_postId;    
    
    
        function 
AdminPostManagementCommonAction$actionInfo,  $request 
        {
            
$this->AdminAction$actionInfo,  $request );
        }
        
        function 
_fetchPostDateInformation()
        {

            
// fetch the timestamp that the post will have
              
$postDateTime $this->_request->getValue"postDateTime" );
            
$dateTimeParts explode(" ",  $postDateTime);
            
$dateParts explode("/",  $dateTimeParts[0] );
            
$timeParts explode(":", $dateTimeParts[1] );
            
$this->_postDay $dateParts[0];
            
$this->_postMonth $dateParts[1];
            
$this->_postYear $dateParts[2];
            
$this->_postHour $timeParts[0];
            
$this->_postMinutes $timeParts[1];
            
            
$this->_postTimestamp = new Timestamp();
            
$this->_postTimestamp->setMinutes$this->_postMinutes );
            
$this->_postTimestamp->setHour$this->_postHour );
            
$this->_postTimestamp->setDay$this->_postDay );
            
$this->_postTimestamp->setMonth$this->_postMonth );
            
$this->_postTimestamp->setYear$this->_postYear );
        }
        
        
/**
         * @private
         */
        
function _generateCalendarInformation()
        {
            
$this->_months $this->_locale->getMonthNames();
            
$this->_years range1990,  2030 );
            
$this->_minutes = Array( "00",  "01",  "02",  "03",  "04",  "05",  "06",  "07",  "08",  "09",
                                
"10",  "11",  "12",  "13",  "14",  "15",  "16",  "17",  "18",  "19",
                                
"20",  "21",  "22",  "23",  "24",  "25",  "26",  "27",  "28",  "29",
                                
"30",  "31",  "32",  "33",  "34",  "35",  "36",  "37",  "38",  "39",
                                
"40",  "41",  "42",  "43",  "44",  "45",  "46",  "47",  "48",  "49",
                                
"50",  "51",  "52",  "53",  "54",  "55",  "56",  "57",  "58",  "59" );
            
$this->_hours = Array( "00",  "01",  "02",  "03",  "04",  "05",  "06",  "07",  "08",
                                   
"09",  "10",  "11",  "12",  "13",  "14",  "15",  "16",  "17",
                                   
"18",  "19",  "20",  "21",  "22",  "23" );
        }
        
        
/**
         * sends xmlrpc pings
         */
        
function sendXmlRpcPings()
        {
            
// send the xmlrpc ping

            
if( !$this->_config->getValue"xmlrpc_ping_enabled",  false ))
                return 
"";

            
$blogs = new Blogs();
            
$resultArray $blogs->updateNotify$this->_blogInfo );
            
            
// check to prevent throwing an error if the list is empty
            
if( $resultArray == "" || empty( $resultArray ))
                return 
"";
            
            foreach( 
$resultArray as $host => $result ) {
                if( 
$result == "OK" )
                    
$message .= $this->_locale->tr("xmlrpc_ping_ok").$host.".<br/>";
                else {
                    
$message .= $this->_locale->tr("error_sending_xmlrpc_ping").$host.".";
                    if( 
$result != "" $message .= "<br/>".$this->_locale->tr("error_sending_xmlrpc_ping_message").$result.".";
                    
$message .= "<br/>";
                 }
            }

            return 
$message;
        }
        
        function 
_fetchCommonData()
        {
            
$this->_postText     trim(Textfilter::xhtmlize($this->_request->getValue"postText" )));
            
$this->_postExtendedText trim(Textfilter::xhtmlize($this->_request->getValue"postExtendedText" )));
            
$this->_postTopic    $this->_request->getValue"postTopic" );
            
$this->_postCategories $this->_request->getValue"postCategories" );
            
$this->_postSlug $this->_request->getValue"postSlug" );            
            
$this->_postStatus   $this->_request->getValue"postStatus" );
            
$this->_sendNotification $this->_request->getValue"sendNotification" );
            
$this->_sendTrackbacks $this->_request->getValue"sendTrackbacks" );
            
$this->_sendPings $this->_request->getValue"sendPings" );            
            
$this->_postId       $this->_request->getValue"postId" );
            
$this->_commentsEnabled $this->_request->getValue"commentsEnabled" );
                
            
// fetch the custom fields
            
$this->_customFields $this->_request->getValue"customField" );    
            
            
// fetch the timestamp that the post will have
            
$this->_fetchPostDateInformation();
        }
        
        
/**
         * @private
         */
        
function _getArticleCustomFields()
        {
            
// prepare the custom fields
            
$fields = Array();
            if( 
is_array($this->_customFields)) {
                foreach( 
$this->_customFields as $fieldId => $fieldValue ) {
                    
// 3 of those parameters are not really need when creating a new object... it's enough that
                    // we know the field definition id.
                    
$row = Array( "field_id" => $fieldId,
                                  
"field_value" => $fieldValue,
                                  
"field_name" => "",   // don't know
                                  
"field_type" => -1,  // don't know
                                  
"field_description" => "",  // don't know
                                  
"article_id" => -1,  // we don't know yet!
                                  
"blog_id" => $this->_blogInfo->getId(),
                                  
"id" => -); 
                    
// let's get the right value
                    
$customField CustomFieldValueFactory::getCustomFieldValueByFieldId$fieldId,  $row );
                    
$fieldName $customField->getName();
                    
$fields["$fieldName"] = $customField;
                }
            }        
            
            return 
$fields;
        }
    }
?>


Other Blog Scripts:

WebMaster Resources Home

©RingsWorld.com