Re: cakePHP 2.1, ckeditor + ckfinder
this is my sample code for wotk with ckeditor 1.copy ckeditor in "webroot/js" 2. in view : Html->script('ckeditor/ckeditor'); ?> Form->textarea('info',array('class'=>'ckeditor','id'=>'editor_office2003')); ?> -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
cookie and array
hi i want send array to some cookie and then i want push some values to this array in cookie. for example: in cookie i have this: array() then array([0]=>1) then array([0]=>1,[1]=>2) then array([0]=>1,[1]=>2...) this is my code: $arr=$this->Cookie->read('braceletid'); array_push($arr,$id); $this->Cookie->write('braceletid', $arr); pr($this->Cookie->read('braceletid')); i want use this array like this. example: if (in_array(1,cookie array){ echo 'yes'; } -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: cakePHP 2.1, ckeditor + ckfinder
1. Check the folder is present at the correct location. 2. Please check the folder permissions are correct. 3. The folder needs 777 permissions for uploading a file. 4. set function CheckAuthentication() { // WARNING : DO NOT simply return "true". By doing so, you are allowing // "anyone" to upload and list the files in your server. You must implement // some kind of session validation here. Even something very simple as... // return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized']; // ... where $_SESSION['IsAuthorized'] is set to "true" as soon as the // user logs in your system. To be able to use session variables don't // forget to add session_start() at the top of this file. return true; } Hope this will help. On May 1, 8:25 am, Sean wrote: > For those that are having this problem as well, here is what I was able to > do. This took a lot of trial and error on my part! > > I have mine in: > > app/webroot/js/ckeditor > app/webroot/js/ckfinder > > I don't have anything special in my ckeditor config, just the default. > > For ckfinder, here is my config: > > * Put these lines at the top of the file after the * session_name('YOUR SESSION NAME'); - I found that my session name > was NOT 'CAKEPHP' but what I have the cookie named. > * session_start(); > > * In CheckAuthentication I have: > * if (!empty($_SESSION["Auth"])) { > if(!empty($_SESSION['Auth']['User']['admin'])) { > return true;} > } > > return false; > * The only place that I use ckeditor and ckfinder is in my admin area, > so I not only check > for user logged in, but also for admin privileges as well. > (Although, if it's configured properly > non admin users shouldn't be able to reach that point anyway, just > for added security.) > > For the $baseURL: > * $baseURL = '/path_to_cake_app/app/webroot/img/files/' - trailing > slash required!!! > (eg. '/test_dir/app/webroot/img/files/' > * For the default ckfinder directory: > '/path_to_cake_app/app/webroot/js/ckfinder/userfiles/' > * I haven't tried this on my live host yet, but I would think that > simply removing the leading path to the app > would work in a production environment ('/app/webroot/...'), I > should know shortly as I expect to turn this > into production very soon. > > For the $baseDir: > * $baseDir = resolveUrl($baseUrl); - this is the default configuration > and works well. > > For the view: > * Form->input('body', array('id' => 'body', 'class' > => 'ckeditor', 'label' => false)); ?> > > var CustomHTML = CKEDITOR.replace( 'body', > {filebrowserBrowseUrl : > '/path_to_cake/app/webroot/js/ckfinder/ckfinder.html',filebrowserWindowWidth > : '1000',filebrowserWindowHeight : '700'} > ); > > > What I haven't quite figured out is how to turn the label off on the > replaced editor. I have CSS that puts an asterisk (*) after required fields > and it appears at the very bottom right after the editor window. Anyone > have any ideas on how to remove the label from that? I assume it's being > treated as a form field of it's own. I'm not as familiar with JS as I am > PHP and CakePHP. > > Any help with that little issue would be appreciated. > > Elsewise, I hope this helps. > > Sean > > > > > > > > On Friday, April 27, 2012 2:21:45 PM UTC-4, Sean wrote: > > > Hello again, > > > I am working with cakePHP 2.1.0 and have incorporated ckeditor and > > ckfinder. I have gotten the editor window to come up and even gotten the > > ckfinder "Browse Server" button to work. What I am having problems with now > > is that when I hit the "Browse Server" button, the window opens, but gives > > me the dreaded "Folder not found. Please refresh and try again." error. > > > I have Googled, and RTFM, but to no avail. I'm not sure what else to do. I > > have tried using my own file structure, and using the default. > > > Here is some code: > > > /* > > To make it easy to configure CKFinder, the $baseUrl and $baseDir can be > > used. > > Those are helper variables used later in this config file. > > */ > > > /* > > $baseUrl : the base path used to build the final URL for the resources > > handled > > in CKFinder. If empty, the default value (/userfiles/) is used. > > > Examples: > > $baseUrl = 'http://example.com/ckfinder/files/'; > > $baseUrl = '/userfiles/'; > > > ATTENTION: The trailing slash is required. > > */ > > $baseUrl = '/js/ckfinder/userfiles/'; > > > /* > > $baseDir : the path to the local directory (in the server) which points to > > the > > above $baseUrl URL. This is the path used by CKFinder to handle the files > > in > > the server. Full write permissions must be granted to this directory. > > > Examples: > > // You may point it to a directory directly: > > $baseDir = '/home/login/public_html/ckfinder/files/'; > > $baseDir = 'C:/SiteDir/CKFinder/userfiles/'; > > > // Or you may let CKFinder discover the path, based on $baseUrl. > > // W
Re: cakePHP 2.1, ckeditor + ckfinder
For those that are having this problem as well, here is what I was able to do. This took a lot of trial and error on my part! I have mine in: app/webroot/js/ckeditor app/webroot/js/ckfinder I don't have anything special in my ckeditor config, just the default. For ckfinder, here is my config: * Put these lines at the top of the file after the Form->input('body', array('id' => 'body', 'class' => 'ckeditor', 'label' => false)); ?> var CustomHTML = CKEDITOR.replace( 'body', {filebrowserBrowseUrl : '/path_to_cake/app/webroot/js/ckfinder/ckfinder.html',filebrowserWindowWidth : '1000',filebrowserWindowHeight : '700'} ); What I haven't quite figured out is how to turn the label off on the replaced editor. I have CSS that puts an asterisk (*) after required fields and it appears at the very bottom right after the editor window. Anyone have any ideas on how to remove the label from that? I assume it's being treated as a form field of it's own. I'm not as familiar with JS as I am PHP and CakePHP. Any help with that little issue would be appreciated. Elsewise, I hope this helps. Sean On Friday, April 27, 2012 2:21:45 PM UTC-4, Sean wrote: > > Hello again, > > I am working with cakePHP 2.1.0 and have incorporated ckeditor and > ckfinder. I have gotten the editor window to come up and even gotten the > ckfinder "Browse Server" button to work. What I am having problems with now > is that when I hit the "Browse Server" button, the window opens, but gives > me the dreaded "Folder not found. Please refresh and try again." error. > > I have Googled, and RTFM, but to no avail. I'm not sure what else to do. I > have tried using my own file structure, and using the default. > > Here is some code: > > /* > To make it easy to configure CKFinder, the $baseUrl and $baseDir can be > used. > Those are helper variables used later in this config file. > */ > > /* > $baseUrl : the base path used to build the final URL for the resources > handled > in CKFinder. If empty, the default value (/userfiles/) is used. > > Examples: > $baseUrl = 'http://example.com/ckfinder/files/'; > $baseUrl = '/userfiles/'; > > ATTENTION: The trailing slash is required. > */ > $baseUrl = '/js/ckfinder/userfiles/'; > > /* > $baseDir : the path to the local directory (in the server) which points to > the > above $baseUrl URL. This is the path used by CKFinder to handle the files > in > the server. Full write permissions must be granted to this directory. > > Examples: > // You may point it to a directory directly: > $baseDir = '/home/login/public_html/ckfinder/files/'; > $baseDir = 'C:/SiteDir/CKFinder/userfiles/'; > > // Or you may let CKFinder discover the path, based on $baseUrl. > // WARNING: resolveUrl() *will not work* if $baseUrl does not start with a > slash ("/"), > // for example if $baseDir is set to http://example.com/ckfinder/files/ > $baseDir = resolveUrl($baseUrl); > > ATTENTION: The trailing slash is required. > */ > $baseDir = resolveUrl($baseUrl); > > At the moment, I have authentication turned off. I don't think it will > matter as this is in the admin area which has NO public access. Only myself > and another admin. > I have tried to use authentication and couldn't get that working either. > > I just don't know what these settings should be. I really like cakePHP, > but getting ckfinder has been REALLY mind-blowing. > I made this conversion b/c my old FCKeditor didn't work when I ported over > from 1.2 > > Any help would be appreciated. > > Thanks > > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: CakePHP (2.1) Media Plugin - Multi File Upload
Hi Jeremy, Not having much luck with the saving manually option, do you having any working examples of drag and drop (jquery) I can look at? Thanks, -Brett On Apr 17, 7:44 am, jeremyharris wrote: > > Or, instead of using the multiple option, you can try processing them each > as a single request so you don't have to change anything in your controller > but rather just how the view presents it. I've used drag and drop jQuery > plugins and the like to help with this. It's by far my favorite solution, > because it doesn't rely on browser specific features (such as HTML5 > multiple upload). > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Cakephp SSN Encryption
#1 http://bakery.cakephp.org/articles/jmillerdesign/2011/12/29/cipher_plugin_behavior #2 http://www.pentaho.com/download/ On Mon, Apr 30, 2012 at 4:46 PM, Steven Scaffidi wrote: > Hi - I'm looking for information on how to encrypt data in Cakephp. My > employer had a client management system built in Microsoft Access, and > I recently took that application and put it on a web-based space built > in cake. I need to now two things: > > #1 How can I encrypt social security numbers from new clients coming > into the system? I'm encrypting passwords right now, but I'm not sure > how to do social security numbers. > > #2 How do I take social security numbers that are currently listed in > Microsoft Access with no encryption and put them into the MySQL > database encrypted? > > Thanks for the help, > > Steven > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > at http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Cakephp SSN Encryption
Hi - I'm looking for information on how to encrypt data in Cakephp. My employer had a client management system built in Microsoft Access, and I recently took that application and put it on a web-based space built in cake. I need to now two things: #1 How can I encrypt social security numbers from new clients coming into the system? I'm encrypting passwords right now, but I'm not sure how to do social security numbers. #2 How do I take social security numbers that are currently listed in Microsoft Access with no encryption and put them into the MySQL database encrypted? Thanks for the help, Steven -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Google Map interface question
This won't be exactly what you're after, but I have recently implemented something quite similar. The following (1.3 code) will allow the user to drag and drop a pin to change the lat/long of that pin on the fly. View The first thing you'll need is to do is add a couple of json properties when you're defining each of your markers in your view, for example: var marker = new google.maps.Marker({ ... callbackUrl: "http://www.yoursite.com///", draggable: true }); Then you'll need to add an event listener to listen for the "dragend" event of the pin: // Add a "dragend" event listener so that we can determine the lat/long of the drop point google.maps.event.addListener(marker, "dragend", function() { var position = marker.getPosition(); var _data = "latitude=" + position.lat() + "&longitude=" + position.lng(); $.ajax({ type: "POST", url: marker.callbackUrl, data: _data, success: function(data) { // Do some stuff to notify the user that the lat/long has been updated } }); }); Controller In your callback action within your controller, you'll need something like this: function ($id = null) { $this->autoRender = false; if ($this->RequestHandler->isAjax()) { Configure::write('debug', 0); $this->layout = 'ajax'; $data['']['id'] = $id; // Build up the data based on the posted form values foreach($this->params['form'] as $key => $value) { $data[''][$key] = $value; } // Save the data if (!$this->->save($data)) { $this->log($data, 'error'); $this->log($this->->validationErrors, 'error'); $this->set('message', 'There was an error updating the location for ' . $['']['name'] . ''); $this->render('/elements/flash/error', 'ajax'); } else { $this->set('message', 'The location for ' . $['']['name'] . ' has been updated'); $this->render('/elements/flash/success', 'ajax'); } } } Like I said, I know this isn't exactly what you're after, but hopefully it will be of some use to you. Keith Gorman Class Outfit keithgor...@classoutfit.com www.classoutfit.com On 30 Apr 2012, at 05:13, Michael Gaiser wrote: So, I want to use Google maps on my project which makes use of a Location model. In that model there is a longitude and latitude value. Most of the tutorials I have looked at talk about how to place markers on your map. What I want to do is use the map to allow people to navigate to the location they are editing and set the longitude and latitude based on the current center of the map giving an easy interface for entering in such values. So it leads me to this question: How do I get the long/lat values from the google map and save those values to my database? Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Problems in making a page with "yes", "no" buttons and confirm dialog
Thanks for the advice. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Problems in making a page with "yes", "no" buttons and confirm dialog
On Mon, Apr 30, 2012 at 2:01 PM, Daniel wrote: > 1. the confirm dialog / message appears when the "no" button is > clicked. Because both of the buttons are submit buttons. The confirm is called on onsubmit(). > 2. the check on params['form']['no'] does not seem to stop the delete > when "no" is clicked. Perhaps you're making assumptions about the format of the data. die(debug($this->params)); > 3. the "no" button appears underneath the "yes" button, instead of to > the right of it. This is a CSS problem. I think you should take a step back and re-evaluate what it is you're trying to do here. Ask yourself if it makes any sense to have "yes" and "no" submit buttons in the first place. Why would anyone click the "no" button? You already have a javascript confirm check. Change 'Yes' to 'delete" or something like that, remove the 'No' button, as well as the test in the controller, and you'll be on your way. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Soft Delete
I did. It works. I have another problem that is related to my DB. Thanks for the help though. Regards, Will "What's wealth but the means of expanding once life? There's two ways one can do it: either by producing more our by producing it faster. And that is what I'm doing. I'm manufacturing time." Ellis Wyatt from Atlas Shrugged Sent from VeryBerry-White Book Device On Apr 30, 2012 2:38 PM, "lowpass" wrote: ife() was removed in 2.x. Just change the code to use ternary, eg. $foo ? $foo : $bar; On Mon, Apr 30, 2012 at 12:41 AM, Will wrote: > Trying to do a Soft Dele... -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Soft Delete
ife() was removed in 2.x. Just change the code to use ternary, eg. $foo ? $foo : $bar; On Mon, Apr 30, 2012 at 12:41 AM, Will wrote: > Trying to do a Soft Delete in CakePHP. I initially googled it and got some > hits. The first hit was for a SoftDeletable class. I followed all of the > instructions, however, there is an error in the code, which I do not know > how to fix since I didn't write it. I could probably email the author but I > was wondering if any of you here has dealt with this issue. > > http://cake-syrup.svn.sourceforge.net/viewvc/cake-syrup/trunk/app/models/behaviors/soft_deletable.php?view=markup > > This is the link in which I got the SoftDeleteBehavior class from, However, > when I refresh my browser I have an error on line 45 that has to do with the > ife() function. > > Can anyone help? Thanks. > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Problems in making a page with "yes", "no" buttons and confirm dialog
I am trying to make a delete confirmation page with both "yes" and "no" buttons, and a confirmation dialog box. The dialog is to confirm the "yes" option. Here is the relevant code I have: (in the ctp view file) Form->create('User', array( 'onsubmit' => 'return confirm("Really delete this account?");')); ?> ... Form->submit(__('Yes')); ?> Form->submit(__('No'), array('name' => 'no')); ?> Form->end();?> (in the controller) public function delete($id = null) { if (isset($this->params['form']['no'])) $this->redirect(array('action' => 'index')); else { $this->User->id = $id; if (!$this->User->exists()) throw new NotFoundException(__('Invalid user')); $user = $this->User->Find('first', array('conditions' => array('User.id' => $id))); $this->set('user', $user); if ($this->request->is('post') || $this->request->is('put')) { if ($this->User->delete()) { $this->Session->setFlash(__('User deleted')); $this->redirect(array('action' => 'index')); } $this->Session->setFlash(__('User was not deleted')); $this->redirect(array('action' => 'index')); } else $this->request->data = $this->User->read(null, $id); } } The problems are as follows: 1. the confirm dialog / message appears when the "no" button is clicked. 2. the check on params['form']['no'] does not seem to stop the delete when "no" is clicked. 3. the "no" button appears underneath the "yes" button, instead of to the right of it. Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: paginator with user defined page sizes...
Still can't get this to work... :-( -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Soft Delete
Trying to do a Soft Delete in CakePHP. I initially googled it and got some hits. The first hit was for a SoftDeletable class. I followed all of the instructions, however, there is an error in the code, which I do not know how to fix since I didn't write it. I could probably email the author but I was wondering if any of you here has dealt with this issue. http://cake-syrup.svn.sourceforge.net/viewvc/cake-syrup/trunk/app/models/behaviors/soft_deletable.php?view=markup This is the link in which I got the SoftDeleteBehavior class from, However, when I refresh my browser I have an error on line 45 that has to do with the ife() function. Can anyone help? Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Paginating cached data
On Monday, 30 April 2012 06:02:55 UTC+2, Jeremy Burns wrote: > > It's a 1.3 app, unfortunately. I've almost cracked it and will post back > here - hopefully later today. > The datasources repo is 2.x and 1.3 AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: problem
does folder "cakephp" in your webroot exists ?? if u use xampp for linux, then default webroot is "htdocs" folder inside xampp, check there.. -- Lep pozdrav, Tilen Majerle http://majerle.eu 2012/4/30 darryl bautista > hi, i have a problem with my apache2, when i type to my browser the > localhost/cakephp/ this text appear > > Not Found > > The requested URL /cakephp was not found on this server. > -- > Apache/2.2.20 (Ubuntu) Server at localhost Port 80 > > > can you please help me? thanks > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > at http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php