Exemplo n.º 1
0
	<?php 
if ($obj) {
    echo 'ID: ' . $obj->getId();
}
?>
	<?php 
echo backend_input('attrLabel', $obj, array('labelname' => 'Label', 'model' => 'ListitemI18n', 'maxlength' => '255', 'required' => 'true', 'onfocus' => ' validateEditForm();'), 'getLabel');
?>

	<?php 
if ($userType == "admin") {
    ?>
		<?php 
    echo backend_input('attrValue', $obj, array('labelname' => 'Value', 'model' => 'ListitemI18n', 'maxlength' => '255'), 'getValue');
    ?>
	<?php 
}
?>

	<?php 
echo backend_select('attrCulture', $obj, Lists::getListitemsForSelect('culture'), array('labelname' => 'Culture', 'model' => 'ListitemI18n', 'unique' => 'true', 'required' => 'true', 'onchange' => ' validateEditForm();'), 'getCulture');
?>

	<?php 
echo backend_tags($tags, $obj);
?>
	<div id='line'></div>
	<input id='btnSubmit' type='submit' class='save_btndisabled' value='' disabled/>
</form>
</div>
<script type="text/javascript">setTimeout(function(){$('#backendMsg').fadeOut(1000)},2000);</script>
Exemplo n.º 2
0
		<?php 
echo backend_tags($tags, $obj);
?>
	</div>

	<div id='tab2' name='tabAdmin' style='display: none'>
		<?php 
echo backend_hidden('attrBackend', $obj, array('labelname' => 'Backend', 'model' => 'User'), 'getBackend');
?>
		<?php 
echo backend_select('attrType', $obj, Lists::getListitemsForSelect('usertype'), array('labelname' => 'Type', 'model' => 'User'), 'getType');
?>
	</div>

	<div id='tab3' name='tabUser' style='display: none'>
		<?php 
echo backend_date('attrBirthDate', $obj, array('labelname' => 'BirthDate', 'model' => 'User'), 'getBirthDate');
?>
		<?php 
echo backend_select('attrEducation', $obj, Lists::getListitemsForSelect('educations'), array('labelname' => 'Education', 'model' => 'User'), 'getEducation');
?>
		<?php 
echo backend_media('attrCv', $obj, array('labelname' => 'Cv', 'model' => 'User'), 'getCv');
?>
		</div>

	<div id='line'></div>
	<input id='btnSubmit' type='submit' class='save_btndisabled' value='' disabled/>
</form>
</div>
<script type="text/javascript">setTimeout(function(){$('#backendMsg').fadeOut(1000)},2000);</script>
Exemplo n.º 3
0
	<?php 
    if ($obj) {
        echo 'ID: ' . $obj->getId();
    }
    ?>
	<?php 
    echo backend_input('attrLabel', $obj, array('labelname' => 'Label', 'model' => 'Lists', 'maxlength' => '255', 'required' => 'true', 'onfocus' => ' validateEditForm();'), 'getLabel');
    ?>
	<?php 
    if ($userType == "admin") {
        ?>
		<?php 
        echo backend_input('attrListId', $obj, array('labelname' => 'List ID', 'model' => 'Lists', 'maxlength' => '255', 'required' => 'true', 'onfocus' => ' validateEditForm();'), 'getListId');
        ?>
		<?php 
        echo backend_select('attrListType', $obj, Lists::getListitemsForSelect('list_types'), array('labelname' => 'List type', 'model' => 'Lists', 'required' => 'true', 'onchange' => ' validateEditForm();'), 'getListType');
        ?>
	<?php 
    }
    ?>
	<?php 
    echo backend_tags($tags, $obj);
    ?>
	<div id='line'></div>
	<input id='btnSubmit' type='submit' class='save_btndisabled' value='' disabled/>
