• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tinymce imagmanager

#1
[eluser]megabyte[/eluser]
Anyone have any success incorporating this into an existing CI admin area using an auth system?

I've attempted to follow the limited documentation to no avail.

#2
[eluser]umefarooq[/eluser]
hi try tinymce's plugin tinybrowser its working fine for CI project i have use it no problem at all

#3
[eluser]bretticus[/eluser]
This may be exactly the same thing but I've used this successfully:

http://tinymce.moxiecode.com/examples/example_22.php

This example uses jquery's flexibility to attach tinymce to textareas (etc.)

It's just a matter of modifying javascript for the page with the textarea(s.)

Good luck

EDIT: Looks like I misunderstood your question. Disregard. Sorry.

#4
[eluser]megabyte[/eluser]
I solved this, here is the solution. Codeigniter does not use native php sessions.

I thought that I could just do this in my auth login method:

Code:
//session_start();
//$_SESSION['isLoggedIn']  = TRUE;

But sadly it did not work. Chances are someone will solve this, as it would be a much easier quick solution.

But anyway this si how I did it below.

I adopted this from someone else who wrote something for CakePHP here:

http://www.webbedit.co.uk/blog_posts/vie...ilemanager



location: application/config/config.php

Code:
$config['uri_protocol']    = "PATH_INFO"; // so that it allows url string

location: imagemanager/cofig.php

Code:
$mcImageManagerConfig['ExternalAuthenticator.external_auth_url'] = "/admi/auth/tinymce_auth"; // location of auth method below
$mcImageManagerConfig['ExternalAuthenticator.secret_key'] = "codeigniter";

location: you/auth/controller

Code:
// I use an auth lib I derived from tank_auth this method below could be called anything

function tinymce_auth() {
        $secretKey = "codeigniter";
    $data['return_url'] = $_REQUEST['return_url'];
    
        if (!$this->auth_lib->is_logged_in()) die("You are not logged in.");
        $user_id = $this->auth_lib->get_user_id();
        $doc_root = $this->config->item('document_root');
        $data['config'] = array(
        'filesystem.path' => $doc_root.'images/pages/',
        'filesystem.rootpath' => $doc_root.'images/pages/'
          );
      
      $data['key'] = md5(implode('', array_values($data['config'])) . $secretKey);
      
      $this->load->view('tinymce_imagemanager_login', $data);
    }


The view:

Code:
<html>
<body>
<form method="post" action="<?php echo $return_url; ?>">
  <input type="hidden" name="key" value="<?php echo htmlentities($key); ?>" />
  <?php
    foreach ($config as $key => $value) {
     echo '<input type="hidden" name="' . htmlentities(str_replace('.', '__', $key)) . '" value="' . htmlentities($value) . '" />';
        }
    ?>
</form>
</body>
</html>


I hope this helps others.


*****

just noticed its not letting me add the needed javascript to the body tag in the view.

You need to add:

onLoad="document.forms[0].submit();"

#5
[eluser]predat0r[/eluser]
One note:

have to set config item, so tinymce knows you use external auth
Code:
$mcImageManagerConfig['authenticator'] = "ExternalAuthenticator";

great solution thanks

#6
[eluser]InsiteFX[/eluser]
This is why I bought my own editor everything built right into it file upload images a complete Assets Manager built right in.

InsiteFX

#7
[eluser]darrentaytay[/eluser]
[quote author="InsiteFX" date="1305471167"]This is why I bought my own editor everything built right into it file upload images a complete Assets Manager built right in.

InsiteFX[/quote]

Out of interest, which one did you buy?

#8
[eluser]InsiteFX[/eluser]
InnovaStudio WYSIWYG Editor

InsiteFX


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.