【问题标题】:add dropbox option to joomla on new user creation在创建新用户时向 joomla 添加 Dropbox 选项
【发布时间】:2012-11-19 15:55:10
【问题描述】:

我使用this plugin 允许将Dropbox 集成到joomla 中。 当用户登录 te 系统时,在您的 Dropbox 帐户中创建一个文件夹,一切正常。

我需要将此选项添加到用户创建页面。我尝试在控制器 com_users/controllers/user.php 中编辑保存功能

JModel::addIncludePath (JPATH_ROOT . DS . 'components' . DS . 'com_dropbox' . DS . 'models');


$dropbox =& JModel::getInstance('dropbox', 'dropboxModel');

我需要在这里向模型传递值:

/**
     * Creates a new folder
     *
     * This method returns the information from the newly created directory
     *
     * @param string $path
     * @return stdclass
     */
    public function createFolder($path="") {

        $path= &Jfolder::makeSafe($path);

        if (trim($path)=="")
        {
            //OK lets try to create the chroot
//              $path=$this->dropbox->chroot;
        }



        $result = $this->auth->fetch('fileops/create_folder', array('path' => $this->dropbox->folder . '/' . $path, 'root' => $this->root),'POST');
        return json_decode($result);

    }

各种尝试都没有结果......

请帮助我,谢谢...!

【问题讨论】:

    标签: joomla2.5 dropbox dropbox-php


    【解决方案1】:

    您必须包含模型文件并使用类名调用函数

    在插件中添加以下行:

    jimport( 'joomla.filesystem.folder' );
    require_once JPATH_ROOT . '/components/com_dropbox/models/filename.php';
    
    dropboxModelfilename::functionname();
    

    【讨论】:

      猜你喜欢
      • 2012-11-05
      • 2013-06-03
      • 1970-01-01
      • 1970-01-01
      • 2017-01-27
      • 1970-01-01
      • 1970-01-01
      • 2015-01-27
      • 2012-02-16
      相关资源
      最近更新 更多