</form>
<?php 
}
?>
</div>
<script type="text/javascript">setTimeout(function(){$('#backendMsg').fadeOut(1000)},2000);</script>
Exemplo n.º 4
0
function run_generate_cache($task, $args)
{
    ini_set("memory_limit", "2048M");
    ini_set("display_errors", 1);
    define('SF_ROOT_DIR', sfConfig::get('sf_root_dir'));
    define('SF_APP', 'frontend');
    define('SF_ENVIRONMENT', 'dev');
    define('SF_DEBUG', false);
    sfConfig::set("sf_use_relations_cache", false);
    require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
    $databaseManager = new sfDatabaseManager();
    $databaseManager->initialize();
    run_url_relations($task, $args);
    run_tags_relations($task, $args);
    echo_cms_title("GENERATING CACHE...");
    if (!class_exists("XMLParser")) {
        include sfConfig::get('sf_root_dir') . "/lib/tools/XMLParser.class.php";
    }
    if (!class_exists("FileHelper")) {
        include sfConfig::get('sf_root_dir') . "/lib/helper/FileHelper.php";
    }
    //echo_cms_sep();
    echo_cms("sf_cache_objects = " . sfConfig::get('sf_cache_objects'));
    echo_cms("sf_cache_relations = " . sfConfig::get('sf_cache_relations'));
    echo_cms("sf_cache_trees = " . sfConfig::get('sf_cache_trees'));
    //echo_cms_sep();
    if (count($args) > 0) {
        $relationsFlag = substr($args[0], 0, 3) == "rel";
        $listsFlag = substr($args[0], 0, 4) == "list";
        $cacheModel = $args[0];
        if (is_numeric($cacheModel)) {
            $obj = Document::getDocumentInstance($cacheModel);
            if ($obj) {
                $phpName = get_class($obj);
            } else {
                echo_cms_error("Object with ID=" . $cacheModel . " not found!");
                exit;
            }
        }
    }
    // parse schema file to make Schema.class.php
    $objects = XMLParser::getXMLdataValues(sfConfig::get('sf_root_dir') . "/config/schema.xml");
    $schemaFile = sfConfig::get('sf_root_dir') . "/config/Schema.class.php";
    $content = $content = "<?php\n class Schema\n{\n\n";
    echo_cms("Building " . $schemaFile . "... ");
    foreach ($objects as $obj) {
        if ($obj['tag'] == 'TABLE' && $obj['type'] == 'open') {
            $table = $obj['attributes']['PHPNAME'];
            if ($phpName && $phpName == $table) {
                $tableName = $obj['attributes']['NAME'];
            }
            $trees = explode(",", $obj['attributes']['TREE']);
            $content .= "\tpublic static function get" . $table . "Trees()\n\t{\n";
            $content .= "\t\treturn array(";
            foreach ($trees as $tree) {
                $content .= "'" . strtolower($tree) . "', ";
            }
            $content = substr($content, 0, -2);
            $content .= ");\n\t}\n\n";
            $content .= "\tpublic static function get" . $table . "Properties()\n\t{\n";
            $content .= "\t\treturn array(";
        }
        if ($obj['tag'] == 'COLUMN' && $obj['type'] == 'complete') {
            $property = $obj['attributes']['NAME'];
            $getProperty = UtilsHelper::convertFieldName($property);
            $content .= "'" . $getProperty . "', ";
        }
        if ($obj['tag'] == 'TABLE' && $obj['type'] == 'close') {
            $content = substr($content, 0, -2);
            $content .= ");\n\t}\n\n";
        }
    }
    $content .= "\n}";
    //echo_cms_sep();
    if (FileHelper::writeFile($schemaFile, $content)) {
        echo_cms($schemaFile . " writen successfully!");
    } else {
        echo_cms_error("Error writing " . $schemaFile . "!");
    }
    echo "\n";
    //echo_cms_sep();
    if (substr($args[0], 0, 5) == "schema") {
        echo_cms(" Done!");
        exit;
    }
    if (!$relationsFlag && !$listsFlag) {
        try {
            if (is_numeric($cacheModel)) {
                $obj = array();
                $obj['tag'] = 'OBJECT';
                $obj['type'] = 'complete';
                $obj['id'] = $cacheModel;
                $objects = array($obj);
                $exit = true;
            } elseif ($cacheModel) {
                $obj = array();
                $obj['tag'] = 'OBJECT';
                $obj['type'] = 'complete';
                $obj['value'] = $cacheModel;
                $objects = array($obj);
                $exit = true;
            } else {
                $objects = XMLParser::getXMLdataValues(sfConfig::get('sf_root_dir') . "/config/cachedObjects.xml");
            }
            foreach ($objects as $obj) {
                if ($obj['tag'] == 'OBJECT' && $obj['type'] == 'complete') {
                    if ($id = $obj['id']) {
                        $obj = Document::getDocumentInstance($id);
                        $model = get_class($obj);
                        $c = new Criteria();
                        $c->add($tableName . '.ID', $id);
                    } else {
                        $model = $obj['value'];
                        $c = new Criteria();
                    }
                    $classPeer = ucfirst($model) . "Peer";
                    //$c = new Criteria();
                    //$results = call_user_func(array($classPeer, 'doSelect'), $c);
                    $peerMethod = "doSelect";
                    $results = call_user_func(array($classPeer, $peerMethod), $c);
                    echo_cms("  Caching " . $model . " documents");
                    $ind = 0;
                    foreach ($results as $result) {
                        if ($ind % 20 == 0) {
                            echo $ind . "  .\r";
                        } else {
                            if ($ind % 10 == 0) {
                                echo $ind . "  o\r";
                            }
                        }
                        $ind++;
                        Document::cacheObj($result, $model, false);
                    }
                    echo_cms(" ====> " . $ind . " " . $model . " Document(s) cached.");
                    //echo_cms_sep();
                }
            }
            if ($exit) {
                exit;
            }
        } catch (Expection $e) {
            echo_cms_error(" Error: {$e}");
        }
    }
    if (!$listsFlag) {
        echo "\n";
        //echo_cms_sep();
        echo_cms("Writing relations cache");
        Relation::checkRelationCache('lock');
        try {
            $c = new Criteria();
            $c->addAscendingOrderByColumn('id1');
            $c->addAscendingOrderByColumn('document_model2');
            $c->addAscendingOrderByColumn('sort_order');
            $relations = RelationPeer::doSelect($c);
            $relationsFile = sfConfig::get('sf_root_dir') . "/cache/objcache/childrenRelations.php";
            echo_cms("Processing children :");
            $i = 0;
            $content = "<?php \n";
            $oldIDModel = '';
            $currIDModel = '';
            $idStr = '';
            foreach ($relations as $relation) {
                $currIDModel = $relation->getId1() . ':' . $relation->getDocumentModel2();
                if ($i == 0) {
                    $oldIDModel = $currIDModel;
                }
                $i++;
                echo $i . "\t\t\r";
                if ($currIDModel == $oldIDModel) {
                    $idStr .= "," . $relation->getId2();
                } else {
                    $idStr = substr($idStr, 1);
                    $content .= "\$_Rel[" . $oldId1 . "][\"" . $oldModel2 . "\"] = explode(\",\", \"" . $idStr . "\");\n";
                    $idStr = "," . $relation->getId2();
                }
                $oldIDModel = $currIDModel;
                $oldId1 = $relation->getId1();
                $oldModel2 = $relation->getDocumentModel2();
            }
            if ($idStr) {
                $idStr = substr($idStr, 1);
                $content .= "\$_Rel[" . $oldId1 . "][\"" . $oldModel2 . "\"] = explode(\",\", \"" . $idStr . "\");\n";
            }
            echo "\n";
            $content .= "\n?>";
            //echo_cms_sep();
            if (FileHelper::writeFile($relationsFile, $content)) {
                echo_cms($relationsFile . " written successfully");
            } else {
                echo_cms_error("Error writing " . $relationsFile . " !");
            }
            //echo_cms_sep();
        } catch (Exception $e) {
            echo "Error: " . $e->getMessage();
        }
        Relation::checkRelationCache('unlock');
    }
    if (!$relationsFlag) {
        echo "\n";
        //echo_cms_sep();
        echo_cms_title("Writing Lists cache");
        $listsRootFolder = Rootfolder::getRootfolderByModule("lists");
        if ($listsRootFolder) {
            $lists = Document::getChildrenOf($listsRootFolder->getId(), "Lists");
        }
        foreach ($lists as $list) {
            $listId = $list->getListId();
            echo "\t\tprocessing \"" . $listId . "\" list ...";
            $listPath = sfConfig::get('sf_root_dir') . "/cache/listscache/" . $listId . ".php";
            @unlink($listPath);
            $content = "<?php \n";
            $content .= "\$listItemsForSelect = array(\n";
            $items = Lists::getListitemsForSelect($listId, array(), false);
            foreach ($items as $key => $item) {
                $content .= "\"" . str_replace("\"", "\\\"", $key) . "\" => \"" . str_replace("\"", "\\\"", $item) . "\",\n";
            }
            $content .= ");\n?>";
            if (FileHelper::writeFile($listPath, $content)) {
                echo_cms(" Done!");
            } else {
                echo_cms_error(" Error!");
            }
        }
        //echo_cms_sep();
    }
    sfConfig::set("sf_use_relations_cache", true);
}
Exemplo n.º 5
0
	<?php 
