Skip to content
Browse files

merged conflict in navigationNode.php

  • Loading branch information...
2 parents 7038775 + 550a2bd commit 7145ba3bc3472bf01a040b61ff6183073610a111 Thiago de Mello Bueno committed May 7, 2011
View
51 application/config/databaseK3.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * @package Database
+ *
+ * Database connection settings, defined as arrays, or "groups". If no group
+ * name is used when loading the database library, the group named "default"
+ * will be used.
+ *
+ * Each group can be connected to independently, and multiple groups can be
+ * connected at once.
+ *
+ * Group Options:
+ * benchmark - Enable or disable database benchmarking
+ * persistent - Enable or disable a persistent connection
+ * connection - Array of connection specific parameters; alternatively,
+ * you can use a DSN though it is not as fast and certain
+ * characters could create problems (like an '@' character
+ * in a password):
+ * 'connection' => 'mysql://dbuser:secret@localhost/kohana'
+ * character_set - Database character set
+ * table_prefix - Database table prefix
+ * object - Enable or disable object results
+ * cache - Enable or disable query caching
+ * escape - Enable automatic query builder escaping
+ */
+$config['default'] = array(
+ 'type' => 'mysql',
+ 'connection' => array(
+ /**
+ * The following options are available for MySQL:
+ *
+ * string hostname server hostname, or socket
+ * string database database name
+ * string username database username
+ * string password database password
+ * boolean persistent use persistent connections?
+ *
+ * Ports and sockets may be appended to the hostname.
+ */
+ 'hostname' => 'localhost',
+ 'database' => 'fullobject_dev',
+ 'username' => 'root',
+ 'password' => 'root',
+ 'persistent' => FALSE,
+ ),
+ 'table_prefix' => '',
+ 'charset' => 'utf8',
+ 'caching' => FALSE,
+ 'profiling' => TRUE,
+);
+return $config;
View
8 application/config/objects.xml
@@ -183,6 +183,14 @@
<link field="theLink" label="A Link for All"/>
</elements>
</template>
+
+
+ <template name="wildflowerTestObject" >
+ <elements>
+ <image field="image" label="Image of the Wildflower"/>
+ </elements>
+ </template>
+
</templates>
</configuration>
View
1 application/logs/.gitignore
@@ -0,0 +1 @@
+*
View
BIN application/media/29305_390907843268_707068268_4114906_7182725_n.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN application/media/29305_390907843268_707068268_4114906_7182725_n1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 application/media/csvtest.csv
@@ -0,0 +1,10 @@
+id,title,slug,dateadded,templateName,singleIPE,multilineIPE,singleRadioGroup,singleCheckbox,singleDate,singleTime,file,simplelist,complexList,imageList,fileList,association,theLink
+1,"A Category",a-category,"2011-04-25 17:55:03",basicCategory,,,,,,,,,,,,,
+4,"Single IPE",single-ipe,"2011-04-25 17:55:04",singleIPE,"asdf asd fasd fasd f",,,,,,,,,,,,
+7,"Multiline IPE",multiline-ipe,"2011-04-25 17:55:04",multilineIPE,,,,,,,,,,,,,
+8,"Single Radio Group",single-radio-group,"2011-04-25 17:55:04",singleRadioGroup,,,,,,,,,,,,,
+9,"Single checkbox",single-checkbox,"2011-04-25 17:55:04",singleCheckbox,,,,,,,,,,,,,
+10,"Single Date",single-date,"2011-04-25 17:55:04",singleDate,,,,,,,,,,,,,
+11,"Single Time",single-time,"2011-04-25 17:55:04",singleTime,,,,,,03:26,,,,,,,
+12,"Single File",single-file,"2011-04-25 17:55:04",singleFile,,,,,,,11385,,,,,,
+13,"Single Image",single-image,"2011-04-25 17:55:04",singleImage,,,,,,,11386,,,,,,
View
3 application/media/ctoolsAllCases.csv
@@ -0,0 +1,3 @@
+"RespondentID","CollectorID","StartDate","date","IP Address","Email Address","First Name","LastName","Custom Data","first_name","last_name","email","birth_month","birth_day","courses_code"
+1086804511,14012533,06/10/10,06/10/10,"141.211.10.7",,,,,"Byron","Beerbower","beerbowerb@michigan.gov","May",3,"PHGRA0508"
+1086805207,14012533,06/10/10,06/10/10,"141.211.10.7",,,,,"Grace","LeftHand","lefthand@tvcconnect.net","October",4,"LEBA21207"
View
BIN application/media/test_29305_390907843268_707068268_4114906_7182725_n.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN application/media/test_29305_390907843268_707068268_4114906_7182725_n1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN application/media/uithumb_29305_390907843268_707068268_4114906_7182725_n.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN application/media/uithumb_29305_390907843268_707068268_4114906_7182725_n1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN modules/mopcms/classes/.mopcms.php.swp
Binary file not shown.
View
15 modules/mopcms/classes/model/page.php
@@ -217,7 +217,7 @@ public function getListContent($family){
->find();
//get children of
- Kohana::log('info', 'hasdfasd');
+ Kohana::$log->add(Log::INFO, 'hasdfasd');
return $container->getPublishedChildren();
}
@@ -327,6 +327,7 @@ public function saveUploadedFile($field, $fileName, $type, $tmpName){
* */
public function saveUploadedImage($field, $fileName, $type, $tmpName){
$tmpName = $this->moveUploadedFileToTmpMedia($tmpName);
+ Kohana::$log->add(Log::INFO, 'clling save image'.$fileName);
$file = $this->saveImage($field, $fileName, $type, $tmpName);
return $file;
@@ -342,7 +343,7 @@ private function moveUploadedFileToTmpMedia($tmpName){
);
return $result;
}
- Kohana::log('info', 'moved file to '.mopcms::mediapath().$saveName);
+ Kohana::$log->add(Log::INFO, 'tmp moved file to '.mopcms::mediapath().$saveName);
return $saveName;
@@ -375,7 +376,7 @@ public function saveFile($field, $fileName, $type, $tmpName){
public function verifyImage($field, $tmpName){
$origwidth = $size[0];
$origheight = $size[1];
- Kohana::log('info', var_export($parameters, true));
+ Kohana::$log->add(Log::INFO, var_export($parameters, true));
if(isset($parameters['minheight']) && $origheight < $parameters['minheight']){
$result = array(
'result'=>'failed',
@@ -390,14 +391,14 @@ public function verifyImage($field, $tmpName){
);
return $result;
}
- Kohana::log('info', "passed min tests with {$origwidth} x {$origheight}");
+ Kohana::$log->add(Log::INFO, "passed min tests with {$origwidth} x {$origheight}");
}
public function saveImage($field, $fileName, $type, $tmpName){
//do the saving of the file
$file = $this->saveFile($field, $fileName, $type, $tmpName);
- Kohana::log('info', 'Returning to saveImage');
+ Kohana::$log->add('info', 'Returning to saveImage');
$imageFileName = $this->processImage($file->filename, $field);
@@ -419,11 +420,11 @@ public function processImage($filename, $field){
case 'tif':
case 'TIFF':
case 'TIF':
- Kohana::log('info', 'Converting TIFF image to JPG for resize');
+ Kohana::$log->add(Log::INFO, 'Converting TIFF image to JPG for resize');
$imageFileName = $filename.'_converted.jpg';
$command = sprintf('convert %s %s',addcslashes(mopcms::mediapath().$filename, "'\"\\ "), addcslashes(mopcms::mediapath().$imageFileName, "'\"\\ "));
- Kohana::log('info', $command);
+ Kohana::$log->add(Log::INFO, $command);
system(sprintf('convert %s %s',addcslashes(mopcms::mediapath().$filename, "'\"\\ "),addcslashes(mopcms::mediapath().$imageFileName, "'\"\\ ")));
break;
default:
View
BIN modules/mopcms/classes/mop/.cms.php.swp
Binary file not shown.
View
24 modules/mopcms/classes/mop/cms.php
@@ -180,12 +180,32 @@ public function action_getPage($id){
}
+ public function action_addchild($id, $template_id){
+ $data = $_POST;
+
+ //add the file keys in so that we can look them up in the FILES array laster
+ //consider just combining POST and FILES here
+ $fileKeys = array_keys($_FILES);
+ foreach($fileKeys as $fk){
+ $data[$fk] = null;
+ }
+ Kohana::$log->add(Log::INFO, var_export($data, true));
+ Kohana::$log->add(Log::INFO, var_export($_FILES, true));
+ $newId = mopcms::addObject($id, $template_id, $data);
+ $this->response->data($newId);
+ }
+
+ public function action_save($id){
+
+ }
+
+
/*
* Function: associate
* Associate an object to another object
*/
- public function function_associate($objectId){
+ public function action_associate($objectId){
//gotta issue here
}
@@ -199,7 +219,7 @@ public function function_associate($objectId){
$_POST - possible array of keys and values to initialize with
Returns: nav controller node object
*/
- public function function_addObject($id, $template_id, $title=null){
+ public function action_addObject($id, $template_id, $title=null){
$data = $_POST;
if($title){
View
3 modules/mopcms/classes/mop/cmsinterface.php
@@ -105,7 +105,6 @@ public function action_savefield($id){
throw new Kohana_Exception('Invalid field for template, using XPath : :xpath', array(':xpath'=>$xpath));
}
-
switch($fieldInfo->getAttribute('type')){
case 'multiSelect':
$object = ORM::Factory('page', $_POST['field']);
@@ -145,6 +144,8 @@ public function action_savefield($id){
$this->response->data(array('value'=>$value));
}
+
+
/*
Function: togglePublish
Toggles published / unpublished status via ajax. Call as cms/ajax/togglePublish/{id}/
View
29 modules/mopcms/classes/mopcms.php
@@ -70,9 +70,9 @@ public static function mediapath(){
return self::$mediapath;
}
if(Kohana::config('mop.staging')){
- self::$mediapath = Kohana::config('cms.stagingmediapath');
+ self::$mediapath = Kohana::config('mop_cms.stagingmediapath');
} else {
- self::$mediapath = Kohana::config('cms.basemediapath');
+ self::$mediapath = Kohana::config('mop_cms.basemediapath');
}
return self::$mediapath;
}
@@ -367,7 +367,6 @@ public static function checkForValidPageId($id){
Returns: the new page id
*/
public static function addObject($parent_id, $template_ident, $data = array() ){
- echo $template_ident;
$template_id = ORM::Factory('template', $template_ident)->id;
if(!$template_id){
//we're trying to add an object of template that doesn't exist in db yet
@@ -433,6 +432,7 @@ public static function addObject($parent_id, $template_ident, $data = array() ){
foreach($lookupTemplates as $tConfig){
$templates[] = $tConfig->getAttribute('name');
}
+ Kohana::$log->add(Log::ERROR,'yuh');
//add submitted data to content table
foreach($data as $field=>$value){
@@ -461,13 +461,24 @@ public static function addObject($parent_id, $template_ident, $data = array() ){
}
+ Kohana::$log->add(Log::ERROR,$fieldInfo->tagName);
switch($fieldInfo->tagName){
case 'file':
case 'image':
- $file = ORM::Factory('file');
- $file->filename = $value;
- $file->save();
- $newpage->contenttable->$field = $file->id;
+ //need to get the file out of the FILES array
+
+ Kohana::$log->add(Log::ERROR, var_export($_POST, true));
+ Kohana::$log->add(Log::ERROR, var_export($_FILES, true));
+ Kohana::$log->add(Log::ERROR,'something'.$field);
+ if(isset($_FILES[$field])){
+ Kohana::$log->add(Log::ERROR,'Adding via post file');
+ $file = mopcms::saveHttpPostFile($newpage->id, $field, $_FILES[$field]);
+ } else {
+ $file = ORM::Factory('file');
+ $file->filename = $value;
+ $file->save();
+ $newpage->contenttable->$field = $file->id;
+ }
break;
default:
$newpage->contenttable->$field = $data[$field];
@@ -527,7 +538,10 @@ public static function makeFileSaveName($filename){
}
public static function saveHttpPostFile($objectid, $field, $postFileVars){
+ Kohana::$log->add(Log::ERROR,'Addasdfasd aing via post file');
+ Kohana::$log->add(Log::ERROR, 'save uploaded');
+ Kohana::$log->add(Log::ERROR, var_export($postFileVars, true));
$object = ORM::Factory('page', $objectid);
//check the file extension
$filename = $postFileVars['name'];
@@ -545,6 +559,7 @@ public static function saveHttpPostFile($objectid, $field, $postFileVars){
case 'tiff':
case 'TIF':
case 'TIFF':
+ Kohana::$log->add(Log::ERROR, 'save uploaded');
return $object->saveUploadedImage($field, $postFileVars['name'],
$postFileVars['type'], $postFileVars['tmp_name']);
break;
View
23 modules/mopcms/init.php
@@ -0,0 +1,23 @@
+<?
+
+Route::set('cms_save', '<id>/<action>', array(
+ 'action' => 'save',
+)
+ )
+ ->defaults(
+ array(
+ 'controller' => 'cms',
+ ));
+
+
+
+Route::set('cms_addChild', '<id>/<action>/<type>', array(
+ 'action' => 'addChild',
+)
+ )
+ ->defaults(
+ array(
+ 'controller' => 'cms',
+ ));
+
+
View
22 modules/mopcore/classes/controller/ajax.php
@@ -22,6 +22,7 @@ public function action_handleRequest($uri){
public function action_data($uri)
{
//request to child, just data
+ $arguments = explode('/', $uri);
try {
$subRequest = Request::Factory($uri);
@@ -31,22 +32,26 @@ public function action_data($uri)
$message = $e->getMessage() . $e->getTrace();
$ajaxResponse = array(
'returnValue' => FALSE,
- 'response' => $message
+ 'response' => $message,
+ 'arguments'=>$arguments
);
$this->response->body(json_encode($ajaxResponse));
return;
}
$ajaxResponse = array(
'returnValue' => TRUE,
- 'response'=>$data
+ 'response'=>$data,
+ 'arguments'=>$arguments
);
$this->response->body(json_encode($ajaxResponse));
}
public function action_html($uri)
{
+ $arguments = explode('/', $uri);
+
try {
$subRequest = Request::Factory($uri);
$html = $subRequest->execute()->data();
@@ -55,7 +60,8 @@ public function action_html($uri)
$message = $e->getMessage() . $e->getTrace();
$ajaxResponse = array(
'returnValue' => FALSE,
- 'response' => $message
+ 'response' => $message,
+ 'arguments'=>$arguments
);
$this->response->body(json_encode($ajaxResponse));
@@ -87,12 +93,15 @@ public function action_html($uri)
'css'=>$cssResources
),
'returnValue' => TRUE,
+ 'arguments'=>$arguments
);
$this->response->body(json_encode($ajaxResponse));
}
public function action_compound($uri)
{
+ $arguments = explode('/', $uri);
+
try {
$subRequest = Request::Factory($uri);
$requestResponse = $subRequest->execute();
@@ -101,8 +110,8 @@ public function action_compound($uri)
$message = $e->getMessage() . $e->getTrace();
$ajaxResponse = array(
'returnValue' => FALSE,
- 'response' => $message
-
+ 'response' => $message,
+ 'arguments'=>$arguments
);
$this->response->body(json_encode($ajaxResponse));
return;
@@ -134,7 +143,8 @@ public function action_compound($uri)
);
$ajaxResponse = array(
'returnValue' => TRUE,
- 'response'=>$compoundResponse
+ 'response'=>$compoundResponse,
+ 'arguments'=>$arguments
);
$this->response->body(json_encode($ajaxResponse));
}
View
3 modules/navigation/views/navigationNode.php
@@ -1,7 +1,8 @@
+<? $keys = array_keys($content);?>
<li class="node <?=$content['nodeType'];?> <?=$content['contentType'];?> clearFix" id="node_<?=$content['id'];?>">
<h5><?=$content['title'];?></h5>
<div class="methods">
- <a class="icon togglePublish" href="#" title="unpublish NodeTitle">publish</a>
+ <a class="icon togglePublish <?echo $content[$keys[2]]?'published':'';?> " href="#" title="unpublish <?=$content['title'];?>">publish</a>
<a class="icon removeNode" title="delete">delete</a>
</div>
</li>

0 comments on commit 7145ba3

Please sign in to comment.
Something went wrong with that request. Please try again.