<?php
/*
WebuddhaSEO Plugin for JoomlaSEF
(c) 2008 Webuddha, Holodyn Corporation.
All Rights Reserved Worldwide
*/
class jsefPluginWBSEO extends xclDBTable {
var $id = null;
var $sef_id = null;
var $titles_on = null;
var $titles = null;
var $meta_on = null;
var $meta = null;
function jsefPluginWBSEO( &$db, $id = null ){
$this->xclDBTable( '#__opensef_plugin_wbseo', 'id', $db, $id );
}
function load($id=null){
if (!empty($id)) {
return parent::load( $id );
} else {
return true;
}
}
function loadAliasSEO( &$aliasRow ){
if ( $aliasRow->id ){
$this->_db->setQuery("
SELECT * FROM #__opensef_plugin_wbseo AS wb
WHERE wb.sef_id = '".$aliasRow->id."'
LIMIT 1
");
$this->_db->loadObject( $row );
foreach($row AS $k=>$v){
$this->{$k} = $v;
$aliasRow->{'plugin_wbseo_'.$k} = $v;
}
return true;
}
return false;
}
function check(){
if ( !$this->sef_id )
$this->sef_id = null;
return parent::check();
}
function save(){
$POST_DATA = Array();
foreach( $_POST AS $k=>$v ){
if( preg_match('/^plugin_wbseo_/',$k) ){
$POST_DATA[preg_replace('/^plugin_wbseo_/','',$k)] = mosGetParam($_POST,$k,null);
}
}
if (!$this->bind( $POST_DATA ))
return false;
if( !$this->sef_id )
$this->sef_id = mosGetParam($_POST,'id',0);
if (!$this->check())
return false;
if (!$this->store( true ))
return false;
$this->_error = '';
return true;
}
}