echo panel_input('Confirmpass', $obj, array('labelname' => 'Confirm password', 'model' => 'User', 'maxlength' => '50', 'validate' => 'compare', 'class' => 'large'), 'getConfirmpass');
?>
	<?php 
echo panel_input('attrPhone', $obj, array('labelname' => 'Phone', 'model' => 'User', 'maxlength' => '20'), 'getPhone');
?>

	<?php 
echo panel_separator('hr', array('class' => 'brake'));
?>

	<?php 
echo panel_hidden('attrBackend', $obj, array('labelname' => 'Backend', 'model' => 'User'), 'getBackend');
?>
	<?php 
echo panel_select('attrType', $obj, Lists::getListitemsForSelect('usertype'), array('labelname' => 'Type', 'model' => 'User'), 'getType');
?>
	<?php 
//echo panel_date('attrBirthDate', $obj, array('labelname' => 'BirthDate' , 'model' => 'User'), 'getBirthDate');
?>

	<?php 
echo panel_separator('hr', array('class' => 'brake'));
?>
	<?php 
if (count($tags) > 0) {
    echo panel_tags($tags, $obj);
    echo panel_separator('hr', array('class' => 'brake'));
}
?>
	<?php 
Exemplo n.º 6
0
	<?php 
    echo panel_hidden('id', $obj, '', 'getId');
    ?>
	<?php 
    echo panel_hidden('parent', $sf_request->getParameter('parent'));
    ?>
	<fieldset class='drop-shadow'>

	<?php 
    echo panel_input('attrLabel', $obj, array('labelname' => 'Label', 'model' => 'Lists', 'maxlength' => '255', 'required' => 'true', 'class' => 'medium'), 'getLabel');
    ?>
	<?php 
    echo panel_input('attrListId', $obj, array('labelname' => 'List ID', 'model' => 'Lists', 'maxlength' => '255', 'required' => 'true', 'class' => 'medium'), 'getListId');
    ?>
	<?php 
    echo panel_select('attrListType', $obj, Lists::getListitemsForSelect('list_types'), array('labelname' => 'List type', 'model' => 'Lists', 'required' => 'true', 'class' => 'medium'), 'getListType');
    ?>

	<?php 
    echo panel_separator('hr', array('class' => 'brake'));
    ?>
	<?php 
    if (count($tags) > 0) {
        echo panel_tags($tags, $obj);
        echo panel_separator('hr', array('class' => 'brake'));
    }
    ?>
	<?php 
    echo panel_save_button(array('div' => 'buttons', 'class' => 'submit', 'value' => 'Save changes'));
    ?>
	<?php 
