示例#1
0
 function draw(&$row, &$fields)
 {
     global $_CAMILA;
     if ($_CAMILA['page']->camila_exporting()) {
     } elseif (isset($this->onprint)) {
         $func = $this->onprint;
         $func($this, $row, $fields);
     } else {
         if ($this->imagepath != '') {
             $icon = $this->imagepath;
         } else {
             $icon = '../camila/images/png/' . $this->field . '_' . $this->value . '.png';
         }
         $wbmp = str_replace('png/', 'wbmp/', $icon);
         $wbmp = str_replace('.png', '.wbmp', $wbmp);
         $image = new CHAW_image($wbmp, $icon, '');
         if (!in_array($this->field, $this->report->keys) && $this->report->inline_editing) {
             $image->set_css_class('cf_editText');
         }
         if ($this->inline && $this->report->inline_editing) {
             $id = $this->field;
             foreach ($this->report->keys as $k => $v) {
                 $v = str_replace('.', '__', $v);
                 $id .= '__cf__' . $fields['camilakey_' . $v]->value;
             }
             $image->set_id($id);
         }
         $row->add_column($image);
     }
 }
示例#2
0
function camila_formupdatelink(&$field, &$row, $fields)
{
    global $_CAMILA;
    $arr = array();
    $inline_id = '';
    foreach ($fields as $key) {
        if (substr($key->field, 0, strlen('camilakey_')) == 'camilakey_' && substr($key->field, 0, strlen('camilakey_del_')) != 'camilakey_del_') {
            if (strpos($key->field, '__') !== false) {
                $kf .= 'camilakey_' . substr($key->field, strpos($key->field, '__') + 2);
            } else {
                $kf .= $key->field;
            }
            $inline_id = '__cf__' . $key->value;
            $arr[$kf] = $key->value;
        }
    }
    $reqs = 'camila_update=' . urlencode(serialize($arr)) . '&camila_token=' . camila_token(serialize($arr));
    if (isset($_REQUEST['camila_custom'])) {
        $reqs .= '&camila_custom=' . urlencode($_REQUEST['camila_custom']);
    }
    if (isset($_REQUEST['camila_share_key'])) {
        $reqs .= '&camila_share_key=' . urlencode($_REQUEST['camila_share_key']);
    }
    $pos = strpos($_CAMILA['page_url'], '?');
    if ($pos === false) {
        $link = basename($_SERVER['PHP_SELF']) . '?';
    } else {
        $link = $_CAMILA['page_url'] . '&';
    }
    if (isset($_REQUEST['camila_share_key'])) {
        $link .= 'camila_share_key=' . urlencode($_REQUEST['camila_share_key']) . '&';
    }
    $myLink = new CHAW_link($field->report->formupdatelinktext, $link . $reqs . '&camila_returl=' . urlencode($_CAMILA['returl']));
    $myLink->set_br(0);
    $image = new CHAW_image(CAMILA_IMG_DIR . 'wbmp/bullet_go.wbmp', CAMILA_IMG_DIR . 'png/bullet_go.png', '>');
    $image->set_br(0);
    $image->set_id($inline_id);
    //$myLink->add_image($image);
    $ar = array();
    $ar[0] = $image;
    $ar[1] = $myLink;
    $row->add_column($ar);
    if ($field->report->inline_editing) {
        $_CAMILA['page']->camila_add_js("<script type='text/javascript'>var camila_inline=new Array();</script>\n", 'camila_inline_array');
        $_CAMILA['page']->camila_add_js("<script type='text/javascript'>var camila_inline_script='{$link}';</script>\n", 'camila_inline_script');
        $_CAMILA['page']->camila_add_js("<script type='text/javascript'>camila_inline['{$inline_id}']='{$reqs}';</script>\n", $inline_id);
    }
}
示例#3
0
 function draw_header(&$row, $link)
 {
     global $_CAMILA;
     $_CAMILA['page']->header_cols_count++;
     if ($_CAMILA['page']->camila_exporting() || isset($this->onprint) || !$this->orderable) {
         if ($this->title == 'camilakey_id') {
             $text = new CHAW_image(CAMILA_IMG_DIR . 'wbmp/wrench_orange.wbmp', CAMILA_IMG_DIR . 'png/spacer.png', 'v');
             //$text = new CHAW_text('X');
             $text->set_id('camilatablemenu');
         } elseif (substr($this->title, 0, strlen('camilakey_')) == 'camilakey_' || substr($this->title, 0, strlen('camila_')) == 'camila_') {
             $text = new CHAW_text('');
         } else {
             $text = new CHAW_text($this->title);
         }
         $text->metatype = $this->metatype;
         $text->field = $this->field;
         $row->add_column($text);
     } else {
         $myLink = new CHAW_link($this->title, $link);
         $myLink->set_br(0);
         $orderby = $this->report->orderby;
         //if (strpos($this->report->orderby, '.') !== false)
         //    $orderby = substr($this->report->orderby, 0, strpos($this->report->orderby, '.')) . '__' . substr($this->report->orderby, strpos($this->report->orderby, '.') + 1);
         $ar = array();
         $ar[0] = $myLink;
         if ($orderby == $this->field) {
             if ($_REQUEST['d'] == '1' || $this->report->direction == 'desc') {
                 $image = new CHAW_image(CAMILA_IMG_DIR . 'wbmp/icon_sort_up.wbmp', CAMILA_IMG_DIR . 'png/icon_sort_up.png', '^');
             } else {
                 $image = new CHAW_image(CAMILA_IMG_DIR . 'wbmp/icon_sort_down.wbmp', CAMILA_IMG_DIR . 'png/icon_sort_down.png', 'v');
             }
             $image->set_br(0);
             $ar[0] = $myLink;
             $ar[1] = $image;
         } else {
             $ar[0] = $myLink;
         }
         $row->add_column($ar);
     }
 }