/** * @param string $name The field name (task to fire: enable_fieldname / disable_fieldname) * @param string $value The current value * @param boolean $toggling if it's toggling or just displaying icon * @param int $i The row index * @return string */ function checkMarkToggle( $name, $value, $toggling, $i=null ) { global $_CB_framework; if ( $i === null ) { $i = $this->_i; } $imgpath = $_CB_framework->getCfg( 'live_site' ) . '/components/com_comprofiler/images/'; $img = $value ? 'tick.png' : 'publish_x.png'; $task = $value ? 'disable/' . $name : 'enable/' . $name; $alt = $value ? CBTxt::T('Yes') : CBTxt::T('No'); $action = $value ? CBTxt::T('Disable Item') : CBTxt::T('Enable item'); $html = ''; if ( $toggling ) { $html .= '<a href="javascript: void(0);" onclick="return cbListItemTask(this, ' // cb . "'" . $this->_controllerView->taskName( false ). "','" // task . $this->_controllerView->subtaskName( false ). "','" // subtaskName . $this->_controllerView->subtaskValue( $task, false ) . "', '" // subtaskValue . $this->_controllerView->fieldId( 'id', null, false ) . "', " // fldName . $i // id . ')" title="' . htmlspecialchars( $action ) .'">'; } $html .= '<img src="' . htmlspecialchars( $imgpath . $img ) . '" width="16" height="16" border="0" alt="'. htmlspecialchars( $alt ) . '" />'; if ( $toggling ) { $html .= '</a>'; } return $html; }
/** * returns controller view checkmark state icon * * @param string $name * @param string $value * @param bool $toggling * @param int $i * @return string * @deprecated 2.0.0 */ function checkMarkToggle($name, $value, $toggling, $i = null) { if ($i === null) { $i = $this->rowIndex; } $checkmarkTask = $value ? 'disable/' . $name : 'enable/' . $name; $checkmarkImg = $value ? 'check text-success' : 'times text-danger'; $checkmarkTitle = $value ? CBTxt::T('ENABLED_ICON_TITLE_DISABLE_ITEM', 'Disable Item') : CBTxt::T('ENABLED_ICON_TITLE_ENABLE_ITEM', 'Enable Item'); if ($toggling) { $taskName = $this->_controllerView->taskName(false); $subTaskName = $this->_controllerView->subtaskName(false); $subTaskValue = $this->_controllerView->subtaskValue($checkmarkTask, false); $fieldId = $this->_controllerView->fieldId('id', null, false); $onClick = "return cbListItemTask( this, '" . $taskName . "', '" . $subTaskName . "', '" . $subTaskValue . "', '" . $fieldId . "', '" . $i . "' );"; $return = '<a href="javascript: void(0);" onclick="' . $onClick . '">' . '<span class="fa fa-' . $checkmarkImg . ' fa-lg" title="' . htmlspecialchars($checkmarkTitle) . '"></span>' . '</a>'; return $return; } else { return '<span class="fa fa-' . $checkmarkImg . ' fa-lg" title="' . htmlspecialchars($checkmarkTitle) . '"></span>'; } }