Exemplo n.º 7
0
<?php

$module = $sf_params->get("m");
?>
<div id="header-con"> 
	<!-- HEADER -->
	<div id="header">
		<div id="logo">
			<h1><a href="/panel/" title="DONE.CMS">Done.Cms</a></h1>
		</div>
		<ul id="header-nav">
	  		<li>
<?php 
$cultureArr = Lists::getListitemsForSelect('culture');
if (count($cultureArr) > 1) {
    echo panel_select('sf_culture', $sf_user->getCulture(), $cultureArr, array('labelname' => 'Select language'));
}
?>
			</li>
			<li>Welcome <a href="#" title="#" class="green"><?php 
echo $subscriber->getFirstName() . " " . $subscriber->getLastName();
?>
</a></li>
			<li><a href="/" title="#" target="_blank">Preview site</a></li>
			<li><a href="/panel/user/logout" title="#">Log out</a></li>
		</ul>
		<div class="clear"></div>
		<!-- END HEADER --> 
	</div>
</div>
Exemplo n.º 8
0
echo panel_input('attrLabel', $obj, array('labelname' => 'Label', 'model' => 'Product', 'maxlength' => 255, 'required' => 'true', 'class' => 'large'), 'getLabel');
?>
	<?php 
echo panel_image('attrImage', $obj, array('labelname' => 'Main picture', 'model' => 'Product', 'allowed' => 'images'), 'getImage');
?>
	<?php 
echo panel_input('attrShortDescription', $obj, array('labelname' => 'Short description', 'model' => 'Product', 'maxlength' => 100, 'class' => 'large'), 'getShortDescription');
?>
	<?php 
echo panel_textarea('attrDescription', $obj, array('labelname' => 'Description', 'model' => 'Product', 'size' => '50x5', 'richtext' => 'true', 'class' => 'mceEditor'), 'getDescription');
?>
	<?php 
echo panel_input('attrPrice', $obj, array('labelname' => 'Price', 'model' => 'Product', 'class' => 'short'), 'getPrice');
?>
	<?php 
echo panel_select('attrCurrency', $obj, Lists::getListitemsForSelect('currency'), array('labelname' => 'Currency', 'model' => 'Product', 'required' => 'true', 'class' => 'short'), 'getCurrency');
?>

	<?php 
if ($obj) {
    echo panel_gallery($obj->getId(), array('labelname' => 'Images gallery', 'width' => '800', 'crop_width' => '800', 'crop_height' => '600', 'thumb_width' => '120', 'path' => 'galleries_products'));
}
?>

	<?php 
echo panel_separator('hr', array('class' => 'brake'));
?>
	<?php 
if (count($tags) > 0) {
    echo panel_tags($tags, $obj);
    echo panel_separator('hr', array('class' => 'brake'));
Exemplo n.º 9
0
 			<?php 
 echo frontend_date("date_open", null, array('class' => 'small', 'rich' => 'true'));
 ?>
 		</div>              
         
 		<div class="field">
 			<label>Date of Closing </label>
 			<?php 
 echo frontend_date("date_close", null, array('class' => 'small', 'rich' => 'true'));
 ?>
 		</div>              
         
 		<div class="field">
 			<label>Service Request <span class="obligated">*</span></label> 
         	<?php 
 echo frontend_select("service", null, Lists::getListitemsForSelect("requests", array("" => "Quote")), array("class" => "serv"));
 ?>
 		</div>
 		
 		<div class="field">
 			<label></label><img src="/user/captcha">
 		</div>
 		    
 		<div class="field">
 			<label>Security </label>
 			<?php 
 echo frontend_input("captcha", null, array('class' => 'small'));
 ?>
        		<p style="margin-left:125px">Please, do smth that will prove you are not a robot</p>
 		</div>              
 	
Exemplo n.º 10
0
?>

	<div id='tab1' name='tabGeneral'>
		<?php 
echo backend_hidden('id', $obj, '', 'getId');
?>
		<?php 
echo backend_hidden('parent', $sf_request->getParameter('parent'));
?>
		<?php 
if ($obj) {
    echo 'ID: ' . $obj->getId();
}
?>
		<?php 
echo backend_select('attrType', $obj, Lists::getListitemsForSelect('usertype'), array('labelname' => 'Account type', 'model' => 'User'), 'getType');
?>
		<?php 
echo backend_input('attrFirstName', $obj, array('labelname' => 'First name', 'model' => 'User', 'maxlength' => '100', 'required' => 'true', 'onfocus' => ' validateEditForm();'), 'getFirstName');
?>
		<?php 
echo backend_input('attrLastName', $obj, array('labelname' => 'Last name', 'model' => 'User', 'maxlength' => '100'), 'getLastName');
?>
		<?php 
echo backend_input('attrLogin', $obj, array('labelname' => 'Login', 'model' => 'User', 'maxlength' => '100', 'required' => 'true'), 'getLogin');
?>
		<?php 
echo backend_input('attrEmail', $obj, array('labelname' => 'Email', 'model' => 'User', 'maxlength' => '100', 'validate' => 'Email', 'onfocus' => 'validateField(\'attrEmail\', \'admin/validateEmail\');'), 'getEmail');
?>
		<?php 
echo backend_input('attrPassword', $obj, array('labelname' => 'Password', 'model' => 'User', 'maxlength' => '50', 'onfocus' => ' validateEditForm();'), 'getPassword');
Exemplo n.º 11
0
Arquivo: Lists.php Projeto: kotow/work
 public static function updateListCache($listId = null)
 {
     if ($listId) {
         $list = Lists::getListByListId($listId);
         $lists = array($list);
     } else {
         if ($listsRootFolder = Rootfolder::getRootfolderByModule("lists")) {
             $lists = Document::getChildrenOf($listsRootFolder->getId(), "Lists");
         }
     }
     foreach ($lists as $list) {
         $listId = $list->getListId();
         $listPath = sfConfig::get('sf_root_dir') . "/cache/listscache/" . $listId . ".php";
         @unlink($listPath);
         $content = "<?php \n";
         $content .= "\$listItemsForSelect = array(\n";
         $items = Lists::getListitemsForSelect($listId, array(), false);
         foreach ($items as $key => $item) {
             $content .= "\"" . str_replace("\"", "\\\"", $key) . "\" => \"" . str_replace("\"", "\\\"", $item) . "\",\n";
         }
         $content .= ");\n?>";
         FileHelper::writeFile($listPath, $content);
     }
 }
Exemplo n.º 12
0
        ?>
				<input name="city" type="text" value="<?php 
        echo $user ? $user->getCity() : '';
        ?>
" style="<?php 
        echo $errcity;
        ?>
"/>
			</td>
		</tr>
		-->
		<tr>
			<th align="right" valign="top"><strong>Education&nbsp;&nbsp;</strong></th>
			<td>
				<?php 
        echo frontend_select('education', $user, Lists::getListitemsForSelect('educations', array('' => $select_none)), array('style' => $erreducation), "getEducation");
        ?>
			</td>
		</tr>

		<tr>
			<th align="right" valign="top"><strong>Job type&nbsp;&nbsp;</strong></th>
			<td>
				<?php 
        if (isset($user)) {
            ?>
					<input id="jobtypes" name="jobtypes" type="hidden" value="<?php 
            echo $user->getJobType();
            ?>
"/>
				<?php 
Exemplo n.º 13
0
	<?php 
echo panel_hidden('parent', $sf_request->getParameter('parent'));
?>
	<fieldset class='drop-shadow'>

	<?php 
echo panel_input('attrLabel', $obj, array('labelname' => 'Label', 'model' => 'PageI18n', 'maxlength' => 255, 'required' => 'true', 'class' => 'large'), 'getLabel');
?>
	<?php 
echo panel_input('attrNavigationTitle', $obj, array('labelname' => 'Heading', 'model' => 'PageI18n', 'maxlength' => 255, 'required' => 'true', 'class' => 'large'), 'getNavigationTitle');
?>
	<?php 
echo panel_input('attrRewriteUrl', $obj, array('labelname' => 'SEO Firendly URL', 'model' => 'PageI18n', 'maxlength' => 255, 'class' => 'large'), 'getRewriteUrl');
?>
	<?php 
echo panel_select('attrPageType', $obj, Lists::getListitemsForSelect('page_types'), array('labelname' => 'Page type', 'model' => 'PageI18n', 'required' => 'true', 'class' => 'medium', 'onchange' => 'refresh_types();'), 'getPageType');
?>
	<span id='REFERENCE' style='display:none'>
		<?php 
//echo panel_input('attrPageId', $obj, array('labelname' => 'Page to reference' , 'model' => 'PageI18n', 'maxlength' => 255, 'validate' => 'Integer'), 'getPageId');
?>
		<?php 
echo panel_select('attrPageId', $obj, $allPages, array('labelname' => 'Page to reference', 'model' => 'PageI18n', 'class' => 'medium'), 'getPageId');
?>
	</span>
	<span id='EXTERNAL' style='display:none'>
		<?php 
echo panel_input('attrUrl', $obj, array('labelname' => 'Url to external page', 'model' => 'PageI18n', 'maxlength' => 255, 'validate' => 'Url', 'class' => 'large'), 'getUrl');
?>
	</span>